/* Now look for the length */
if (*ber->ber_ptr & 0x80) { /* multi-byte */
- ber_len_t i;
+ int i;
unsigned char *p = (unsigned char *)ber->ber_ptr;
int llen = *p++ & 0x7f;
if (llen > (int)sizeof(ber_len_t)) {
int async)
{
int rc;
- struct timeval tv, *opt_tv=NULL;
+ struct timeval tv = { 0 },
+ *opt_tv = NULL;
#ifdef LDAP_CONNECTIONLESS
/* We could do a connect() but that would interfere with
return ( 0 );
}
#endif
- if ( (opt_tv = ld->ld_options.ldo_tm_net) != NULL ) {
- tv.tv_usec = opt_tv->tv_usec;
- tv.tv_sec = opt_tv->tv_sec;
+ opt_tv = ld->ld_options.ldo_tm_net;
+ if ( opt_tv != NULL ) {
+ tv = *opt_tv;
}
osip_debug(ld, "ldap_connect_timeout: fd: %d tm: %ld async: %d\n",
ldap_pvt_connect(LDAP *ld, ber_socket_t s, struct sockaddr_un *sa, int async)
{
int rc;
- struct timeval tv, *opt_tv=NULL;
+ struct timeval tv = { 0 },
+ *opt_tv = NULL;
- if ( (opt_tv = ld->ld_options.ldo_tm_net) != NULL ) {
- tv.tv_usec = opt_tv->tv_usec;
- tv.tv_sec = opt_tv->tv_sec;
+ opt_tv = ld->ld_options.ldo_tm_net;
+ if ( opt_tv != NULL ) {
+ tv = *opt_tv;
}
oslocal_debug(ld, "ldap_connect_timeout: fd: %d tm: %ld async: %d\n",
LDAPMessage **result )
{
int rc;
- struct timeval tv, tv0, *tvp;
+ struct timeval tv = { 0 },
+ tv0 = { 0 },
+ *tvp;
time_t start_time = 0;
time_t tmp_time;
LDAPConn *lc, *nextlc;
rc = -2;
while ( rc == -2 ) {
#ifdef LDAP_DEBUG
- Debug( LDAP_DEBUG_TRACE, "wait4msg continue, msgid %d, all %d\n",
- msgid, all, 0 );
if ( ldap_debug & LDAP_DEBUG_TRACE ) {
+ Debug( LDAP_DEBUG_TRACE, "wait4msg continue, msgid %d, all %d\n",
+ msgid, all, 0 );
ldap_dump_connection( ld, ld->ld_conns, 1 );
ldap_dump_requests_and_responses( ld );
}
if ( rc == -2 && tvp != NULL ) {
tmp_time = time( NULL );
- if (( tv0.tv_sec -= ( tmp_time - start_time )) <= 0 ) {
+ tv0.tv_sec -= ( tmp_time - start_time );
+ if ( tv0.tv_sec <= 0 ) {
rc = 0; /* timed out */
ld->ld_errno = LDAP_TIMEOUT;
break;
ldap_msgtype( LDAPMessage *lm )
{
assert( lm != NULL );
- return ( lm != NULL ) ? lm->lm_msgtype : -1;
+ return ( lm != NULL ) ? (int)lm->lm_msgtype : -1;
}
{
while (atm && tm) {
char *ptr = atm;
- int i, fracs;
+ unsigned i, fracs;
/* Is the stamp reasonably long? */
for (i=0; isdigit(atm[i]); i++);
continue;
} else if ( a->acl_dn_style == ACL_STYLE_ONE ) {
- int rdnlen = -1, sep = 0;
+ ber_len_t rdnlen = 0;
+ int sep = 0;
if ( dnlen <= patlen )
continue;
continue;
} else if ( a->acl_attrval_style == ACL_STYLE_ONE ) {
- int rdnlen = -1;
+ ber_len_t rdnlen = 0;
if ( !DN_SEPARATOR( val->bv_val[vdnlen - patlen - 1] ) )
continue;
}
} else if ( b->a_style == ACL_STYLE_ONE ) {
- int rdnlen = -1;
+ ber_len_t rdnlen = 0;
if ( odnlen <= patlen ) {
goto dn_match_cleanup;
sep = 1;
}
- rdnlen = (ber_len_t)dn_rdnlen( NULL, &dn );
+ rdnlen = dn_rdnlen( NULL, &dn );
if ( rdnlen != dn.bv_len - patlen - sep )
return ACL_SCOPE_ERR;
}
meta_back_open(
BackendInfo *bi )
{
+ /* FIXME: need to remove the pagedResults, and likely more... */
bi->bi_controls = slap_known_controls;
+
return 0;
}
/*
* We can assume the input is a prettied or normalized DN
*/
-int
+ber_len_t
dn_rdnlen(
Backend *be,
struct berval *dn_in )
LDAP_SLAPD_F (int) rdn_validate LDAP_P(( struct berval * rdn ));
-LDAP_SLAPD_F (int) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
+LDAP_SLAPD_F (ber_len_t) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
LDAP_SLAPD_F (void) build_new_dn LDAP_P((
struct berval * new_dn,