]> git.sur5r.net Git - openldap/commitdiff
global_schemadn addition
authorKurt Zeilenga <kurt@openldap.org>
Mon, 12 Aug 2002 17:11:43 +0000 (17:11 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 12 Aug 2002 17:11:43 +0000 (17:11 +0000)
servers/slapd/config.c
servers/slapd/modrdn.c
servers/slapd/proto-slap.h

index 0046551709c614c046b8e1d63b292dd47bc37855..ff982d89a9bb8c44d85198c48cee45d46c3d3d1d 100644 (file)
@@ -52,6 +52,10 @@ char **cargv;
 struct berval default_search_base = { 0, NULL };
 struct berval default_search_nbase = { 0, NULL };
 unsigned               num_subordinates = 0;
+#ifdef SLAPD_SCHEMA_DN
+struct berval global_schemadn = { 0, NULL };
+struct berval global_schemandn = { 0, NULL };
+#endif
 
 ber_len_t sockbuf_max_incoming = SLAP_SB_MAX_INCOMING_DEFAULT;
 ber_len_t sockbuf_max_incoming_auth= SLAP_SB_MAX_INCOMING_AUTH;
index 8cb8a2737de44897807b7ed55f776ce959424073..5116735ab615425ab452038a7885a92ae5566d5e 100644 (file)
@@ -202,12 +202,14 @@ do_modrdn(
                goto cleanup;
 
 #ifdef SLAPD_SCHEMA_DN
-       } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
+       } else if ( bvmatch( &ndn, &global_schemandn ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( OPERATION, ERR,
-                       "do_modrdn: attempt to modify subschema subentry\n", 0, 0, 0 );
+                       "do_modrdn: attempt to modify subschema subentry: %s (%ld)\n",
+                       global_schemandn.bv_val, (long) global_schemandn.bv_len, 0 );
 #else
-               Debug( LDAP_DEBUG_ANY, "do_modrdn: subschema subentry!\n", 0, 0, 0 );
+               Debug( LDAP_DEBUG_ANY, "do_modrdn: subschema subentry: %s (%ld)\n",
+                       global_schemandn.bv_val, (long) global_schemandn.bv_len, 0 );
 #endif
 
                send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
index cb65f3fb925c46ddda876ade020684bb01084639..bbbdb1d3eb02439ea9d473707f090f9940f49043 100644 (file)
@@ -341,6 +341,7 @@ LDAP_SLAPD_F (void) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
  */
 
 #define dn_match(dn1, dn2)     ( ber_bvcmp((dn1), (dn2)) == 0 )
+#define bvmatch(bv1, bv2)      ( ((bv1)->bv_len == (bv2)->bv_len) && (memcmp((bv1)->bv_val, (bv2)->bv_val, (bv1)->bv_len) == 0) )
 
 LDAP_SLAPD_V( const struct berval ) slap_empty_bv;