Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abartlet tombstone reanimation wip #3

Open
wants to merge 97 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
e60433e
lib: Simplify load_case_tables_library()
vlendec Dec 7, 2014
c9235de
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.
jrasamba Dec 5, 2014
cc1f91c
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.
jrasamba Dec 5, 2014
2845e1c
s3: modules: Fix *allocate* calls to follow POSIX error return conven…
jrasamba Dec 5, 2014
6214dbd
s4-ldap: Pass on-wire transmitted control down the chain
kamenim Dec 2, 2014
29732b0
s4-tests/env_loadparm: Throw KeyError in case SMB_CONF_PATH
kamenim Dec 2, 2014
78e8baf
socket_wrapper: Add missing prototype check for eventfd.
cryptomilk Nov 26, 2014
266323d
smbd: Add missing include for iov_buflen().
cryptomilk Dec 8, 2014
4acf171
vfs: Add missing include for sys_pread() in cacheprime module.
cryptomilk Dec 8, 2014
2cd9a5c
s3:locking: pass servicename_new to leases_db_rename()
jrasamba Dec 5, 2014
5661198
s3:locking: prepare the data model for leases_db to cope with dynamic…
jrasamba Dec 5, 2014
b3b878e
s3:locking: Add new utility function leases_db_copy_file_ids()
jrasamba Dec 5, 2014
708f87b
s3:locking: pass down servicepath to leases_db_add()
jrasamba Dec 5, 2014
5ebb190
s3:locking: Change the data model for leases_db to cope with dynamic …
jrasamba Dec 5, 2014
4debc30
lib: Fix a typo
vlendec Dec 7, 2014
e2ee1a4
lib: Fix blank line endings
vlendec Dec 7, 2014
3a6a6f1
messaging3: Avoid self-send complexity
vlendec Nov 13, 2014
d775c38
lib: Simplify iov_buf[len]
vlendec Dec 6, 2014
dc38f64
lib: Use iov_buf in unix_msg
vlendec Dec 6, 2014
8a49485
smbd: Move lp_parm_bool out of notify_inotify.c
vlendec Oct 27, 2014
18b6822
notify_inotify: Simplify filter_match
vlendec Oct 26, 2014
608774d
notify_inotify: Add a NULL check
vlendec Oct 27, 2014
eb10a36
notify_inotify: Make inotify_setup return 0/errno
vlendec Oct 27, 2014
01a1678
notify_inotify: Slightly simplify inotify_watch
vlendec Oct 27, 2014
9b47445
notify_inotify: Slightly simplify watch_destructor
vlendec Oct 27, 2014
f530d6d
notify_inotify: Make inotify_watch return 0/errno
vlendec Oct 27, 2014
de4a1c9
notify: Add "dir" to notify_event
vlendec Nov 5, 2014
a5a5326
notify_inotify: inotify_watch now takes a mem_ctx
vlendec Nov 5, 2014
658ffb1
smbd: Compile notify_inotify only if available
vlendec Nov 18, 2014
9bb0728
notify_inotify: Simplify inotify_dispatch
vlendec Dec 4, 2014
8c56989
torture: Fix raw.open.chained-ntcreatex
vlendec Nov 27, 2014
a4fa9ca
vfs_glusterfs: In vfs_gluster_sys_acl_get_file/fd, reduce the number …
Oct 30, 2014
2fb4317
vfs_glusterfs: Remember the connect path too for reopening.
raghavendra-talur Dec 10, 2014
a12ae81
vfs_glusterfs: Set connectpath as snapdir-entry-path.
raghavendra-talur Dec 10, 2014
b299409
netapi: Move DC check to NetJoinDomain() where it is needed.
abartlet Dec 11, 2013
6d6c673
selftest: Add 'net dom join' test which fails cause we are a DC
cryptomilk Dec 11, 2014
c3b5f9c
auth: Allow domain join to itself when we are a PDC
abartlet Dec 11, 2013
e6ec265
libsmb: Allow change of BDC trust account password
abartlet Oct 22, 2014
0da3ab9
selftest: Add test for joining a Samba classic DC as a BDC
abartlet Oct 22, 2014
3554d88
vfs_streams_xattr: add missing call to SMB_VFS_NEXT_CONNECT
slowfranklin Dec 11, 2014
0d0a0f7
lib/util: Fix incorrect month in timestamps
martin-schwenke Dec 11, 2014
a6ecef4
s4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control
metze-samba Nov 20, 2014
7e81fe2
testprogs/test_ldb: check rootdse search with extended-dn control
metze-samba Nov 21, 2014
7c73946
libsmb: Fix removing invalid samlogon cache entries
vlendec Dec 12, 2014
8a56911
libsmb: Only print decoded netsamlogon cache entries
vlendec Dec 12, 2014
81f99bd
libsmb: Simplify netsamlogon_cache_get
vlendec Dec 12, 2014
3820196
s3:smb2_server: allow reauthentication without signing
metze-samba Dec 12, 2014
daff0f5
libcli/smb: only force signing of smb2 session setups when binding a …
metze-samba Dec 12, 2014
1325078
s4-dsdb-tests: Some tests for deleted objects undelete operation
nivanova-symas Oct 21, 2014
d6eea17
s4-dsdb: Initial implementation for Tombstone reanimation module
kamenim Oct 23, 2014
edc56c3
s4-dsdb: Insert tombstone_reanimate module in ldb modules chain after…
kamenim Oct 23, 2014
3803f3b
s4-dsdb-tests: Remove trailing ';' in deletetest.py
kamenim Oct 26, 2014
856240b
s4-dsdb-tests: Remove unused method get_ldap_connection()
kamenim Oct 26, 2014
680b63a
s4-dsdb-tests: Make unique object names to test with in deletetest
kamenim Oct 26, 2014
7976d75
s4-dsdb-tests: Fix whitespace in deletetest.py
kamenim Oct 26, 2014
8939d5c
s4-dsdb: Return error codes as windows does for Tombstone reanimation
kamenim Oct 26, 2014
c0daf35
s4-dsdb: Initialize module context only we are to handle Tombstone re…
kamenim Oct 27, 2014
57a4137
s4-dsdb: Make most specific objectCategory for an object
kamenim Oct 28, 2014
4200205
s4-dsdb: Make use dsdb_make_object_category() for objectCategory
kamenim Oct 28, 2014
50a1bb1
TODO SIGN-OFF s4-dsdb: Define internal dsdb control to mark Tombstone…
kamenim Oct 28, 2014
266695f
s4-tests: Print out what the error is in delete_force()
kamenim Nov 2, 2014
cc19ee2
s4-dsdb: Add documentation link for Tombstone Reanimation
kamenim Nov 3, 2014
b3477a3
s4-dsdb: Implement rename/modify requests as local for the module
kamenim Nov 4, 2014
4abb1a7
s4-dsdb: Mark request during Tombstone reanimation with custom LDAP c…
kamenim Nov 4, 2014
b68c32c
TODO SIGN-OFF s4-dsdb: Tests for security checks on undelete operation
nivanova-symas Nov 4, 2014
677bfff
TODO SIGN-OFF s4-dsdb: Implementation of access checks on a undelete …
nivanova-symas Nov 4, 2014
6ff9561
s4-dsdb: Some minor fixes in tombstone_reanimate, to make it work wit…
nivanova-symas Nov 4, 2014
c81fa23
TODO s4-dsdb-test: Implement samdb_connect_env() to rely solely on en…
kamenim Nov 5, 2014
7abbf2a
s4-dsdb-test: Initial implementation for Tombstone restore test suite
kamenim Nov 5, 2014
2755a4c
s4-dsdb-test: Use case insensitive comparison for DNs in undelete test
kamenim Nov 6, 2014
4b1dfb0
s4-dsdb-test: Restore User test case implementation
kamenim Nov 6, 2014
d01b9a5
s4-dsdb-test: Fix Undelete tests after subunit upgrade work
kamenim Nov 6, 2014
5a4868a
s4-dsdb-test: Restore user test case update - a bit more generic
kamenim Nov 6, 2014
813a7a3
s4-dsdb-util: Mark attributes with ADD flag in samdb_find_or_add_attr…
kamenim Nov 7, 2014
dda27fc
s4-dsdb/reanimate: Implement attribute_restore function
kamenim Nov 7, 2014
d8c90c6
s4-dsdb/samldb: Fix type "omputer" -> "computer"
kamenim Nov 7, 2014
7dfc15b
s4-dsdb/samldb: Skip 'sAMAccountType' and 'primaryGroupID' during Tom…
kamenim Nov 7, 2014
5c372d3
s4-dsdb/reanimate: Use 'show deleted' control in modify operations too
kamenim Nov 7, 2014
99bc8df
s4-dsdb/reanimate: Swap rename->modify operations to modify->rename s…
kamenim Nov 7, 2014
c2d23a7
s4-dsdb-test: Create separate TestCase for User objects
kamenim Nov 12, 2014
4cd86ed
s4-dsdb-test: Test tombstone reanimation for Group objects
kamenim Nov 13, 2014
a7ea561
s4-dsdb-test: More generic implementation for attribute list for clas…
kamenim Nov 13, 2014
a4cfa4b
s4-dsdb/reanimate: Group objects reanimation implementation
kamenim Nov 13, 2014
10097de
s4-dsdb-test: tombstone reanimation for containers test case
kamenim Nov 15, 2014
82e73c8
s4-dsdb-test: remove trailing ';' in ldap.py
kamenim Nov 16, 2014
7fefcc6
s4-dsdb/objectclass: remove duplicated declaration for objectclass_do…
kamenim Nov 16, 2014
b6a550d
s4-dsdb-test: Fix duplicated key in a dictionary in sam.py
kamenim Nov 21, 2014
11ef8dc
s4-dsdb-tests: Move base tests for Tombstone reanimation in tombstone…
kamenim Nov 26, 2014
4f0afd9
s4-dsdb-test/reanimate: Fix whitespaces according to PEP8
kamenim Nov 26, 2014
92eb987
s4-dsdb/samdb: Don't relax contraint checking during rename for Delet…
kamenim Nov 26, 2014
a8aebe2
s4-dsdb/samldb: Relax a bit restrictions in Config partition while
kamenim Nov 27, 2014
452c972
s4-dsdb/test: Delete any leftover objects in the beginning of Cross-N…
kamenim Nov 27, 2014
ca84796
s4-dsdb/samldb: Don't allow rename requests on Deleted object
kamenim Nov 27, 2014
538a712
s4-dsdb-test: Use common base method for restoring Deleted objects
kamenim Nov 27, 2014
5118bea
s4-test: Fix a check for missing LoadParm argument in connect_samdb_env
kamenim Dec 2, 2014
9815875
TODO s4-test/tombstone_reanimation: Use LoadParm directly for default…
kamenim Dec 2, 2014
11abf88
TODO s4-tests: Add tombstone_reanimation test case to s4 test suite
kamenim Dec 2, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/socket_wrapper/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ def configure(conf):
'int ioctl(int s, int r, ...)',
define='HAVE_IOCTL_INT', headers='unistd.h sys/ioctl.h')

if conf.CONFIG_SET("HAVE_EVENTFD"):
conf.CHECK_C_PROTOTYPE('eventfd',
'int eventfd(unsigned int count, int flags)',
define='HAVE_EVENTFD_UNSIGNED_INT', headers='sys/eventfd.h')

# Create full path to socket_wrapper
srcdir = os.path.realpath(conf.srcdir)
libsocket_wrapper_so_path = srcdir + '/bin/default/lib/socket_wrapper/libsocket-wrapper.so'
Expand Down
17 changes: 9 additions & 8 deletions lib/util/charset/codepoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ This is the function that should be called from library code.
********************************************************************/
void load_case_tables_library(void)
{
TALLOC_CTX *mem_ctx;
const char *codepagedir = get_dyn_CODEPAGEDIR();
size_t codepagedir_len = strlen(codepagedir);
char buf[codepagedir_len+13];

snprintf(buf, sizeof(buf), "%s/upcase.dat", codepagedir);
upcase_table = map_file(buf, 0x20000);

snprintf(buf, sizeof(buf), "%s/lowcase.dat", codepagedir);
lowcase_table = map_file(buf, 0x20000);

mem_ctx = talloc_init("load_case_tables");
if (!mem_ctx) {
smb_panic("No memory for case_tables");
}
upcase_table = map_file(talloc_asprintf(mem_ctx, "%s/upcase.dat", get_dyn_CODEPAGEDIR()), 0x20000);
lowcase_table = map_file(talloc_asprintf(mem_ctx, "%s/lowcase.dat", get_dyn_CODEPAGEDIR()), 0x20000);
talloc_free(mem_ctx);
if (upcase_table == NULL) {
DEBUG(1, ("Failed to load upcase.dat, will use lame ASCII-only case sensitivity rules\n"));
upcase_table = (void *)-1;
Expand Down
70 changes: 35 additions & 35 deletions lib/util/charset/iconv.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
/*
Unix SMB/CIFS implementation.
minimal iconv implementation
Copyright (C) Andrew Tridgell 2001
Copyright (C) Jelmer Vernooij 2002

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Expand Down Expand Up @@ -80,7 +80,7 @@ static const struct charset_functions builtin_functions[] = {
{"ASCII", ascii_pull, ascii_push},
{"646", ascii_pull, ascii_push},
{"ISO-8859-1", latin1_pull, latin1_push},
#ifdef DEVELOPER
#ifdef DEVELOPER
{"WEIRD", weird_pull, weird_push, true},
#endif
#ifdef DARWINOS
Expand All @@ -94,12 +94,12 @@ static const struct charset_functions builtin_functions[] = {
/* if there was an error then reset the internal state,
this ensures that we don't have a shift state remaining for
character sets like SJIS */
static size_t sys_iconv(void *cd,
static size_t sys_iconv(void *cd,
const char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft)
{
size_t ret = iconv((iconv_t)cd,
discard_const_p(char *, inbuf), inbytesleft,
size_t ret = iconv((iconv_t)cd,
discard_const_p(char *, inbuf), inbytesleft,
outbuf, outbytesleft);
if (ret == (size_t)-1) iconv(cd, NULL, NULL, NULL, NULL);
return ret;
Expand All @@ -112,13 +112,13 @@ static size_t sys_iconv(void *cd,
* It only knows about a very small number of character sets - just
* enough that Samba works on systems that don't have iconv.
**/
_PUBLIC_ size_t smb_iconv(smb_iconv_t cd,
_PUBLIC_ size_t smb_iconv(smb_iconv_t cd,
const char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft)
{
/* in many cases we can go direct */
if (cd->direct) {
return cd->direct(cd->cd_direct,
return cd->direct(cd->cd_direct,
inbuf, inbytesleft, outbuf, outbytesleft);
}

Expand Down Expand Up @@ -189,7 +189,7 @@ _PUBLIC_ smb_iconv_t smb_iconv_open_ex(TALLOC_CTX *mem_ctx, const char *tocode,
int i;

ret = (smb_iconv_t)talloc_named(mem_ctx,
sizeof(*ret),
sizeof(*ret),
"iconv(%s,%s)", tocode, fromcode);
if (!ret) {
errno = ENOMEM;
Expand All @@ -211,15 +211,15 @@ _PUBLIC_ smb_iconv_t smb_iconv_open_ex(TALLOC_CTX *mem_ctx, const char *tocode,
from = &builtin_functions[i];
}
}
if (strcasecmp(tocode, builtin_functions[i].name) == 0) {
if (strcasecmp(tocode, builtin_functions[i].name) == 0) {
if (use_builtin_handlers || builtin_functions[i].samba_internal_charset) {
to = &builtin_functions[i];
}
}
}

#ifdef HAVE_NATIVE_ICONV
/* the from and to varaibles indicate a samba module or
/* the from and to variables indicate a samba module or
* internal conversion, ret->pull and ret->push are
* initialised only in this block for iconv based
* conversions */
Expand All @@ -232,7 +232,7 @@ _PUBLIC_ smb_iconv_t smb_iconv_open_ex(TALLOC_CTX *mem_ctx, const char *tocode,
ret->pull = sys_iconv;
}
}

if (to == NULL) {
ret->cd_push = iconv_open(tocode, "UTF-16LE");
if (ret->cd_push == (iconv_t)-1)
Expand All @@ -246,7 +246,7 @@ _PUBLIC_ smb_iconv_t smb_iconv_open_ex(TALLOC_CTX *mem_ctx, const char *tocode,
if (ret->pull == NULL && from == NULL) {
goto failed;
}

if (ret->push == NULL && to == NULL) {
goto failed;
}
Expand Down Expand Up @@ -340,7 +340,7 @@ static size_t ascii_pull(void *cd, const char **inbuf, size_t *inbytesleft,
errno = E2BIG;
return -1;
}

return 0;
}

Expand Down Expand Up @@ -379,7 +379,7 @@ static size_t ascii_push(void *cd, const char **inbuf, size_t *inbytesleft,
errno = E2BIG;
return -1;
}

return ir_count;
}

Expand Down Expand Up @@ -469,7 +469,7 @@ static size_t ucs2hex_pull(void *cd, const char **inbuf, size_t *inbytesleft,
errno = EINVAL;
return -1;
}

if (sscanf(&(*inbuf)[1], "%04x", &v) != 1) {
errno = EILSEQ;
return -1;
Expand All @@ -487,7 +487,7 @@ static size_t ucs2hex_pull(void *cd, const char **inbuf, size_t *inbytesleft,
errno = E2BIG;
return -1;
}

return 0;
}

Expand All @@ -497,7 +497,7 @@ static size_t ucs2hex_push(void *cd, const char **inbuf, size_t *inbytesleft,
while (*inbytesleft >= 2 && *outbytesleft >= 1) {
char buf[6];

if ((*inbuf)[1] == 0 &&
if ((*inbuf)[1] == 0 &&
((*inbuf)[0] & 0x80) == 0 &&
(*inbuf)[0] != '@') {
(*outbuf)[0] = (*inbuf)[0];
Expand Down Expand Up @@ -528,7 +528,7 @@ static size_t ucs2hex_push(void *cd, const char **inbuf, size_t *inbytesleft,
errno = E2BIG;
return -1;
}

return 0;
}

Expand Down Expand Up @@ -618,7 +618,7 @@ static size_t utf8_pull(void *cd, const char **inbuf, size_t *inbytesleft,

if ((c[0] & 0xf0) == 0xe0) {
if (in_left < 3 ||
(c[1] & 0xc0) != 0x80 ||
(c[1] & 0xc0) != 0x80 ||
(c[2] & 0xc0) != 0x80) {
errno = EILSEQ;
goto error;
Expand All @@ -635,15 +635,15 @@ static size_t utf8_pull(void *cd, const char **inbuf, size_t *inbytesleft,
if ((c[0] & 0xf8) == 0xf0) {
unsigned int codepoint;
if (in_left < 4 ||
(c[1] & 0xc0) != 0x80 ||
(c[1] & 0xc0) != 0x80 ||
(c[2] & 0xc0) != 0x80 ||
(c[3] & 0xc0) != 0x80) {
errno = EILSEQ;
goto error;
}
codepoint =
(c[3]&0x3f) |
((c[2]&0x3f)<<6) |
codepoint =
(c[3]&0x3f) |
((c[2]&0x3f)<<6) |
((c[1]&0x3f)<<12) |
((c[0]&0x7)<<18);
if (codepoint < 0x10000) {
Expand Down Expand Up @@ -758,7 +758,7 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft,
c[0] = 0xe0 | (codepoint >> 12);
c[1] = 0x80 | ((codepoint >> 6) & 0x3f);
c[2] = 0x80 | (codepoint & 0x3f);

in_left -= 2;
out_left -= 3;
uc += 2;
Expand All @@ -775,9 +775,9 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft,
errno = EILSEQ;
goto error;
}
codepoint = 0x10000 + (uc[2] | ((uc[3] & 0x3)<<8) |
codepoint = 0x10000 + (uc[2] | ((uc[3] & 0x3)<<8) |
(uc[0]<<10) | ((uc[1] & 0x3)<<18));

if (out_left < 4) {
errno = E2BIG;
goto error;
Expand All @@ -786,7 +786,7 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft,
c[1] = 0x80 | ((codepoint >> 12) & 0x3f);
c[2] = 0x80 | ((codepoint >> 6) & 0x3f);
c[3] = 0x80 | (codepoint & 0x3f);

in_left -= 4;
out_left -= 4;
uc += 4;
Expand All @@ -807,7 +807,7 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft,
*outbytesleft = out_left;
*inbuf = (const char *)uc;
*outbuf = (char *)c;

return 0;

error:
Expand Down Expand Up @@ -853,7 +853,7 @@ static size_t utf16_munged_pull(void *cd, const char **inbuf, size_t *inbyteslef
unsigned int codepoint2;
if (in_left < 4) {
codepoint = 0xfffd;
goto codepoint16;
goto codepoint16;
}
codepoint2 = uc[2] | (uc[3]<<8);
if ((codepoint2 & 0xfc00) != 0xdc00) {
Expand Down Expand Up @@ -883,12 +883,12 @@ static size_t utf16_munged_pull(void *cd, const char **inbuf, size_t *inbyteslef
codepoint16:
c[0] = codepoint & 0xFF;
c[1] = (codepoint>>8) & 0xFF;

in_left -= 2;
out_left -= 2;
uc += 2;
c += 2;
continue;
continue;
}

if (in_left == 1) {
Expand All @@ -905,7 +905,7 @@ static size_t utf16_munged_pull(void *cd, const char **inbuf, size_t *inbyteslef
*outbytesleft = out_left;
*inbuf = (const char *)uc;
*outbuf = (char *)c;

return 0;

error:
Expand Down
16 changes: 8 additions & 8 deletions lib/util/idtree.c
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
/*
Unix SMB/CIFS implementation.

very efficient functions to manage mapping a id (such as a fnum) to
a pointer. This is used for fnum and search id allocation.

Copyright (C) Andrew Tridgell 2004

This code is derived from lib/idr.c in the 2.6 Linux kernel, which was
This code is derived from lib/idr.c in the 2.6 Linux kernel, which was
written by Jim Houston [email protected], and is
Copyright (C) 2002 by Concurrent Computer Corporation

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Expand Down Expand Up @@ -53,7 +53,7 @@
#define set_bit(bit, v) (v) |= (1<<(bit))
#define clear_bit(bit, v) (v) &= ~(1<<(bit))
#define test_bit(bit, v) ((v) & (1<<(bit)))

struct idr_layer {
uint32_t bitmap;
struct idr_layer *ary[IDR_SIZE];
Expand Down Expand Up @@ -195,7 +195,7 @@ static int idr_get_new_above_int(struct idr_context *idp, void *ptr, int startin
int layers, v, id;

idr_pre_get(idp);

id = starting_id;
build_up:
p = idp->top;
Expand Down Expand Up @@ -309,7 +309,7 @@ static int _idr_remove(struct idr_context *idp, int id)
return -1;
}

if ( idp->top && idp->top->count == 1 &&
if ( idp->top && idp->top->count == 1 &&
(idp->layers > 1) &&
idp->top->ary[0]) {
/* We can drop a layer */
Expand Down
2 changes: 1 addition & 1 deletion lib/util/time_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ char *timeval_str_buf(const struct timeval *tp, bool rfc5424, bool hires,
(rfc5424 ?
"%04d-%02d-%02dT%02d:%02d:%02d" :
"%04d/%02d/%02d %02d:%02d:%02d"),
1900 + tm->tm_year, tm->tm_mon, tm->tm_mday,
1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);

if ((rfc5424 || hires) && (len < sizeof(dst->buf))) {
Expand Down
Loading