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