Bug 1044157

Summary: Some updates of "passwordgraceusertime" are useless when updating "userpassword"
Product: Red Hat Enterprise Linux 7 Reporter: Nathan Kinder <nkinder>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: unspecified Docs Contact:
Priority: low    
Version: 7.0CC: amsharma, nhosoi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.3.1-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 09:31:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nathan Kinder 2013-12-17 21:32:59 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/47371

Whatever is the password policy (local or default), when updating the "userpassword" the password policy attribute "passwordgraceusertime" is reset to 0. In some cases it is useless (if the value was already 0). In addition in a customer case where password policy is default, retroCL records this unexpected update.


Test case:
Create an instance and a test entry with a password


{{{
ldapsearch -LLL -h localhost -p 2011 -D "cn=directory manager" -w Secret123 -b "dc=com" uid=xxx passwordgraceusertime
dn: uid=xxx,dc=com
passwordgraceusertime: 0

ldapmodify -h localhost -p 2011 -D "cn=directory manager" -w Secret123 
dn: uid=xxx,dc=com
changetype: modify
replace: userpassword
userpassword: secret12


(gdb) break pw_apply_mods
(gdb) c
(gdb) where
#0  pw_apply_mods (sdn=0x7f50cc000d70, mods=0x7f50eb7f9690) at ldap/servers/slapd/pw_retry.c:263
#1  0x00007f5108e2b3ff in update_pw_info (pb=0x7f50eb7fdaa0, old_pw=0x0) at ldap/servers/slapd/pw.c:686
#2  0x00007f5108e0c918 in op_shared_modify (pb=0x7f50eb7fdaa0, pw_change=1, old_pw=0x0) at ldap/servers/slapd/modify.c:1091
#3  0x00007f5108e0b084 in do_modify (pb=0x7f50eb7fdaa0) at ldap/servers/slapd/modify.c:415
#4  0x0000000000414d86 in connection_dispatch_operation (conn=0x7f5100330e10, op=0x12021d0, pb=0x7f50eb7fdaa0)
    at ldap/servers/slapd/connection.c:652
#5  0x00000000004169ab in connection_threadmain () at ldap/servers/slapd/connection.c:2479
#6  0x0000003426428afd in _pt_root (arg=0x1216d30) at ../../../mozilla/nsprpub/pr/src/pthreads/ptthread.c:191
#7  0x00000035d7007d14 in start_thread (arg=0x7f50eb7fe700) at pthread_create.c:309
#8  0x00000035d6cf168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

(gdb) break ldbm_back_modify
(gdb) c

(gdb) where
#0  ldbm_back_modify (pb=0x7f50eb7f9390) at ldap/servers/slapd/back-ldbm/ldbm_modify.c:541
#1  0x00007f5108e0c871 in op_shared_modify (pb=0x7f50eb7f9390, pw_change=0, old_pw=0x0) at ldap/servers/slapd/modify.c:1075
#2  0x00007f5108e0b643 in modify_internal_pb (pb=0x7f50eb7f9390) at ldap/servers/slapd/modify.c:627
#3  0x00007f5108e0b220 in slapi_modify_internal_pb (pb=0x7f50eb7f9390) at ldap/servers/slapd/modify.c:482
#4  0x00007f5108e3000b in pw_apply_mods (sdn=0x7f50cc00e810, mods=0x7f50eb7f9690) at ldap/servers/slapd/pw_retry.c:274
#5  0x00007f5108e2b3ff in update_pw_info (pb=0x7f50eb7fdaa0, old_pw=0x0) at ldap/servers/slapd/pw.c:686
#6  0x00007f5108e0c918 in op_shared_modify (pb=0x7f50eb7fdaa0, pw_change=1, old_pw=0x0) at ldap/servers/slapd/modify.c:1091
#7  0x00007f5108e0b084 in do_modify (pb=0x7f50eb7fdaa0) at ldap/servers/slapd/modify.c:415
#8  0x0000000000414d86 in connection_dispatch_operation (conn=0x7f5100330e10, op=0x12021d0, pb=0x7f50eb7fdaa0)
    at ldap/servers/slapd/connection.c:652
#9  0x00000000004169ab in connection_threadmain () at ldap/servers/slapd/connection.c:2479
#10 0x0000003426428afd in _pt_root (arg=0x1216d30) at ../../../mozilla/nsprpub/pr/src/pthreads/ptthread.c:191
#11 0x00000035d7007d14 in start_thread (arg=0x7f50eb7fe700) at pthread_create.c:309
#12 0x00000035d6cf168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

...
(gdb) 
541				if (modify_apply_check_expand(pb, operation, mods, e, ec, &postentry,
(gdb) print mods[0]->mod_type
$2 = 0x7f50cc007890 "passwordgraceusertime"
(gdb) print mods[0]->mod_vals->modv_bvals->bv_len
$6 = 1
(gdb) print mods[0]->mod_vals->modv_bvals->bv_val
$7 = 0x7f50cc0077b0 "0"




}}}

Comment 2 Amita Sharma 2014-12-26 12:43:50 UTC
[root@dhcp201-126 en]# ldapmodify -D "cn=directory manager" -w Secret123 -p 389 -h localhost << EOF
> dn: uid=ami,dc=example,dc=com
> changetype: modify
> replace: userpassword
> userpassword: secret12
> EOF
modifying entry "uid=ami,dc=example,dc=com"

[root@dhcp201-126 en]# ldapsearch -LLL -D "cn=directory manager" -w Secret123 -p 389 -h localhost -b  "uid=ami,dc=example,dc=com" passwordgraceusertime
dn: uid=ami,dc=example,dc=com
passwordgraceusertime: 0

[root@dhcp201-126 en]# ldapsearch -LLL -D "cn=directory manager" -w Secret123 -p 389 -h localhost -b  "uid=ami1,dc=example,dc=com" passwordgraceusertime
dn: uid=ami1,dc=example,dc=com

[root@dhcp201-126 en]# ldapmodify -D "cn=directory manager" -w Secret123 -p 389 -h localhost << EOFdn: uid=ami1,dc=example,dc=com
changetype: modify
replace: userpassword
userpassword: secret12
EOF

modifying entry "uid=ami1,dc=example,dc=com"

[root@dhcp201-126 en]# ldapsearch -LLL -D "cn=directory manager" -w Secret123 -p 389 -h localhost -b  "uid=ami1,dc=example,dc=com" passwordgraceusertime
dn: uid=ami1,dc=example,dc=com
passwordgraceusertime: 0

NOTE :: passwordgraceusertime does not get set automatically, it gets set as 0 only when changing user password.
Hence VERIFIED.

Comment 4 errata-xmlrpc 2015-03-05 09:31:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0416.html