]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/saslauthz.c
add new ber dump routine (behind NEW_LOGGING)
[openldap] / servers / slapd / saslauthz.c
index 48a3bb7a05de07a4c5be945e1437d173626612c6..e4bcdb7c0e58d8e90f394e287159857a6e9475d6 100644 (file)
@@ -251,7 +251,7 @@ char *slap_sasl_regexp( char *saslname )
 
 
 /*
- * Given a SASL name (e.g. "UID=name+REALM=company,cn=GSSAPI,cn=AUTHZ")
+ * Given a SASL name (e.g. "UID=name+cn=REALM,cn=MECH,cn=AUTHZ")
  * return the LDAP DN to which it matches. The SASL regexp rules in the config
  * file turn the SASL name into an LDAP URI. If the URI is just a DN (or a
  * search with scope=base), just return the URI (or its searchbase). Otherwise
@@ -295,7 +295,7 @@ char *slap_sasl2dn( char *saslname )
           "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n",
           searchbase, scope, 0 );
 
-       be = select_backend( searchbase );
+       be = select_backend( searchbase, 0 );
        if(( be == NULL ) || ( be->be_search == NULL))
                goto FINISHED;
        searchbase = suffix_alias( be, searchbase );
@@ -383,7 +383,7 @@ int slap_sasl_match( char *rule, char *assertDN, char *authc )
           "slap_sasl_match: performing internal search (base=%s, scope=%d)\n",
           searchbase, scope, 0 );
 
-       be = select_backend( searchbase );
+       be = select_backend( searchbase, 0 );
        if(( be == NULL ) || ( be->be_search == NULL)) {
                rc = LDAP_INAPPROPRIATE_AUTH;
                goto CONCLUDED;
@@ -504,7 +504,7 @@ int slap_sasl_authorized( Connection *conn,
        sasl_getprop( conn->c_sasl_context, SASL_REALM, (void **)&realm );
 
        /* Allocate space */
-       rc = strlen("uid=+realm=,cn=,cn=AUTHZ ");
+       rc = strlen("uid=,cn=,cn=,cn=AUTHZ ");
        if ( realm ) rc += strlen( realm );
        if ( authcid ) rc += strlen( authcid );
        rc += strlen( conn->c_sasl_bind_mech );
@@ -516,7 +516,7 @@ int slap_sasl_authorized( Connection *conn,
        if ( authcid )
                rc += sprintf( saslname+rc, "%sUID=%s", rc?",":"", authcid);
        if ( realm )
-               rc += sprintf( saslname+rc, "%sREALM=%s", rc?"+":"", realm);
+               rc += sprintf( saslname+rc, "%sCN=%s", rc?",":"", realm);
        if ( conn->c_sasl_bind_mech )
                rc += sprintf( saslname+rc, "%sCN=%s", rc?",":"",
                   conn->c_sasl_bind_mech);