Issue 9126 - add: pwdChangedTime leads to seg fault
Summary: add: pwdChangedTime leads to seg fault
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-02 12:18 UTC by Michael Ströder
Modified: 2020-03-21 18:23 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Michael Ströder 2019-12-02 12:18:41 UTC
Full_Name: Michael Str.der
Version: 2.4.48 / RE24 branch
OS: openSUSE Linux
URL: 
Submission from: (NULL) (213.240.182.73)


slapd seg faults in case the client sends a modify operation like this (let me
know if you need a stack trace):

----------------------------- snip -----------------------------
$ ldapmodify -e relax << EOF
dn: uid=test42,ou=Testing,dc=stroeder,dc=de
changetype: modify
add: pwdChangedTime
pwdChangedTime: 19721101000000Z

EOF
SASL/EXTERNAL authentication started
SASL username: gidNumber=100+uidNumber=1000,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "uid=test42,ou=Testing,dc=stroeder,dc=de"
ldap_result: Can't contact LDAP server (-1)
----------------------------- snip -----------------------------

Note that this only happens in case the userPassword was *freshly* set via
Password Modify ext. op.

If the client sends a modify operation with 'replace: pwdChangedTime' this works
correctly and after that 'add: pwdChangedTime' is correctly rejected:

----------------------------- snip -----------------------------
$ ldapmodify -e relax << EOF
dn: uid=test42,ou=Testing,dc=stroeder,dc=de
changetype: modify
replace: pwdChangedTime
pwdChangedTime: 19721101000000Z

EOF
SASL/EXTERNAL authentication started
SASL username: gidNumber=100+uidNumber=1000,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "uid=test42,ou=Testing,dc=stroeder,dc=de"

$ ldapmodify -e relax << EOF
dn: uid=test42,ou=Testing,dc=stroeder,dc=de
changetype: modify
add: pwdChangedTime
pwdChangedTime: 19721101000000Z

EOF
SASL/EXTERNAL authentication started
SASL username: gidNumber=100+uidNumber=1000,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "uid=test42,ou=Testing,dc=stroeder,dc=de"
ldap_modify: Type or value exists (20)
	additional info: modify/add: pwdChangedTime: value #0 already exists
----------------------------- snip -----------------------------
Comment 1 Michael Ströder 2020-01-13 21:35:13 UTC
This still happens with current RE24 snapshot.

Is more information needed to address this?

Comment 2 Ondřej Kuzník 2020-01-23 12:40:07 UTC
On Mon, Jan 13, 2020 at 09:35:18PM +0000, michael@stroeder.com wrote:
> This still happens with current RE24 snapshot.
> 
> Is more information needed to address this?

Hi,
had a look at it and a proposed patch is in a branch in my GitHub repo:
https://github.com/mistotebe/openldap/tree/its9126

Let me know if this fixes the issue for you.

As far as I have been able to figure out, the database content generated
by ppolicy until now was inconsistent with the schema (normalised value
was missing) and existing values will still cause the crash to happen. A
fix is to replace the affected values or export/reload the database.

Thanks,

-- 
Ondřej Kuzník
Senior Software Engineer
Symas Corporation                       http://www.symas.com
Packaged, certified, and supported LDAP solutions powered by OpenLDAP

Comment 3 Quanah Gibson-Mount 2020-01-23 23:57:43 UTC
changed notes
changed state Open to Release
moved from Incoming to Software Bugs
Comment 4 OpenLDAP project 2020-01-30 18:33:34 UTC
Fixed in master
Fixed in RE24 (2.4.49)
Comment 5 Quanah Gibson-Mount 2020-01-30 18:33:34 UTC
changed notes
changed state Release to Closed