]> git.sur5r.net Git - openldap/commitdiff
disallow more root dse operations
authorKurt Zeilenga <kurt@openldap.org>
Fri, 8 Sep 2000 16:59:15 +0000 (16:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 8 Sep 2000 16:59:15 +0000 (16:59 +0000)
servers/slapd/compare.c
servers/slapd/modify.c
servers/slapd/modrdn.c

index 4caa3be6c17cb1475ec478f7879d7baa2b22d8a6..cb291b073d45ccdb0f8665a587f7eff95503a15c 100644 (file)
@@ -93,6 +93,13 @@ do_compare(
                goto cleanup;
        }
 
+       if( ndn == '\0' ) {
+               Debug( LDAP_DEBUG_ANY, "do_compare: root dse!\n", 0, 0, 0 );
+               send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
+                       NULL, "compare upon the root DSE not supported", NULL, NULL );
+               goto cleanup;
+       }
+
        /*
         * We could be serving multiple database backends.  Select the
         * appropriate one, or send a referral to our "referral server"
index a21ad0b2a6626f44fc45ee0846bb9ac15c4c4a43..faa0973246acf572b2208b6f81079c99fe2451f9 100644 (file)
@@ -145,6 +145,13 @@ do_modify(
                goto cleanup;
        }
 
+       if( ndn == '\0' ) {
+               Debug( LDAP_DEBUG_ANY, "do_modify: root dse!\n", 0, 0, 0 );
+               send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
+                       NULL, "modify upon the root DSE not supported", NULL, NULL );
+               goto cleanup;
+       }
+
 #ifdef LDAP_DEBUG
        Debug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 );
        for ( tmp = modlist; tmp != NULL; tmp = tmp->ml_next ) {
index e5acfd1f832949e9274bb418f78d203d5008305a..84808e97d943764f5205325b6eb441824023b31a 100644 (file)
@@ -150,6 +150,13 @@ do_modrdn(
                goto cleanup;
        }
 
+       if( ndn == '\0' ) {
+               Debug( LDAP_DEBUG_ANY, "do_modrdn: root dse!\n", 0, 0, 0 );
+               send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
+                       NULL, "cannot rename the root DSE", NULL, NULL );
+               goto cleanup;
+       }
+
        Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d MODRDN dn=\"%s\"\n",
            op->o_connid, op->o_opid, dn, 0, 0 );