1
0
Эх сурвалжийг харах

Ticket #47391 - deleting and adding userpassword fails to update the password

Bug description: Deleting and adding password operation causes
the crash since once an entry is written to and retrieved from
DB, it does not have unhashed#user#password in the entry any
more. The delete userpassword internally invokes delete unhashed
existed in the entry.

Fix description: Once the internal attribute value pair is
stored in an entry extension, the mod for the attribute is
changed to the "disabled" mode.  Also, this patch adds the
stricter check for the NULL reference.

https://fedorahosted.org/389/ticket/47391

Reviewed by Nathan (Thank you!!)
Noriko Hosoi 12 жил өмнө
parent
commit
4305deeaa4

+ 1 - 1
ldap/servers/slapd/back-ldbm/index.c

@@ -693,7 +693,7 @@ index_add_mods(
                             /* Check if the any values being deleted
                              * also exist in a subtype.
                              */
-                            for ( j=0; deleted_valueArray[j] != NULL; j++) {
+                            for (j = 0; deleted_valueArray && deleted_valueArray[j]; j++) {
                                 if ( valuearray_find(curr_attr, evals, deleted_valueArray[j]) == -1 ) {
                                     /* If the equality flag isn't already set, set it */
                                     if (!(flags & BE_INDEX_EQUALITY)) {

+ 1 - 0
ldap/servers/slapd/entry.c

@@ -3503,6 +3503,7 @@ slapi_entry_apply_mod_extension(Slapi_Entry *e, const LDAPMod *mod, int modcnt)
                 rc = 0;
                 break;
             }
+            ((LDAPMod *)mod)->mod_op = LDAP_MOD_IGNORE; /* we don't need it any more */
         }
     }
 bail: