https://bugs.openldap.org/show_bug.cgi?id=9446
Issue ID: 9446 Summary: back_passwd: invalid parsing of gecos field Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: grapvar@gmail.com Target Milestone: ---
Created attachment 788 --> https://bugs.openldap.org/attachment.cgi?id=788&action=edit fix
Parsing gecos(comment) field of /etc/passwd in servers/slapd/back-passwd/search.c`pw2entry() has issues. I expands '&':
1) anywhere in in gecos, but the expansion must be limited by user's full name. 2) only 1st '&', but all `&'s in full name must be expanded
(nice explanation: https://unix.stackexchange.com/questions/535189/ampersand-in-the-passwd-geco...)
fix attached. It expands each `&', left to right, until expanded user's full name fits into internal { char buf[1024]; }