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 1212657 - Password is not correctly passed to perl command line tools if it contains shell special characters.
Summary: Password is not correctly passed to perl command line tools if it contains sh...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base
Version: 6.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
URL:
Whiteboard:
: 1176426 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-16 23:28 UTC by Noriko Hosoi
Modified: 2020-09-13 21:22 UTC (History)
5 users (show)

Fixed In Version: 389-ds-base-1.2.11.15-54.el6
Doc Type: Bug Fix
Doc Text:
Cause: Password is not correctly passed to perl command line tools if it contains shell special characters. Consequence: If the password contains such special characters, the tools did not start. Fix: Now the shell special characters are properly escaped. Result: The perl command line tools have no problem with the shell special characters.
Clone Of:
Environment:
Last Closed: 2015-07-22 06:37:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 1474 0 None None None 2020-09-13 21:22:33 UTC
Red Hat Product Errata RHBA-2015:1326 0 normal SHIPPED_LIVE 389-ds-base bug fix and enhancement update 2015-07-20 17:53:07 UTC

Description Noriko Hosoi 2015-04-16 23:28:27 UTC
When using 
./fixup-memberof.pl -D 'cn=Directory manager' -b 'dc=example,dc=com' -v -w - 
pas$w!or'd"

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)

The shell special characters are not properly escaped.

The issue is shared almost all the perl scripts in /usr/lib[64]/dirsrv/slapd-ID.

Comment 1 Noriko Hosoi 2015-04-16 23:35:26 UTC
Affected scripts:
  bak2db.pl
  cleanallruv.pl
  db2bak.pl
  db2index.pl
  db2ldif.pl
  fixup-linkedattrs.pl
  fixup-memberof.pl
  ldif2db.pl
  ns-accountstatus.pl
  ns-activate.pl
  ns-inactivate.pl
  ns-newpwpolicy.pl
  schema-reload.pl
  syntax-validate.pl
  usn-tombstone-cleanup.pl

Steps:
Set the directory manager's password to pas$w!or'd"

Run each script with
  -D 'cn=directory manager' -w pas\$w\!or\'d\"
And
  -D 'cn=directory manager' -w -
Bind Password: pas$w!or'd"

If the bind is successful, the fix is verified.

Comment 3 Sankar Ramalingam 2015-05-15 17:30:44 UTC
[root@ivanova slapd-M1]# ./db2bak.pl -D 'cn=Directory manager' -a /tmp/test123  -w -
Bind Password: 
Back up directory: /tmp/test123
adding new entry "cn=backup_2015_5_15_9_58_29, cn=backup, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./db2bak.pl -D 'cn=Directory manager' -a /tmp/test123  -w pas\$w\!or\'d\"
Back up directory: /tmp/test123
adding new entry "cn=backup_2015_5_15_9_58_43, cn=backup, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./bak2db.pl -D 'cn=Directory manager' -a /tmp/test123 -n userRoot -w -
Bind Password: 
adding new entry "cn=restore_2015_5_15_10_38_6, cn=restore, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./bak2db.pl -D 'cn=Directory manager' -a /tmp/test123 -n userRoot -w pas\$w\!or\'d\"
adding new entry "cn=restore_2015_5_15_10_38_32, cn=restore, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./cleanallruv.pl -D 'cn=Directory manager'  -b "dc=passsync,dc=com" -r 1232 -w pas\$w\!or\'d\"
adding new entry "cn=cleanallruv_2015_5_15_10_39_50, cn=cleanallruv, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./cleanallruv.pl -D 'cn=Directory manager'  -b "dc=passsync,dc=com" -r 1232 -w -
Bind Password: 
adding new entry "cn=cleanallruv_2015_5_15_10_40_20, cn=cleanallruv, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./db2index.pl -D 'cn=Directory manager' -T cn -n userRoot -w pas\$w\!or\'d\"
adding new entry "cn=db2index_2015_5_15_13_9_1, cn=index, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./db2index.pl -D 'cn=Directory manager' -T cn -n userRoot -w -
Bind Password: 
adding new entry "cn=db2index_2015_5_15_13_9_20, cn=index, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./db2ldif.pl -D 'cn=Directory manager'  -n userRoot -w pas\$w\!or\'d\"
Exporting to ldif file: /var/lib/dirsrv/slapd-M1/ldif/M1-userRoot-2015_5_15_13_10_28.ldif
adding new entry "cn=export_2015_5_15_13_10_28, cn=export, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./db2ldif.pl -D 'cn=Directory manager'  -n userRoot -w -
Bind Password: 
Exporting to ldif file: /var/lib/dirsrv/slapd-M1/ldif/M1-userRoot-2015_5_15_13_10_41.ldif
adding new entry "cn=export_2015_5_15_13_10_41, cn=export, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./ldif2db.pl -D 'cn=Directory manager' -i /var/lib/dirsrv/slapd-M1/ldif/M1-userRoot-2015_5_15_13_10_28.ldif -s "dc=passsync,dc=com" -n userRoot -w pas\$w\!or\'d\"
adding new entry "cn=import_2015_5_15_13_14_7, cn=import, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./ldif2db.pl -D 'cn=Directory manager' -i /var/lib/dirsrv/slapd-M1/ldif/M1-userRoot-2015_5_15_13_10_28.ldif -s "dc=passsync,dc=com" -n userRoot -w -
Bind Password: 
adding new entry "cn=import_2015_5_15_13_14_22, cn=import, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./ns-accountstatus.pl -D 'cn=Directory manager'  -I "uid=users1189users5,ou=People,dc=passsync,dc=com" -w pas\$w\!or\'d\"
uid=users1189users5,ou=People,dc=passsync,dc=com  activated.
[root@ivanova slapd-M1]# ./ns-accountstatus.pl -D 'cn=Directory manager'  -I "uid=users1189users5,ou=People,dc=passsync,dc=com" -w -
Bind Password: 
uid=users1189users5,ou=People,dc=passsync,dc=com  activated.

[root@ivanova slapd-M1]# ./ns-activate.pl -D 'cn=Directory manager'  -I "uid=users1189users5,ou=People,dc=passsync,dc=com" -w -
Bind Password: 
uid=users1189users5,ou=People,dc=passsync,dc=com already activated.
[root@ivanova slapd-M1]# ./ns-activate.pl -D 'cn=Directory manager'  -I "uid=users1189users5,ou=People,dc=passsync,dc=com" -w pas\$w\!or\'d\"
uid=users1189users5,ou=People,dc=passsync,dc=com already activated.
[root@ivanova slapd-M1]# ./ns-inactivate.pl -D 'cn=Directory manager'  -I "uid=users1189users5,ou=People,dc=passsync,dc=com" -w pas\$w\!or\'d\"
uid=users1189users5,ou=People,dc=passsync,dc=com inactivated.
[root@ivanova slapd-M1]# ./ns-inactivate.pl -D 'cn=Directory manager'  -I "uid=users1189users5,ou=People,dc=passsync,dc=com" -w -
Bind Password: 
uid=users1189users5,ou=People,dc=passsync,dc=com already inactivated.

 ./usn-tombstone-cleanup.pl -D "cn=Directory Manager" -n userRoot -w -
Bind Password: 
adding new entry "cn=usn_cleanup_2015_5_15_13_25_20, cn=USN tombstone cleanup task, cn=tasks, cn=config"
ldap_add: No such object (32)

[root@ivanova slapd-M1]# ./ns-activate.pl -D 'cn=Directory manager'  -I "uid=users1189users5,ou=People,dc=passsync,dc=com" -j /tmp/pass.txt 
uid=users1189users5,ou=People,dc=passsync,dc=com activated.
[root@ivanova slapd-M1]# ./ns-activate.pl -D 'cn=Directory manager'  -I "uid=users1189users5,ou=People,dc=passsync,dc=com" -j /tmp/pass.txt 
uid=users1189users5,ou=People,dc=passsync,dc=com already activated.


[root@ivanova slapd-M1]# ./fixup-linkedattrs.pl -D 'cn=Directory manager' -l "uid=users1189users5,ou=People,dc=passsync,dc=com" -w - 
Bind Password: 
adding new entry "cn=linked_attrs_fixup_2015_5_15_13_27_58, cn=fixup linked attributes, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./fixup-memberof.pl -D 'cn=Directory manager' -b "uid=users1189users5,ou=People,dc=passsync,dc=com" -w pas\$w\!or\'d\"
adding new entry "cn=memberOf_fixup_2015_5_15_13_28_53, cn=memberOf task, cn=tasks, cn=config"
ldap_add: No such object (32)

[root@ivanova slapd-M1]# ./schema-reload.pl -D 'cn=Directory manager' -d /etc/dirsrv/schema/ -w pas\$w\!or\'d\"
adding new entry "cn=schema_reload_2015_5_15_13_30_14, cn=schema reload task, cn=tasks, cn=config"

[root@ivanova slapd-M1]# ./schema-reload.pl -D 'cn=Directory manager' -d /etc/dirsrv/schema/ -w -
Bind Password: 
adding new entry "cn=schema_reload_2015_5_15_13_30_24, cn=schema reload task, cn=tasks, cn=config"


All the perl scripts are working perfectly fine with the escaped character passwords. Hence, marking the bug as Verified.

Comment 4 errata-xmlrpc 2015-07-22 06:37:26 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/RHBA-2015-1326.html

Comment 5 Noriko Hosoi 2016-02-18 19:23:22 UTC
*** Bug 1176426 has been marked as a duplicate of this bug. ***


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