From f75dd2f4190d5e98c0c9af262c6e34e2ee575eca Mon Sep 17 00:00:00 2001 From: David Coppit Date: Wed, 24 Jun 2015 13:08:38 -0400 Subject: [PATCH] Fix arg processing bug --- runas.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/runas.sh b/runas.sh index 02c7289..8fb6454 100755 --- a/runas.sh +++ b/runas.sh @@ -12,13 +12,10 @@ function ts { #----------------------------------------------------------------------------------------------------------------------- function process_args { - # Shift off the args as we go so that we can exec $@ later. These are meant to be globals. + # These are meant to be globals. UMAP=$1 - shift - GMAP=$1 - shift - UGID=$1 - shift + GMAP=$2 + UGID=$3 for NAME_UID_GID in $UMAP do @@ -40,7 +37,7 @@ function process_args { if [[ ! "$UGID" =~ ^[0-9]{1,}:[0-9]{1,}$ ]] then - echo "UGID value is not valid. It should be of the form :" + echo "UGID value $UGID is not valid. It should be of the form :" exit 1 fi } @@ -103,7 +100,10 @@ function create_user { #----------------------------------------------------------------------------------------------------------------------- -process_args +process_args "$@" + +# Shift off the args so that we can exec $@ below +shift; shift; shift update_users "$UMAP" update_groups "$GMAP"