RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 948052 - 389-ds: replace: userPassword doesn't delete unhashed#user#password
Summary: 389-ds: replace: userPassword doesn't delete unhashed#user#password
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: rc
: 7.0
Assignee: Rich Megginson
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-03 20:53 UTC by Thang Nguyen
Modified: 2014-06-18 02:58 UTC (History)
5 users (show)

Fixed In Version: 389-ds-base-1.3.1.2-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 12:19:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Thang Nguyen 2013-04-03 20:53:52 UTC
Description of problem:
When I do a "replace: userPassword" with an empty set of values (which will cause the attribute to be removed), 389ds only remove the userPassword attribute and doesn't remove the unhashed#user#password attribute.

I enabled more logging in the error log and this is what I see for "delete: userPassword" and "replace: userPassword" with an empty set of values.

delete: userPassword:
[02/Apr/2013:17:35:16 -1000] - => entry_apply_mods_wsi
[02/Apr/2013:17:35:16 -1000] -    delete: userPassword
[02/Apr/2013:17:35:16 -1000] - removing entire attribute userPassword
[02/Apr/2013:17:35:16 -1000] -    -
[02/Apr/2013:17:35:16 -1000] -    modifiersname: cn=directory manager
[02/Apr/2013:17:35:16 -1000] -    replace: modifiersname
[02/Apr/2013:17:35:16 -1000] -    -
[02/Apr/2013:17:35:16 -1000] -    modifytimestamp: 20130403033515Z
[02/Apr/2013:17:35:16 -1000] -    replace: modifytimestamp
[02/Apr/2013:17:35:16 -1000] -    -
[02/Apr/2013:17:35:16 -1000] -    delete: unhashed#user#password
[02/Apr/2013:17:35:16 -1000] - removing entire attribute unhashed#user#password
[02/Apr/2013:17:35:16 -1000] -    -

replace: userPassword with an empty set of values:
replace: userpassword
[02/Apr/2013:17:37:03 -1000] - => entry_apply_mods_wsi
[02/Apr/2013:17:37:03 -1000] -    replace: userPassword
[02/Apr/2013:17:37:03 -1000] -    -
[02/Apr/2013:17:37:03 -1000] -    modifiersname: cn=directory manager
[02/Apr/2013:17:37:03 -1000] -    replace: modifiersname
[02/Apr/2013:17:37:03 -1000] -    -
[02/Apr/2013:17:37:03 -1000] -    modifytimestamp: 20130403033703Z
[02/Apr/2013:17:37:03 -1000] -    replace: modifytimestamp
[02/Apr/2013:17:37:03 -1000] -    -



Version-Release number of selected component (if applicable):
I'm running 389-ds-base.x86_64 1.2.11.15-12.el6_4 on RHEL 6.3.

Comment 1 Noriko Hosoi 2013-04-03 23:39:29 UTC
(In reply to comment #0)
> Description of problem:
> When I do a "replace: userPassword" with an empty set of values (which will
> cause the attribute to be removed), 389ds only remove the userPassword
> attribute and doesn't remove the unhashed#user#password attribute.

You are right.  It looks the old unhashed password is not removed when userPassword is deleted with empty replace.  Could you please tell us how you found the issue?  

We think 1) ldapsearch does not return the unhashed password value and 2) the following operation on the userPassword (e.g., adding a new one) works fine.

If you could share any other problems you are having, we'd appreciate it.

Comment 2 Thang Nguyen 2013-04-03 23:58:58 UTC
Hi Noriko,

I've an existing LDAP entry with the password of "testabc".


I was trying to delete the userPassword attribute with an empty replace by running ldapmodify on the following LDIF:

dn: uid=testuser,ou=People,dc=hawaii,dc=edu
changetype: modify
replace: userPassword

and then add the same password back by doing a ldapmodify the following:

dn: uid=testuser,ou=people,dc=hawaii,dc=edu
changetype: modify
add: userPassword
userPassword: testabc

and I get this error:

ldap_modify: Other (e.g., implementation specific) error (80)

I see the following in the error log:

[02/Apr/2013:17:39:55 -1000] - add value "thangtest" to attribute type "unhashed#user#password" in entry "uid=testuser,ou=People,dc=hawaii,dc=edu" failed: value exists

However there are no error if I use "replace: userPassword" instead of "add: userPassword".

dn: uid=testuser,ou=people,dc=hawaii,dc=edu
changetype: modify
replace: userPassword
userPassword: testabc

Thanks.

--thang

Comment 3 Thang Nguyen 2013-04-04 00:02:28 UTC
Hi Noriko,

I've an existing LDAP entry with the password of "testabc".


I was trying to delete the userPassword attribute with an empty replace by running ldapmodify on the following LDIF:

dn: uid=testuser,ou=People,dc=hawaii,dc=edu
changetype: modify
replace: userPassword

and then add the same password back by doing a ldapmodify the following:

dn: uid=testuser,ou=people,dc=hawaii,dc=edu
changetype: modify
add: userPassword
userPassword: testabc

and I get this error:

ldap_modify: Other (e.g., implementation specific) error (80)

I see the following in the error log:

[02/Apr/2013:17:39:55 -1000] - add value "thangtest" to attribute type "unhashed#user#password" in entry "uid=testuser,ou=People,dc=hawaii,dc=edu" failed: value exists

However there are no error if I use "replace: userPassword" instead of "add: userPassword".

dn: uid=testuser,ou=people,dc=hawaii,dc=edu
changetype: modify
replace: userPassword
userPassword: testabc

and also no error if I add a new password.

Thanks.

--thang

Comment 4 Noriko Hosoi 2013-04-04 00:14:23 UTC
Interesting...  That's I cannot reproduce.  Here's my result:
$ rpm -q 389-ds-base
389-ds-base-1.2.11.15-12.el6_4.x86_64

$ ldapmodify -x -h localhost -p 389 -D 'cn=directory manager' -w password
dn: uid=tuser2,ou=People,dc=localdomain
changetype: modify
replace: userpassword

modifying entry "uid=tuser2,ou=People,dc=localdomain"

$ ldapmodify -x -h localhost -p 389 -D 'cn=directory manager' -w password
dn: uid=tuser2,ou=People,dc=localdomain
changetype: modify
add: userpassword
userpassword: newtuser2

modifying entry "uid=tuser2,ou=People,dc=localdomain"

And I could auth with the new password, but not the old one (it returns 49).
$ ldapsearch -LLLx -h localhost -p 389 -D 'uid=tuser2,ou=People,dc=localdomain' -w newtuser2 -b "" -s base dn
dn:

Comment 5 Thang Nguyen 2013-04-04 00:26:01 UTC
Hi Noriko,

Is "newtuser2" the new or the old password?

Can you try add the old password that you removed?

There's no problem when I add the new password.  The error occurs only when you try to re-add the old password.

Comment 6 Noriko Hosoi 2013-04-04 00:42:17 UTC
Thank you, Thang!  I could reproduce the problem!

Comment 8 Nathan Kinder 2013-04-08 01:41:56 UTC
This issue will be fixed when we rebase to 389-ds-base 1.3.0 (or later).  Other changes were made in 389-ds-base 1.3.0 in the way we handle unhashed#user#password, so this issue does not exist there.  In 389-ds-base 1.2.11, there are numerous workarounds that can be used:

- do a delete of the userpassword attribute followed by an add or replace to ad the new userpassword value.

- do a replace to delete the old userpassword attribute followed by another replace to add the new userpassword value.

Comment 10 Noriko Hosoi 2013-07-08 21:17:01 UTC
This bug is fixed in 389-ds-base-1.3.1 branch.

Comment 11 Rich Megginson 2013-10-01 23:27:04 UTC
moving all ON_QA bugs to MODIFIED in order to add them to the errata (can't add bugs in the ON_QA state to an errata).  When the errata is created, the bugs should be automatically moved back to ON_QA.

Comment 13 Sankar Ramalingam 2014-01-30 07:28:55 UTC
[root@hp-dl380pgen8-02-vm-1 ~]# ldapmodify -x -p 1389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
dn: uid=newusrhashpasswd2,ou=people,dc=example,dc=com
changetype: modify
replace: userpassword
EOF                     

modifying entry "uid=newusrhashpasswd2,ou=people,dc=example,dc=com"

[root@hp-dl380pgen8-02-vm-1 ~]# ldapmodify -x -p 1389 -h localhost -D "cn=Directory Manager" -w Secret123 << EOF
dn: uid=newusrhashpasswd2,ou=people,dc=example,dc=com
changetype: modify
replace: userpassword
userpassword: Secret123 
EOF

modifying entry "uid=newusrhashpasswd2,ou=people,dc=example,dc=com"

[root@hp-dl380pgen8-02-vm-1 ~]# ldapsearch -x -p 1389 -h localhost -D "uid=newusrhashpasswd2,ou=people,dc=example,dc=com" -w Secret123 -b "uid=newusrhashpasswd2,ou=people,dc=example,dc=com" |grep -i dn:
dn: uid=newusrhashpasswd2,ou=People,dc=example,dc=com


I could successfully replace with an empty password and then add the same old password. Hence, marking the bug as verified.

Build tested - 1.3.1.6-15
Platform:
[root@hp-dl380pgen8-02-vm-1 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.0 Beta (Maipo)

Comment 15 Ludek Smid 2014-06-13 12:19:37 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.