+ if( ndn.bv_len == 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+ "do_modrdn: attempt to modify root DSE.\n" ));
+#else
+ Debug( LDAP_DEBUG_ANY, "do_modrdn: root dse!\n", 0, 0, 0 );
+#endif
+
+ send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
+ NULL, "cannot rename the root DSE", NULL, NULL );
+ goto cleanup;
+
+#ifdef SLAPD_SCHEMA_DN
+ } else if ( strcasecmp( ndn.bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
+ "do_modrdn: attempt to modify subschema subentry\n" ));
+#else
+ Debug( LDAP_DEBUG_ANY, "do_modrdn: subschema subentry!\n", 0, 0, 0 );
+#endif
+
+ send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
+ NULL, "cannot rename subschema subentry", NULL, NULL );
+ goto cleanup;
+#endif
+ }
+
+ /* FIXME: should have/use rdnPretty / rdnNormalize routines */
+
+ rc = dnPrettyNormal( NULL, &newrdn, &pnewrdn, &nnewrdn );
+ if( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
+ "do_modrdn: conn %d invalid newrdn (%s)\n",
+ conn->c_connid, newrdn.bv_val ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "do_modrdn: invalid newrdn (%s)\n", newrdn.bv_val, 0, 0 );
+#endif