return 0;
}
+static int config_syslog;
+
static int
config_loglevel(ConfigArgs *c) {
int i;
}
if (c->op == SLAP_CONFIG_EMIT) {
- return mask_to_verbs( loglevel_ops, ldap_syslog, &c->rvalue_vals );
+ /* Get default or commandline slapd setting */
+ if ( ldap_syslog && !config_syslog )
+ config_syslog = ldap_syslog;
+ return mask_to_verbs( loglevel_ops, config_syslog, &c->rvalue_vals );
} else if ( c->op == LDAP_MOD_DELETE ) {
if ( !c->line ) {
- ldap_syslog = 0;
+ config_syslog = 0;
} else {
int level = verb_to_mask( c->line, loglevel_ops );
- ldap_syslog ^= level;
+ config_syslog ^= level;
+ }
+ if ( slapMode & SLAP_SERVER_MODE ) {
+ ldap_syslog = config_syslog;
}
return 0;
}
- ldap_syslog = 0;
+ config_syslog = 0;
for( i=1; i < c->argc; i++ ) {
int level;
return( 1 );
}
}
- ldap_syslog |= level;
+ config_syslog |= level;
+ }
+ if ( slapMode & SLAP_SERVER_MODE ) {
+ ldap_syslog = config_syslog;
}
return(0);
}
if ( a && ( ad->ad_type->sat_flags & SLAP_AT_ORDERED_VAL )) {
sort = 1;
rc = ordered_value_sort( a, 1 );
- if ( rc )
+ if ( rc ) {
+ sprintf(ca->msg, "ordered_value_sort failed on attr %s\n",
+ ad->ad_cname.bv_val );
return rc;
+ }
}
for ( i=0; vals[i].bv_val; i++ ) {
ca->line = vals[i].bv_val;
}
if ( rc != LDAP_SUCCESS )
- goto leave;
+ goto done;
/* Parse all the values and check for simple syntax errors before
* performing any set actions.
*/
rc = check_name_index( last, colst[0]->co_type, e, rs, renum );
if ( rc )
- goto leave;
+ goto done;
init_config_argv( ca );
ct = config_find_table( colst, nocs, a->a_desc );
if ( !ct ) continue; /* user data? */
rc = check_vals( ct, ca, a, 1 );
- if ( rc ) goto leave;
+ if ( rc ) goto done;
}
/* Basic syntax checks are OK. Do the actual settings. */
rc = config_parse_add( ct, ca );
if ( rc ) {
rc = LDAP_OTHER;
- goto leave;
+ goto done;
}
}
}
Debug(LDAP_DEBUG_ANY, "%s: %s (%s)!\n",
ca->log, ca->msg, ca->argv[1] );
rc = LDAP_OTHER;
- goto leave;
+ goto done;
}
}
last->ce_kids = ce;
}
-leave:
+done:
if ( rc ) {
if ( (colst[0]->co_type == Cft_Database) && ca->be ) {
if ( ca->be != frontendDB )
char *ptr;
index = 1;
ptr = strchr( a->a_vals[i].bv_val, '}' );
- if ( !ptr || !ptr[1] )
+ if ( !ptr )
return LDAP_INVALID_SYNTAX;
if ( noindex )
return LDAP_INVALID_SYNTAX;
#endif
indexes = ch_malloc( vals * sizeof(int) );
- for ( i=0; i<vals; i++)
- indexes[i] = strtol(a->a_vals[i].bv_val+1, NULL, 0);
+ for ( i=0; i<vals; i++) {
+ char *ptr;
+ indexes[i] = strtol(a->a_vals[i].bv_val+1, &ptr, 0);
+ if ( *ptr != '}' ) {
+ ch_free( indexes );
+ return LDAP_INVALID_SYNTAX;
+ }
+ }
/* Insertion sort */
for ( i=1; i<vals; i++ ) {