+ if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+ "do_modify: get_ctrls failed\n" ));
+#else
+ Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 );
+#endif
+
+ goto cleanup;
+ }
+
+ rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn );
+ if( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+ "do_modify: conn %d invalid dn (%s)\n",
+ conn->c_connid, dn.bv_val ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "do_modify: invalid dn (%s)\n", dn.bv_val, 0, 0 );
+#endif
+ send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
+ "invalid DN", NULL, NULL );
+ goto cleanup;
+ }
+
+ if( ndn.bv_len == 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+ "do_modify: attempt to modify root DSE.\n" ));
+#else
+ Debug( LDAP_DEBUG_ANY, "do_modify: root dse!\n", 0, 0, 0 );
+#endif
+
+ send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
+ NULL, "modify upon the root DSE not supported", NULL, NULL );
+ goto cleanup;
+
+#if defined( SLAPD_SCHEMA_DN )
+ } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+ "do_modify: attempt to modify subschema subentry.\n" ));
+#else
+ Debug( LDAP_DEBUG_ANY, "do_modify: subschema subentry!\n", 0, 0, 0 );
+#endif
+
+ send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
+ NULL, "modification of subschema subentry not supported",
+ NULL, NULL );
+ goto cleanup;
+#endif
+ }
+