]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/saslauthz.c
update for new backend types
[openldap] / servers / slapd / saslauthz.c
index a69961b89ede151fae85767e9e0430f35dfef7ba..b1bdf74389dbabe052207956fa20dad5cb91eff9 100644 (file)
@@ -131,11 +131,11 @@ int slap_parse_user( struct berval *id, struct berval *user,
 {
        char    u;
        
-       assert( id );
+       assert( id != NULL );
        assert( !BER_BVISNULL( id ) );
-       assert( user );
-       assert( realm );
-       assert( mech );
+       assert( user != NULL );
+       assert( realm != NULL );
+       assert( mech != NULL );
 
        u = id->bv_val[ 0 ];
        
@@ -494,6 +494,7 @@ done:
        return( rc );
 }
 
+#ifndef SLAP_AUTH_REWRITE
 static int slap_sasl_rx_off(char *rep, int *off)
 {
        const char *c;
@@ -527,6 +528,7 @@ static int slap_sasl_rx_off(char *rep, int *off)
        off[n] = -1;
        return( LDAP_SUCCESS );
 }
+#endif /* ! SLAP_AUTH_REWRITE */
 
 #ifdef SLAP_AUTH_REWRITE
 int slap_sasl_rewrite_config( 
@@ -644,7 +646,6 @@ int slap_sasl_regexp_config( const char *match, const char *replace )
 void slap_sasl_regexp_unparse( BerVarray *out )
 {
        int i;
-       struct berval bv;
        BerVarray bva = NULL;
        char ibuf[32], *ptr;
        struct berval idx;
@@ -670,6 +671,7 @@ void slap_sasl_regexp_unparse( BerVarray *out )
        *out = bva;
 }
 
+#ifndef SLAP_AUTH_REWRITE
 /* Perform replacement on regexp matches */
 static void slap_sasl_rx_exp(
        const char *rep,
@@ -721,6 +723,7 @@ static void slap_sasl_rx_exp(
 
        out->bv_val[insert] = '\0';
 }
+#endif /* ! SLAP_AUTH_REWRITE */
 
 /* Take the passed in SASL name and attempt to convert it into an
    LDAP URI to find the matching LDAP entry, using the pattern matching
@@ -1060,6 +1063,7 @@ exact_match:
                BER_BVZERO( &base );
        }
        ber_dupbv_x( &op.o_req_dn, &op.o_req_ndn, op.o_tmpmemctx );
+       op.ors_deref = LDAP_DEREF_NEVER;
        op.ors_slimit = 1;
        op.ors_tlimit = SLAP_NO_LIMIT;
        op.ors_attrs = slap_anlist_no_attrs;
@@ -1101,7 +1105,7 @@ slap_sasl_check_authz( Operation *op,
        AttributeDescription *ad,
        struct berval *authc )
 {
-       int i, rc;
+       int rc;
        BerVarray vals = NULL;
 
        Debug( LDAP_DEBUG_TRACE,