Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
a4e3706e
Commit
a4e3706e
authored
Nov 08, 2008
by
Quanah Gibson-Mount
Browse files
Warnings cleanup
parent
698c43b5
Changes
39
Hide whitespace changes
Inline
Side-by-side
clients/tools/common.c
View file @
a4e3706e
...
...
@@ -625,7 +625,7 @@ tool_args( int argc, char **argv )
(
unsigned
char
*
)
bv
.
bv_val
,
bv
.
bv_len
);
if
(
retcode
==
-
1
||
retcode
>
bv
.
bv_len
)
{
if
(
retcode
==
-
1
||
(
unsigned
)
retcode
>
bv
.
bv_len
)
{
fprintf
(
stderr
,
"Unable to parse value of general control %s
\n
"
,
control
);
usage
();
...
...
@@ -1310,7 +1310,7 @@ tool_bind( LDAP *ld )
sctrlsp
=
sctrls
;
}
assert
(
nsctrls
<
sizeof
(
sctrls
)
/
sizeof
(
sctrls
[
0
])
);
assert
(
nsctrls
<
(
int
)
(
sizeof
(
sctrls
)
/
sizeof
(
sctrls
[
0
])
)
);
if
(
authmethod
==
LDAP_AUTH_SASL
)
{
#ifdef HAVE_CYRUS_SASL
...
...
@@ -1523,7 +1523,7 @@ tool_server_controls( LDAP *ld, LDAPControl *extra_c, int count )
ber_init2
(
ber
,
NULL
,
LBER_USE_DER
);
if
(
ber_printf
(
ber
,
"s"
,
proxydn
)
==
LBER_ERROR
)
{
if
(
ber_printf
(
ber
,
"s"
,
proxydn
)
==
-
1
)
{
exit
(
EXIT_FAILURE
);
}
...
...
clients/tools/ldapsearch.c
View file @
a4e3706e
...
...
@@ -856,13 +856,13 @@ getNextPage:
&
sync_cookie
);
}
if
(
err
==
LBER_ERROR
)
{
if
(
err
==
-
1
)
{
ber_free
(
syncber
,
1
);
fprintf
(
stderr
,
_
(
"ldap sync control encoding error!
\n
"
)
);
return
EXIT_FAILURE
;
}
if
(
ber_flatten
(
syncber
,
&
syncbvalp
)
==
LBER_ERROR
)
{
if
(
ber_flatten
(
syncber
,
&
syncbvalp
)
==
-
1
)
{
return
EXIT_FAILURE
;
}
...
...
@@ -1618,7 +1618,7 @@ static int print_result(
tool_write_ldif
(
LDIF_PUT_TEXT
,
"text"
,
line
,
next
?
next
-
line
:
strlen
(
line
)
);
next
?
(
size_t
)
(
next
-
line
)
:
strlen
(
line
));
line
=
next
?
next
+
1
:
NULL
;
}
...
...
libraries/libldap/abandon.c
View file @
a4e3706e
...
...
@@ -447,8 +447,7 @@ int
ldap_int_bisect_delete
(
ber_int_t
**
vp
,
ber_len_t
*
np
,
int
id
,
int
idx
)
{
ber_int_t
*
v
;
ber_len_t
n
;
int
i
;
ber_len_t
i
,
n
;
assert
(
vp
!=
NULL
);
assert
(
np
!=
NULL
);
...
...
libraries/libldap/ldap_sync.c
View file @
a4e3706e
...
...
@@ -691,7 +691,7 @@ ldap_sync_init( ldap_sync_t *ls, int mode )
rc
?
"!!! "
:
""
,
rc
);
#endif
/* LDAP_SYNC_TRACE */
if
(
rc
==
LBER_ERROR
)
{
if
(
rc
<
0
)
{
rc
=
LDAP_OTHER
;
goto
done
;
}
...
...
libraries/libldap/request.c
View file @
a4e3706e
...
...
@@ -1099,7 +1099,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
/* See if we've already requested this DN with this conn */
LDAPRequest
*
lp
;
int
looped
=
0
;
in
t
len
=
srv
->
lud_dn
?
strlen
(
srv
->
lud_dn
)
:
0
;
ber_len_
t
len
=
srv
->
lud_dn
?
strlen
(
srv
->
lud_dn
)
:
0
;
for
(
lp
=
origreq
;
lp
;
)
{
if
(
lp
->
lr_conn
==
lc
&&
len
==
lp
->
lr_dn
.
bv_len
...
...
@@ -1358,7 +1358,7 @@ ldap_chase_referrals( LDAP *ld,
if
((
lc
=
find_connection
(
ld
,
srv
,
1
))
!=
NULL
)
{
LDAPRequest
*
lp
;
int
looped
=
0
;
in
t
len
=
srv
->
lud_dn
?
strlen
(
srv
->
lud_dn
)
:
0
;
ber_len_
t
len
=
srv
->
lud_dn
?
strlen
(
srv
->
lud_dn
)
:
0
;
for
(
lp
=
lr
;
lp
;
lp
=
lp
->
lr_parent
)
{
if
(
lp
->
lr_conn
==
lc
&&
len
==
lp
->
lr_dn
.
bv_len
)
...
...
libraries/liblutil/passwd.c
View file @
a4e3706e
...
...
@@ -716,7 +716,7 @@ static int chk_lanman(
const
struct
berval
*
cred
,
const
char
**
text
)
{
in
t
i
;
ber_len_
t
i
;
char
UcasePassword
[
15
];
des_cblock
key
;
des_key_schedule
schedule
;
...
...
@@ -1003,7 +1003,7 @@ static int hash_lanman(
const
char
**
text
)
{
in
t
i
;
ber_len_
t
i
;
char
UcasePassword
[
15
];
des_cblock
key
;
des_key_schedule
schedule
;
...
...
libraries/liblutil/utils.c
View file @
a4e3706e
...
...
@@ -940,7 +940,7 @@ lutil_snprintf( char *buf, ber_len_t bufsize, char **next, ber_len_t *len, LDAP_
*
len
=
ret
;
}
if
(
ret
>=
bufsize
)
{
if
(
(
unsigned
)
ret
>=
bufsize
)
{
if
(
next
)
{
*
next
=
&
buf
[
bufsize
-
1
];
}
...
...
servers/slapd/aci.c
View file @
a4e3706e
...
...
@@ -1043,7 +1043,7 @@ static int
OpenLDAPaciValidatePerms
(
struct
berval
*
perms
)
{
int
i
;
ber_len_t
i
;
for
(
i
=
0
;
i
<
perms
->
bv_len
;
)
{
switch
(
perms
->
bv_val
[
i
]
)
{
...
...
servers/slapd/alock.c
View file @
a4e3706e
...
...
@@ -178,7 +178,7 @@ alock_read_iattr ( unsigned char * bufptr )
assert
(
bufptr
!=
NULL
);
bufptr
+=
sizeof
(
unsigned
long
int
);
for
(
count
=
0
;
count
<=
sizeof
(
unsigned
long
int
);
++
count
)
{
for
(
count
=
0
;
count
<=
(
int
)
sizeof
(
unsigned
long
int
);
++
count
)
{
val
<<=
8
;
val
+=
(
unsigned
long
int
)
*
bufptr
--
;
}
...
...
servers/slapd/attr.c
View file @
a4e3706e
...
...
@@ -213,7 +213,7 @@ attr_dup2( Attribute *tmp, Attribute *a )
{
tmp
->
a_flags
=
a
->
a_flags
&
SLAP_ATTR_PERSISTENT_FLAGS
;
if
(
a
->
a_vals
!=
NULL
)
{
int
i
;
unsigned
i
,
j
;
tmp
->
a_numvals
=
a
->
a_numvals
;
tmp
->
a_vals
=
ch_malloc
(
(
tmp
->
a_numvals
+
1
)
*
sizeof
(
struct
berval
)
);
...
...
@@ -228,7 +228,6 @@ attr_dup2( Attribute *tmp, Attribute *a )
assert
(
a
->
a_nvals
!=
NULL
);
if
(
a
->
a_nvals
!=
a
->
a_vals
)
{
int
j
;
tmp
->
a_nvals
=
ch_malloc
(
(
tmp
->
a_numvals
+
1
)
*
sizeof
(
struct
berval
)
);
for
(
j
=
0
;
!
BER_BVISNULL
(
&
a
->
a_nvals
[
j
]
);
j
++
)
{
...
...
servers/slapd/back-bdb/add.c
View file @
a4e3706e
...
...
@@ -34,7 +34,7 @@ bdb_add(Operation *op, SlapReply *rs )
AttributeDescription
*
entry
=
slap_schema
.
si_ad_entry
;
DB_TXN
*
ltid
=
NULL
,
*
lt2
,
*
rtxn
;
ID
eid
=
NOID
;
struct
bdb_op_info
opinfo
=
{
0
};
struct
bdb_op_info
opinfo
=
{
{{
0
}}
};
int
subentry
;
DB_LOCK
lock
;
...
...
servers/slapd/back-bdb/back-bdb.h
View file @
a4e3706e
...
...
@@ -332,7 +332,7 @@ extern int __db_logmsg(const DB_ENV *env, DB_TXN *txn, const char *op, u_int32_t
/* Copy a pointer "src" to a pointer "dst" from big-endian to native order */
#define BDB_DISK2ID( src, dst ) \
do {
int
i0; ID tmp = 0; unsigned char *_p; \
do {
unsigned
i0; ID tmp = 0; unsigned char *_p; \
_p = (unsigned char *)(src); \
for ( i0=0; i0<sizeof(ID); i0++ ) { \
tmp <<= 8; tmp |= *_p++; \
...
...
servers/slapd/back-bdb/cache.c
View file @
a4e3706e
...
...
@@ -747,7 +747,7 @@ bdb_cache_lru_purge( struct bdb_info *bdb )
if
(
islocked
)
bdb_cache_entryinfo_unlock
(
elru
);
if
(
count
>=
bdb
->
bi_cache
.
c_minfree
)
{
if
(
(
unsigned
)
count
>=
bdb
->
bi_cache
.
c_minfree
)
{
ldap_pvt_thread_mutex_lock
(
&
bdb
->
bi_cache
.
c_count_mutex
);
bdb
->
bi_cache
.
c_cursize
-=
count
;
ldap_pvt_thread_mutex_unlock
(
&
bdb
->
bi_cache
.
c_count_mutex
);
...
...
servers/slapd/back-bdb/delete.c
View file @
a4e3706e
...
...
@@ -35,7 +35,7 @@ bdb_delete( Operation *op, SlapReply *rs )
AttributeDescription
*
children
=
slap_schema
.
si_ad_children
;
AttributeDescription
*
entry
=
slap_schema
.
si_ad_entry
;
DB_TXN
*
ltid
=
NULL
,
*
lt2
;
struct
bdb_op_info
opinfo
=
{
0
};
struct
bdb_op_info
opinfo
=
{
{{
0
}}
};
ID
eid
;
DB_LOCK
lock
,
plock
;
...
...
servers/slapd/back-bdb/modify.c
View file @
a4e3706e
...
...
@@ -330,7 +330,7 @@ bdb_modify( Operation *op, SlapReply *rs )
char
textbuf
[
SLAP_TEXT_BUFLEN
];
size_t
textlen
=
sizeof
textbuf
;
DB_TXN
*
ltid
=
NULL
,
*
lt2
;
struct
bdb_op_info
opinfo
=
{
0
};
struct
bdb_op_info
opinfo
=
{
{{
0
}}
};
Entry
dummy
=
{
0
};
int
fakeroot
=
0
;
...
...
servers/slapd/back-bdb/modrdn.c
View file @
a4e3706e
...
...
@@ -36,7 +36,7 @@ bdb_modrdn( Operation *op, SlapReply *rs )
char
textbuf
[
SLAP_TEXT_BUFLEN
];
size_t
textlen
=
sizeof
textbuf
;
DB_TXN
*
ltid
=
NULL
,
*
lt2
;
struct
bdb_op_info
opinfo
=
{
0
};
struct
bdb_op_info
opinfo
=
{
{{
0
}}
};
Entry
dummy
=
{
0
};
Entry
*
np
=
NULL
;
/* newSuperior Entry */
...
...
servers/slapd/back-bdb/monitor.c
View file @
a4e3706e
...
...
@@ -551,9 +551,9 @@ bdb_monitor_bitmask2key( slap_mask_t bitmask )
{
int
key
;
for
(
key
=
0
;
key
<
8
*
sizeof
(
slap_mask_t
)
&&
!
(
bitmask
&
0x1U
);
key
++
)
{
for
(
key
=
0
;
key
<
8
*
(
int
)
sizeof
(
slap_mask_t
)
&&
!
(
bitmask
&
0x1U
);
key
++
)
bitmask
>>=
1
;
}
return
key
;
}
...
...
servers/slapd/back-bdb/tools.c
View file @
a4e3706e
...
...
@@ -395,13 +395,12 @@ static int bdb_tool_next_id(
holes
[
nholes
++
].
id
=
e
->
e_id
;
}
}
else
if
(
!
hole
)
{
unsigned
i
;
unsigned
i
,
j
;
e
->
e_id
=
ei
->
bei_id
;
for
(
i
=
0
;
i
<
nholes
;
i
++
)
{
if
(
holes
[
i
].
id
==
e
->
e_id
)
{
int
j
;
free
(
holes
[
i
].
dn
.
bv_val
);
for
(
j
=
i
;
j
<
nholes
;
j
++
)
holes
[
j
]
=
holes
[
j
+
1
];
holes
[
j
].
id
=
0
;
...
...
servers/slapd/back-ldif/ldif.c
View file @
a4e3706e
...
...
@@ -35,8 +35,8 @@ typedef struct enumCookie {
Operation
*
op
;
SlapReply
*
rs
;
Entry
**
entries
;
int
elen
;
int
eind
;
ID
elen
;
ID
eind
;
}
enumCookie
;
struct
ldif_info
{
...
...
servers/slapd/back-meta/bind.c
View file @
a4e3706e
...
...
@@ -1575,7 +1575,7 @@ meta_back_controls_add(
LDAPControl
**
ctrls
=
NULL
;
/* set to the maximum number of controls this backend can add */
LDAPControl
c
[
2
]
=
{
0
};
LDAPControl
c
[
2
]
=
{
{
0
}
};
int
n
=
0
,
i
,
j1
=
0
,
j2
=
0
;
*
pctrls
=
NULL
;
...
...
@@ -1642,7 +1642,7 @@ meta_back_controls_add(
goto
done
;
}
assert
(
j1
+
j
1
<=
sizeof
(
c
)
/
sizeof
(
LDAPControl
)
);
assert
(
j1
+
j
2
<=
(
int
)
(
sizeof
(
c
)
/
sizeof
(
c
[
0
]
)
)
);
if
(
op
->
o_ctrls
)
{
for
(
n
=
0
;
op
->
o_ctrls
[
n
];
n
++
)
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment