#48254 Shell CLI fails with usage errors if an argument containing white spaces is given
Closed: wontfix None Opened 6 years ago by nhosoi.

For instance, if db2index is run against the standard browsing index, it fails.

sh -x /usr/sbin/db2index -Z SERVERID -n userRoot -T "by MCC ou=People dc=example dc=com"

+ /usr/sbin/ns-slapd db2index -D /etc/dirsrv/slapd-SERVERID -n userRoot= -T by MCC ou=People dc=example dc=com
usage: ns-slapd db2index -D configdir -n backend-instance-name [-d debuglevel] {-t attributetype}* {-T VLV Search Name}*

There are 2 issues.

1. '=' is accidentally added to "userRoot"
2. "by MCC ou=People dc=example dc=com" is not passed as one string, but as separate words.

I didn't know you could preserve whitespace with eval like that. Good to know.

Reviewed by Rich (Thank you!!)

Pushed to master:
db7153f..3507c46 master -> master
commit 3507c46

Pushed to 389-ds-base-1.3.4:
1781280..a6d7e3b 389-ds-base-1.3.4 -> 389-ds-base-1.3.4
commit a6d7e3b

Pushed to 389-ds-base-1.3.3:
5c48f28..7f63b58 389-ds-base-1.3.3 -> 389-ds-base-1.3.3
commit 7f63b58

Should we apply the "eval" change to all the DS scripts?

Replying to [comment:6 mreynolds]:

Should we apply the "eval" change to all the DS scripts?

Probably... The "eval" was added to keep the spaces in the shell command line arg, e.g., "by MCC ou=People dc=example dc=com". I thought the cases are rare, but...

For instance, this works:
/usr/sbin/db2ldif -Z test -s "dc=example,dc=com"
but this fails...
/usr/sbin/db2ldif -Z test -s "dc=example, dc=com"
And, this command line fails, too... :(
/usr/sbin/db2ldif -Z test -n userRoot -a /tmp/'a b c'
Exported ldif file: /tmp/a
usage: ns-slapd db2ldif -D configdir [-n backend-instance-name] [-d debuglevel] [-N] [-a outputfile] [-r] [-C] [{-s includesuffix}] [{-x excludesuffix}] [-u] [-U] [-m] [-M] [-E] [-q]
Note: either "-n backend_instance_name" or "-s includesuffix" is required.
Updatinng the summary and reopening it.

git patch file (master) -- applying the similar changes to all the shell CLI

Reviewed by Mark (Thank you!!)

Pushed to master:
3507c46..5fe2892 master -> master
commit 5fe2892

Pushed to 389-ds-base-1.3.4:
a6d7e3b..19b0d4a 389-ds-base-1.3.4 -> 389-ds-base-1.3.4
commit 19b0d4a

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

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/1585

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

a year ago

Login to comment on this ticket.