]> git.sur5r.net Git - openldap/commitdiff
Fix add of empty value.
authorKurt Zeilenga <kurt@openldap.org>
Tue, 3 Oct 2000 22:05:28 +0000 (22:05 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 3 Oct 2000 22:05:28 +0000 (22:05 +0000)
clients/tools/ldapmodify.c
libraries/libldif/line64.c

index 59f2ce0911f2254136d207aea02b45954fb69407..2bb835a64e024741955d2575287384b4f76a59a9 100644 (file)
@@ -1022,6 +1022,16 @@ domodify(
        fprintf( stderr, "%s: no attributes to change or add (entry=\"%s\")\n",
                prog, dn );
        return( LDAP_PARAM_ERROR );
+    } 
+
+    for ( i = 0; pmods[ i ] != NULL; ++i ) {
+       op = pmods[ i ]->mod_op & ~LDAP_MOD_BVALUES;
+       if( op == LDAP_MOD_ADD && ( pmods[i]->mod_bvalues == NULL )) {
+               fprintf( stderr,
+                       "%s: attribute \"%s\" has no values (entry=\"%s\")\n",
+                       prog, pmods[i]->mod_type, dn );
+               return LDAP_PARAM_ERROR;
+       }
     }
 
     if ( verbose ) {
index e101cd9e3ecfa4ae01911c30e355c7fc7137b8d0..947d35a616768dce83bfc28a8fc0bbb98ab3121f 100644 (file)
@@ -116,7 +116,7 @@ ldif_parse_line(
 
        if ( *s == '\0' ) {
                /* no value */
-               value = NULL;
+               value = "";
                vlen = 0;
                goto done;
        }