#47905 Bad manipulation of passwordhistory
Closed: wontfix Opened by nhosoi.

See the bug for the reproducer.
The fix proposal is provided by the reporter, gparente.


Ticket has been cloned to Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1145382

German, is there a patch for this issue?

Marc, it's in the BZ. It seems to be this simple one:

[gparente@localhost ds]$ git diff ab6438901fd1481ceceb40d6dff8935ac656dc04 ldap/servers/slapd/pw.c
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
index a4d2dc6..1216670 100644
--- a/ldap/servers/slapd/pw.c
+++ b/ldap/servers/slapd/pw.c
@@ -290,6 +290,9 @@ pw_val2scheme( char val, char valpwdp, int first_is_default )
int namelen, prefixlen;
char
end, buf[ PWD_MAX_NAME_LEN + 1 ];

  • if (val == NULL)
  • return( NULL );
    +
    if ( *val != PWD_HASH_PREFIX_START ||
    ( end = strchr( val, PWD_HASH_PREFIX_END )) == NULL ||
    ( namelen = end - val - 1 ) > PWD_MAX_NAME_LEN ) {
    [gparente@localhost ds]$

German, sorry I was looking for an attached patch, and missed the diff you posted.

Thanks,
Mark

git patch file (master) -- applied German's fix in comment 6 and created a git patch
0001-Ticket-47905-Bad-manipulation-of-passwordhistory.patch

Description: The patch was provided by German Parente (gparente@redhat.com)
https://fedorahosted.org/389/ticket/47905#comment:6

If a value of password policy attribute (e.g., passwordhistory) is
accidentally deleted, it causes a null reference in pw_val2scheme.
This patch checks whether val is NULL or not. If the given val is
NULL, pw_val2scheme returns NULL.

Reviewed and tested by nhosoi@redhat.com.

Pushed the patch on behalf of gparente@redhat.com (Thank you for the fix, German!)

Master:
e0c78e1..2c6e74a master -> master
commit 2c6e74adbea3c4799f30b0e3d679da9dd060ff58

389-ds-base-1.3.3:
2da0bd6..baa26c9 389-ds-base-1.3.3 -> 389-ds-base-1.3.3
commit baa26c96e873916d4c02651b04de7ca2a578863d

389-ds-base-1.3.2:
143550a..a9dee00 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit a9dee00b79016a51ebfed01c92267b751c5986de

389-ds-base-1.3.1:
3fafcbe..bf27455 389-ds-base-1.3.1 -> 389-ds-base-1.3.1
commit bf274554956196b4fc3f80f60c1b61de28a1b9d2

389-ds-base-1.2.11:
457252f..6b85c3a 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit 6b85c3a655896363826fe5aacee9e7493fcb9ca9

Metadata Update from @nhosoi:
- Issue assigned to gparente
- Issue set to the milestone: 1.2.11.33

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/1236

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

Metadata