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