/* Check for changetype */
if ( BV_CASEMATCH( lr->lr_btype+i, &BV_CHANGETYPE )) {
-#ifdef LIBERAL_CHANGETYPE_MODOP
- /* trim trailing spaces (and log warning ...) */
int icnt;
for ( icnt = lr->lr_vals[i].bv_len; --icnt > 0; ) {
if ( !isspace( (unsigned char) lr->lr_vals[i].bv_val[icnt] ) ) {
}
if ( ++icnt != lr->lr_vals[i].bv_len ) {
+#ifdef LIBERAL_CHANGETYPE_MODOP
+ /* trim trailing spaces (and log warning ...) */
fprintf( stderr, _("%s: illegal trailing space after"
" \"%s: %s\" trimmed (line %lu, entry \"%s\")\n"),
errstr, BV_CHANGETYPE.bv_val, lr->lr_vals[i].bv_val, linenum+i, dn );
lr->lr_vals[i].bv_val[icnt] = '\0';
+ lr->lr_vals[i].bv_len = icnt;
+#else /* !LIBERAL_CHANGETYPE_MODOP */
+ fprintf( stderr, _("%s: illegal trailing space after"
+ " \"%s: %s\" (line %lu, entry \"%s\")\n"),
+ errstr, BV_CHANGETYPE.bv_val, lr->lr_vals[i].bv_val, linenum+i, dn );
+ rc = LDAP_PARAM_ERROR;
+ goto leave;
+#endif /* !LIBERAL_CHANGETYPE_MODOP */
}
-#endif /* LIBERAL_CHANGETYPE_MODOP */
/* if LDIF_ENTRIES_ONLY, then either the changetype must be add, or
there must be no changetype, and the flag LDIF_DEFAULT_ADD must be set */
for ( ; i<lr->lr_lines; i++ ) {
if ( expect_modop ) {
-#ifdef LIBERAL_CHANGETYPE_MODOP
/* trim trailing spaces (and log warning ...) */
int icnt;
for ( icnt = lr->lr_vals[i].bv_len; --icnt > 0; ) {
}
if ( ++icnt != lr->lr_vals[i].bv_len ) {
+#ifdef LIBERAL_CHANGETYPE_MODOP
fprintf( stderr, _("%s: illegal trailing space after"
" \"%s: %s\" trimmed (line %lu, entry \"%s\")\n"),
- errstr, type, lr->lr_vals[i].bv_val, linenum+i, dn );
+ errstr, lr->lr_btype[i].bv_val, lr->lr_vals[i].bv_val,
+ linenum+i, dn );
lr->lr_vals[i].bv_val[icnt] = '\0';
+ lr->lr_vals[i].bv_len = icnt;
+#else /* !LIBERAL_CHANGETYPE_MODOP */
+ fprintf( stderr, _("%s: illegal trailing space after"
+ " \"%s: %s\" (line %lu, entry \"%s\")\n"),
+ errstr, lr->lr_btype[i].bv_val, lr->lr_vals[i].bv_val,
+ linenum+i, dn );
+ rc = LDAP_PARAM_ERROR;
+ goto leave;
+#endif /* !LIBERAL_CHANGETYPE_MODOP */
}
-#endif /* LIBERAL_CHANGETYPE_MODOP */
expect_modop = 0;
expect_sep = 1;