}
Debug( level, "SASL [conn=%ld] %s: %s\n",
- conn ? conn->c_connid: -1,
+ conn ? (long) conn->c_connid: -1L,
label, message );
*out_len = 0;
Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n",
- conn ? conn->c_connid : -1,
+ conn ? (long) conn->c_connid : -1L,
(flags & SASL_CU_AUTHID) ? "authcid" : "authzid",
in ? in : "<empty>");
prop_set( props, names[0], dn.bv_val, dn.bv_len );
Debug( LDAP_DEBUG_ARGS, "SASL Canonicalize [conn=%ld]: %s=\"%s\"\n",
- conn ? conn->c_connid : -1, names[0]+1,
+ conn ? (long) conn->c_connid : -1L, names[0]+1,
dn.bv_val ? dn.bv_val : "<EMPTY>" );
/* Not needed any more, SASL has copied it */
Debug( LDAP_DEBUG_ARGS, "SASL proxy authorize [conn=%ld]: "
"authcid=\"%s\" authzid=\"%s\"\n",
- conn ? conn->c_connid : -1, auth_identity, requested_user );
+ conn ? (long) conn->c_connid : -1L, auth_identity, requested_user );
if ( conn->c_sasl_dn.bv_val ) {
BER_BVZERO( &conn->c_sasl_dn );
}
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "SASL Proxy Authorize [conn=%ld]: "
"proxy authorization disallowed (%d)\n",
- (long) (conn ? conn->c_connid : -1), rc, 0 );
+ conn ? (long) conn->c_connid : -1L, rc, 0 );
sasl_seterror( sconn, 0, "not authorized" );
return SASL_NOAUTHZ;
Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
" proxy authorization allowed authzDN=\"%s\"\n",
- (long) (conn ? conn->c_connid : -1),
+ conn ? (long) conn->c_connid : -1L,
authzDN.bv_val ? authzDN.bv_val : "", 0 );
return SASL_OK;
}
void *ctx )
{
struct berval tmp, nvalue;
- int flags;
- int i, wasspace;
+ int flags, wasspace;
+ ber_len_t i;
assert( SLAP_MR_IS_VALUE_OF_SYNTAX( use ) != 0 );
int match = 0;
SubstringsAssertion *sub = assertedValue;
struct berval left = *value;
- int i;
+ ber_len_t i;
int priorspace=0;
if ( !BER_BVISNULL( &sub->sa_initial ) ) {
struct berval *in )
{
struct berval bv = *in;
- int c;
+ ber_len_t c;
for ( c = 0; c < in->bv_len; c++ ) {
if ( in->bv_val[c] == '\\' ) {
void *ctx )
{
BerVarray lines = NULL, nlines = NULL;
- int l, c;
+ ber_len_t l, c;
int rc = LDAP_SUCCESS;
MatchingRule *xmr = NULL;
char *p;
}
*--p = '\0';
- assert( p - normalized->bv_val == normalized->bv_len );
+ assert( p == &normalized->bv_val[normalized->bv_len] );
done:;
if ( nlines != NULL ) {
checkNum( struct berval *in, struct berval *out )
{
/* parse serialNumber */
- int neg = 0;
+ ber_len_t neg = 0, extra = 0;
char first = '\0';
- int extra = 0;
out->bv_val = in->bv_val;
out->bv_len = 0;
struct berval *is,
void *ctx )
{
- int n;
+ ber_len_t n;
if( in->bv_len < 3 ) return LDAP_INVALID_SYNTAX;
ber_dupbv_x( &ni, is, ctx );
} else {
- ber_int_t src, dst;
+ ber_len_t src, dst;
ni.bv_len = is->bv_len - numdquotes;
ni.bv_val = ber_memalloc_x( ni.bv_len + 1, ctx );
p = lutil_strncopy( p, ni.bv_val, ni.bv_len );
p = lutil_strcopy( p, /*{*/ "\" }" );
- assert( p - out->bv_val == out->bv_len );
+ assert( p == &out->bv_val[out->bv_len] );
done:;
Debug( LDAP_DEBUG_TRACE, "<<< serialNumberAndIssuerPretty: <%s> => <%s>\n",
unsigned char *ptr, zero = '\0';
char *sptr;
int first;
- int i;
- ber_len_t len, nlen;
+ ber_len_t i, len, nlen;
assert( in != NULL );
assert( !BER_BVISNULL( in ) );
*sptr++ = 'H';
*sptr = '\0';
- assert( sptr - out->bv_val == nlen );
+ assert( sptr == &out->bv_val[nlen] );
out->bv_len = nlen;
p = lutil_strncopy( p, ni.bv_val, ni.bv_len );
p = lutil_strcopy( p, /*{*/ "\" }" );
- assert( p - out->bv_val == out->bv_len );
+ assert( p == &out->bv_val[out->bv_len] );
func_leave:
Debug( LDAP_DEBUG_TRACE, "<<< serialNumberAndIssuerNormalize: <%s> => <%s>\n",
static int
checkTime( struct berval *in, struct berval *out )
{
- int i;
+ int rc;
+ ber_len_t i;
char buf[STRLENOF("YYYYmmddHHMMSSZ") + 1];
struct berval bv;
return -1;
}
- i = generalizedTimeValidate( NULL, &bv );
- if ( i == LDAP_SUCCESS && out != NULL ) {
+ rc = generalizedTimeValidate( NULL, &bv );
+ if ( rc == LDAP_SUCCESS && out != NULL ) {
out->bv_len = bv.bv_len;
}
- return i != LDAP_SUCCESS;
+ return rc != LDAP_SUCCESS;
}
static int
ber_dupbv_x( &ni, is, ctx );
} else {
- ber_int_t src, dst;
+ ber_len_t src, dst;
ni.bv_len = is->bv_len - numdquotes;
ni.bv_val = ber_memalloc_x( ni.bv_len + 1, ctx );
p = lutil_strncopy( p, tu.bv_val, tu.bv_len );
p = lutil_strcopy( p, /*{*/ "\" }" );
- assert( p - out->bv_val == out->bv_len );
+ assert( p == &out->bv_val[out->bv_len] );
done:;
Debug( LDAP_DEBUG_TRACE, "<<< issuerAndThisUpdatePretty: <%s> => <%s>\n",
p = lutil_strncopy( p, tu2.bv_val, tu2.bv_len );
p = lutil_strcopy( p, /*{*/ "\" }" );
- assert( p - out->bv_val == out->bv_len );
+ assert( p == & out->bv_val[out->bv_len] );
func_leave:
Debug( LDAP_DEBUG_TRACE, "<<< issuerAndThisUpdateNormalize: <%s> => <%s>\n",
Syntax *syntax,
struct berval *in )
{
- int i;
+ ber_len_t i;
assert( in != NULL );
assert( !BER_BVISNULL( in ) );
struct berval *normalized,
void *ctx )
{
- int i;
+ ber_len_t i;
assert( val != NULL );
assert( normalized != NULL );
assert( SLAP_MR_IS_VALUE_OF_ATTRIBUTE_SYNTAX(usage) != 0 );
ptr = ber_bvchr( val, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
bv.bv_len = val->bv_len - ( ptr + 1 - val->bv_val );
ptr = ber_bvchr( &bv, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
bv.bv_len = val->bv_len - ( ptr + 1 - val->bv_val );
ptr = ber_bvchr( &bv, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
bv = *in;
ptr = ber_bvchr( &bv, '#' );
- if ( ptr == NULL || ptr - bv.bv_val == bv.bv_len ) {
+ if ( ptr == NULL || ptr == &bv.bv_val[bv.bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
bv.bv_len = in->bv_len - ( bv.bv_val - in->bv_val );
ptr = ber_bvchr( &bv, '#' );
- if ( ptr == NULL || ptr - in->bv_val == in->bv_len ) {
+ if ( ptr == NULL || ptr == &in->bv_val[in->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
bv.bv_len = in->bv_len - ( bv.bv_val - in->bv_val );
ptr = ber_bvchr( &bv, '#' );
- if ( ptr == NULL || ptr - in->bv_val == in->bv_len ) {
+ if ( ptr == NULL || ptr == &in->bv_val[in->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
struct berval bv;
char buf[ STRLENOF( "YYYYmmddHHMMSS.uuuuuuZ#SSSSSS#SID#ssssss" ) + 1 ];
char *ptr;
- int i;
+ ber_len_t i;
assert( SLAP_MR_IS_VALUE_OF_SYNTAX( usage ) != 0 );
assert( !BER_BVISEMPTY( val ) );
gt = *val;
ptr = ber_bvchr( >, '#' );
- if ( ptr == NULL || ptr - gt.bv_val == gt.bv_len ) {
+ if ( ptr == NULL || ptr == >.bv_val[gt.bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
cnt.bv_len = val->bv_len - ( cnt.bv_val - val->bv_val );
ptr = ber_bvchr( &cnt, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
sid.bv_len = val->bv_len - ( sid.bv_val - val->bv_val );
ptr = ber_bvchr( &sid, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
}
*ptr = '\0';
- assert( ptr - bv.bv_val == bv.bv_len );
+ assert( ptr == &bv.bv_val[bv.bv_len] );
if ( csnValidate( syntax, &bv ) != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
struct berval bv;
char buf[ STRLENOF( "YYYYmmddHHMMSS.uuuuuuZ#SSSSSS#SID#ssssss" ) + 1 ];
char *ptr;
- int i;
+ ber_len_t i;
assert( SLAP_MR_IS_VALUE_OF_SYNTAX( usage ) != 0 );
assert( !BER_BVISEMPTY( val ) );
gt = *val;
ptr = ber_bvchr( >, '#' );
- if ( ptr == NULL || ptr - gt.bv_val == gt.bv_len ) {
+ if ( ptr == NULL || ptr == >.bv_val[gt.bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
cnt.bv_len = val->bv_len - ( cnt.bv_val - val->bv_val );
ptr = ber_bvchr( &cnt, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
sid.bv_len = val->bv_len - ( sid.bv_val - val->bv_val );
ptr = ber_bvchr( &sid, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
}
*ptr = '\0';
- assert( ptr - bv.bv_val == bv.bv_len );
+ assert( ptr == &bv.bv_val[bv.bv_len] );
if ( csnValidate( syntax, &bv ) != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
}
{
struct berval cnt, sid, mod;
char *ptr;
- int i;
+ ber_len_t i;
assert( val != NULL );
assert( normalized != NULL );
}
ptr = ber_bvchr( val, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
cnt.bv_len = val->bv_len - ( cnt.bv_val - val->bv_val );
ptr = ber_bvchr( &cnt, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}
sid.bv_len = val->bv_len - ( sid.bv_val - val->bv_val );
ptr = ber_bvchr( &sid, '#' );
- if ( ptr == NULL || ptr - val->bv_val == val->bv_len ) {
+ if ( ptr == NULL || ptr == &val->bv_val[val->bv_len] ) {
return LDAP_INVALID_SYNTAX;
}