#48143 Password is not correctly passed to perl command line tools if it contains shell special characters.
Closed: Fixed None Opened 4 years ago by dmytroleonenko.

Hello
when using
./fixup-memberof.pl -D 'cn=Directory manager' -b 'dc=example,dc=com' -v -w -
pas$w!ord

the script ends up with:
Bind Password:
ldap_bind: Invalid credentials (49)
Failed to add task entry "cn=memberOf_fixup_2015_4_6_8_26_18, cn=memberOf task, cn=tasks, cn=config" error (49)

after changing Directory Manager's password to PassWd1Dm the problem has gone:
ldap_initialize( ldap://example.com:389 )
Successfully added task entry "cn=memberOf_fixup_2015_4_6_8_52_55, cn=memberOf task, cn=tasks, cn=config"


I think you will still run into problems if the password contains ' or . Instead, you might want to use the shellEscape function in DSUtil.pm.

git patch file (master) -- revised to use shellEscape to escape special characters
0001-Ticket-48143-Password-is-not-correctly-passed-to-per.2.patch

Reviewed by Rich (Thank you!!)

Pushed to master:
d85ef49..e7c8da6 master -> master
commit e7c8da6

Reviewed by Rich (Thank you!!)

Pushed to 389-ds-base-1.2.11:
ba48827..68b1039 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit 68b1039

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

3 years ago

Login to comment on this ticket.

Metadata