74ca47
From 3937047eee31638df068b3294aa90ef603915676 Mon Sep 17 00:00:00 2001
74ca47
From: Mark Reynolds <mreynolds@redhat.com>
74ca47
Date: Mon, 10 Apr 2017 14:55:55 -0400
74ca47
Subject: [PATCH] Issue 47662 - CLI args get removed
74ca47
74ca47
Bug Description.  Regression from previous fix.  The process to check unknown
74ca47
                  CLI options blows away the built-in arg list "$@"
74ca47
74ca47
Fix Description:  Make a copy of $@, and use it as needed.
74ca47
74ca47
https://pagure.io/389-ds-base/issue/47662
74ca47
74ca47
Reviewed by: nhosoi(Thanks!)
74ca47
---
74ca47
 ldap/admin/src/scripts/db2ldif.in | 3 ++-
74ca47
 ldap/admin/src/scripts/ldif2db.in | 3 ++-
74ca47
 2 files changed, 4 insertions(+), 2 deletions(-)
74ca47
74ca47
diff --git a/ldap/admin/src/scripts/db2ldif.in b/ldap/admin/src/scripts/db2ldif.in
74ca47
index 85854b3..08f30e4 100755
74ca47
--- a/ldap/admin/src/scripts/db2ldif.in
74ca47
+++ b/ldap/admin/src/scripts/db2ldif.in
74ca47
@@ -130,6 +130,7 @@ do
74ca47
     esac
74ca47
 done
74ca47
 
74ca47
+ARGS=$@
74ca47
 shift $(($OPTIND - 1))
74ca47
 if [ $1 ]
74ca47
 then
74ca47
@@ -156,7 +157,7 @@ fi
74ca47
 servid=`normalize_server_id $initfile`
74ca47
 . $initfile
74ca47
 
74ca47
-ldif_file=`make_ldiffile $@`
74ca47
+ldif_file=`make_ldiffile $ARGS`
74ca47
 rn=$?
74ca47
 
74ca47
 echo "Exported ldif file: $ldif_file"
74ca47
diff --git a/ldap/admin/src/scripts/ldif2db.in b/ldap/admin/src/scripts/ldif2db.in
74ca47
index f968303..20c7d46 100755
74ca47
--- a/ldap/admin/src/scripts/ldif2db.in
74ca47
+++ b/ldap/admin/src/scripts/ldif2db.in
74ca47
@@ -87,6 +87,7 @@ then
74ca47
     exit 1
74ca47
 fi
74ca47
 
74ca47
+ARGS=$@
74ca47
 shift $(($OPTIND - 1))
74ca47
 if [ $1 ]
74ca47
 then
74ca47
@@ -106,7 +107,7 @@ fi
74ca47
 
74ca47
 . $initfile
74ca47
 
74ca47
-handleopts $@
74ca47
+handleopts $ARGS
74ca47
 quiet=$?
74ca47
 if [ $quiet -eq 0 ]; then
74ca47
     echo importing data ...
74ca47
-- 
74ca47
2.9.3
74ca47