]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/sasl.c
Remove lint
[openldap] / servers / slapd / sasl.c
index 1034f2f2a24c55aa3f3dd43256141a5f6d3351f9..29a83f5adab5134da34332cf57fc6e306f1be80a 100644 (file)
@@ -82,7 +82,7 @@ slap_sasl_log(
 
 int slap_sasl_getdn( Connection *conn, char *id, char **dnptr, int flags )
 {
-       char *c, *c1, *dn=NULL;
+       char *c=NULL, *c1, *dn=NULL;
        int rc, len;
        sasl_conn_t *ctx;
 
@@ -111,15 +111,15 @@ int slap_sasl_getdn( Connection *conn, char *id, char **dnptr, int flags )
        /* An authcID needs to be converted to authzID form */
        if( flags & FLAG_GETDN_AUTHCID ) {
                if( sasl_external_x509dn_convert && conn->c_sasl_bind_mech
-                       && ( strcasecmp( LDAP_SASL_EXTERNAL, conn->c_sasl_bind_mech ) == 0 ) 
-                       && len && dn[0] == '/' and dn[len-1]== '/' )
+                       && ( strcasecmp( "EXTERNAL", conn->c_sasl_bind_mech ) == 0 ) 
+                       && len && dn[0] == '/' && dn[len-1]== '/' )
                {
                        /* check SASL external for X.509 style DN and */
                        /* convert to dn:<dn> form */
                        char *tmpdn = ldap_dcedn2dn( id );
                        len = strlen( tmpdn );
 
-                       dn = ch_malloc( dn, len+4 );
+                       dn = ch_malloc( len+4 );
                        dn[0] = 'd';
                        dn[1] = 'n';
                        dn[2] = ':';
@@ -128,7 +128,7 @@ int slap_sasl_getdn( Connection *conn, char *id, char **dnptr, int flags )
 
                } else {
                        /* convert to u:<username> form */
-                       dn = ch_malloc( dn, len+3 );
+                       dn = ch_malloc( len+3 );
                        dn[0] = 'u';
                        dn[1] = ':';
                        memmove( &dn[2], id, len+1 );
@@ -224,7 +224,7 @@ int slap_sasl_getdn( Connection *conn, char *id, char **dnptr, int flags )
        }
 
        if( ( flags & FLAG_GETDN_FINAL ) == 0 )  {
-               dn_normalize( dn );
+               dn_normalize( dn+3 );
        }
 
        *dnptr = dn;
@@ -311,7 +311,7 @@ slap_sasl_authorize(
 #ifdef NEW_LOGGING
        LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
                   "slap_sasl_authorize: conn %d authorization allowed\n",
-                  (long)(conn ? conn->c_connid : -1 ) );
+                  (long)(conn ? conn->c_connid : -1 ) ));
 #else
        Debug( LDAP_DEBUG_TRACE, "SASL Authorize [conn=%ld]: "
                " authorization allowed\n",