}
if (mod == NULL) {
-#define BAILOUT
-#ifdef BAILOUT
+ if ( !global_add_rdn_values ) {
/* bail out */
send_ldap_result( conn, op,
rc = LDAP_NO_SUCH_ATTRIBUTE,
NULL, NULL );
goto done;
-#else /* ! BAILOUT */
+ } else {
struct berval bv;
/* add attribute type and value to modlist */
*modtail = mod;
modtail = &mod->sml_next;
continue;
-#endif /* ! BAILOUT */
+ }
}
mr = desc->ad_type->sat_equality;
/* not found? */
if (mod->sml_bvalues[ i ].bv_val == NULL) {
-#ifdef BAILOUT
+ if ( !global_add_rdn_values ) {
/* bailout */
send_ldap_result( conn, op,
rc = LDAP_NO_SUCH_ATTRIBUTE,
NULL, NULL );
goto done;
-#else /* ! BAILOUT */
+ } else {
struct berval bv;
/* add attribute type and value to modlist */
ber_dupbv( &bv, &rdn[ 0 ][ cnt ]->la_value );
ber_bvarray_add( &mod->sml_bvalues, &bv );
continue;
-#endif /* ! BAILOUT */
+ }
}
}
global_schemacheck = 1;
}
+ /* turn on/off rdn value add */
+ } else if ( strcasecmp( cargv[0], "add-rdn-values" ) == 0 ) {
+ if ( cargc < 2 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( CONFIG, CRIT,
+ "%s: line %d: missing on|off in \"add-rdn-values <on|off>\""
+ " line.\n", fname, lineno , 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: missing on|off in \"add-rdn-values <on|off>\" line\n",
+ fname, lineno, 0 );
+#endif
+
+ return( 1 );
+ }
+ if ( strcasecmp( cargv[1], "on" ) == 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( CONFIG, CRIT,
+ "%s: line %d: add-rdn-values enabled! your mileage may vary!\n",
+ fname, lineno , 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "%s: line %d: add-rdn-values enabled! your mileage may vary!\n",
+ fname, lineno, 0 );
+#endif
+ global_add_rdn_values = 1;
+ } else {
+ global_add_rdn_values = 0;
+ }
+
/* specify access control info */
} else if ( strcasecmp( cargv[0], "access" ) == 0 ) {
parse_acl( be, fname, lineno, cargc, cargv );
LDAP_SLAPD_V (int) global_gentlehup;
LDAP_SLAPD_V (int) global_idletimeout;
LDAP_SLAPD_V (int) global_schemacheck;
+LDAP_SLAPD_V (int) global_add_rdn_values;
LDAP_SLAPD_V (char *) global_host;
LDAP_SLAPD_V (char *) global_realm;
LDAP_SLAPD_V (char *) default_passwd_hash;
#include "ldap_schema.h"
int global_schemacheck = 1; /* schemacheck ON is default */
+int global_add_rdn_values = 0; /* bail out if rdn values do not match entry values is default */
static void oc_usage(void);
static void at_usage(void);