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