]> git.sur5r.net Git - openldap/commitdiff
don't complain during EMIT
authorPierangelo Masarati <ando@openldap.org>
Thu, 28 Jul 2005 18:25:43 +0000 (18:25 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 28 Jul 2005 18:25:43 +0000 (18:25 +0000)
servers/slapd/bconfig.c

index 8ae40a4ecb57a8ce3489a4ffa14703dda821e3d9..92260bd92de41e5fe8fab087f243c77924a039ab 100644 (file)
@@ -1565,13 +1565,34 @@ config_suffix(ConfigArgs *c)
        if ( notallowed != NULL ) {
                char    buf[ SLAP_TEXT_BUFLEN ] = { '\0' };
 
-               if ( !BER_BVISNULL( &c->value_dn ) ) {
-                       snprintf( buf, sizeof( buf ), "<%s> ", c->value_dn.bv_val );
+               switch ( c->op ) {
+               case LDAP_MOD_ADD:
+               case LDAP_MOD_DELETE:
+               case LDAP_MOD_REPLACE:
+               case LDAP_MOD_INCREMENT:
+               case SLAP_CONFIG_ADD:
+                       if ( !BER_BVISNULL( &c->value_dn ) ) {
+                               snprintf( buf, sizeof( buf ), "<%s> ",
+                                               c->value_dn.bv_val );
+                       }
+
+                       Debug(LDAP_DEBUG_ANY,
+                               "%s: suffix %snot allowed in %s database.\n",
+                               c->log, buf, notallowed );
+                       break;
+
+               case SLAP_CONFIG_EMIT:
+                       /* don't complain when emitting... */
+                       break;
+
+               default:
+                       /* FIXME: don't know what values may be valid;
+                        * please remove assertion, or add legal values
+                        * to either block */
+                       assert( 0 );
+                       break;
                }
 
-               Debug(LDAP_DEBUG_ANY,
-                       "%s: suffix %snot allowed in %s database.\n",
-                       c->log, buf, notallowed );
                return 1;
        }