]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/sasl.c
remove all referral specific code; now referrals can be used by defining appropriate...
[openldap] / servers / slapd / sasl.c
index 1dcd8bbe95930ceb5f7283ad83f9bb332b095151..a5f9d6718f6a3de5b39074b3c3faf540a4af6e62 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -491,28 +491,33 @@ slap_auxprop_store(
        }
        *modtail = NULL;
 
-       rc = slap_mods_check( modlist, 0, &text, textbuf, textlen, NULL );
+       rc = slap_mods_check( modlist, &text, textbuf, textlen, NULL );
 
        if ( rc == LDAP_SUCCESS ) {
-               rc = slap_mods_opattrs( &op, modlist, modtail, &text, textbuf,
-                       textlen, 1 );
-       }
-
-       if ( rc == LDAP_SUCCESS ) {
-               op.o_hdr = conn->c_sasl_bindop->o_hdr;
-               op.o_tag = LDAP_REQ_MODIFY;
-               op.o_ndn = op.o_req_ndn;
-               op.o_callback = &cb;
-               op.o_time = slap_get_time();
-               op.o_do_not_cache = 1;
-               op.o_is_auth_check = 1;
-               op.o_req_dn = op.o_req_ndn;
-               op.orm_modlist = modlist;
-
-               rc = op.o_bd->be_modify( &op, &rs );
+               rc = slap_mods_no_update_check( modlist, &text,
+                               textbuf, textlen );
+
+               if ( rc == LDAP_SUCCESS ) {
+                       rc = slap_mods_opattrs( &op, modlist, modtail,
+                                       &text, textbuf, textlen, 1 );
+
+                       if ( rc == LDAP_SUCCESS ) {
+                               op.o_hdr = conn->c_sasl_bindop->o_hdr;
+                               op.o_tag = LDAP_REQ_MODIFY;
+                               op.o_ndn = op.o_req_ndn;
+                               op.o_callback = &cb;
+                               op.o_time = slap_get_time();
+                               op.o_do_not_cache = 1;
+                               op.o_is_auth_check = 1;
+                               op.o_req_dn = op.o_req_ndn;
+                               op.orm_modlist = modlist;
+
+                               rc = op.o_bd->be_modify( &op, &rs );
+                       }
+               }
        }
        slap_mods_free( modlist );
-       return rc ? SASL_FAIL : SASL_OK;
+       return rc != LDAP_SUCCESS ? SASL_FAIL : SASL_OK;
 }
 #endif /* SASL_VERSION_FULL >= 2.1.16 */
 
@@ -1609,7 +1614,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id,
                irdn = 0;
                DN[ irdn ] = RDNs[ irdn ];
                RDNs[ irdn ][ 0 ] = &AVAs[ irdn ];
-               BER_BVSTR( &AVAs[ irdn ].la_attr, "uid" );
+               AVAs[ irdn ].la_attr = slap_schema.si_ad_uid->ad_cname;
                AVAs[ irdn ].la_value = *dn;
                AVAs[ irdn ].la_flags = LDAP_AVA_NULL;
                AVAs[ irdn ].la_private = NULL;
@@ -1619,7 +1624,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id,
                        irdn++;
                        DN[ irdn ] = RDNs[ irdn ];
                        RDNs[ irdn ][ 0 ] = &AVAs[ irdn ];
-                       BER_BVSTR( &AVAs[ irdn ].la_attr, "cn" );
+                       AVAs[ irdn ].la_attr = slap_schema.si_ad_cn->ad_cname;
                        ber_str2bv( user_realm, 0, 0, &AVAs[ irdn ].la_value );
                        AVAs[ irdn ].la_flags = LDAP_AVA_NULL;
                        AVAs[ irdn ].la_private = NULL;
@@ -1630,7 +1635,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id,
                        irdn++;
                        DN[ irdn ] = RDNs[ irdn ];
                        RDNs[ irdn ][ 0 ] = &AVAs[ irdn ];
-                       BER_BVSTR( &AVAs[ irdn ].la_attr, "cn" );
+                       AVAs[ irdn ].la_attr = slap_schema.si_ad_cn->ad_cname;
                        AVAs[ irdn ].la_value = *mech;
                        AVAs[ irdn ].la_flags = LDAP_AVA_NULL;
                        AVAs[ irdn ].la_private = NULL;
@@ -1640,7 +1645,7 @@ int slap_sasl_getdn( Connection *conn, Operation *op, struct berval *id,
                irdn++;
                DN[ irdn ] = RDNs[ irdn ];
                RDNs[ irdn ][ 0 ] = &AVAs[ irdn ];
-               BER_BVSTR( &AVAs[ irdn ].la_attr, "cn" );
+               AVAs[ irdn ].la_attr = slap_schema.si_ad_cn->ad_cname;
                BER_BVSTR( &AVAs[ irdn ].la_value, "auth" );
                AVAs[ irdn ].la_flags = LDAP_AVA_NULL;
                AVAs[ irdn ].la_private = NULL;