From 7f63b581fd035b0c13e068f5c0b8d78a5f1ad69d Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Aug 21 2015 16:58:00 +0000 Subject: Ticket #48254 - CLI db2index fails with usage errors Bug Description: 1) CLI db2index had an issue in option handling, which accidentally added '=' at the end of the previous option. 2) if a value of an option includes a white space, e.g., -T "by MCC ou=People dc=example dc=com", the value was not passed to the program as a string. Fix Description: 1) Removed unnecessary '='. 2) Quote $OPTARG which could include a white space, and call ns-slapd command line vai eval. https://fedorahosted.org/389/ticket/48254 Reviewed by rmeggins@redhat.com (Thank you, Rich!!) (cherry picked from commit 3507c46c9f1156df11b6cf05eba695d81088b416) (cherry picked from commit a6d7e3bd29eb63def170f73dc21e967df230f20a) --- diff --git a/ldap/admin/src/scripts/db2index.in b/ldap/admin/src/scripts/db2index.in index a1321ea..9af8fc8 100755 --- a/ldap/admin/src/scripts/db2index.in +++ b/ldap/admin/src/scripts/db2index.in @@ -39,13 +39,13 @@ do benameopt="set";; s) args=$args" -s $OPTARG" includeSuffix="set";; - t) args=$args" -t $OPTARG";; - T) args=$args=" -T $OPTARG";; - d) args=$args=" -d $OPTARG";; - a) args=$args=" -a $OPTARG";; - x) args=$args=" -x $OPTARG";; - v) args=$args=" -v";; - S) args=$args=" -S";; + t) args=$args" -t "\"$OPTARG\";; + T) args=$args" -T "\"$OPTARG\";; + d) args=$args" -d $OPTARG";; + a) args=$args" -a $OPTARG";; + x) args=$args" -x $OPTARG";; + v) args=$args" -v";; + S) args=$args" -S";; D) args=$args" -D $OPTARG";; ?) usage exit 1;; @@ -79,5 +79,5 @@ then usage exit 1 else - @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args + eval @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args fi