[sysadmin-bin: 74/168] Check number of arguments for create-repository/finish-import



commit 6100aa5971bf6c2842bb0601c34f1a8b2dde6563
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Apr 1 14:19:14 2009 -0400

    Check number of arguments for create-repository/finish-import
    
    The handling of quoting and word-splitting in ssh is unexpected ,
    so actually validate the number of arguments to create-repository
    so that create-repository "foo bar" doesn't happily create "foo"

 create-repository |    6 ++++++
 finish-import     |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/create-repository b/create-repository
index 295f865..4bc53bd 100755
--- a/create-repository
+++ b/create-repository
@@ -18,6 +18,12 @@ fi
 
 . $BINDIR/functions
 
+if [ $# != 1 ] ; then
+   echo "Too many arguments" 1>&2
+   echo "Usage: create-repository <repository-name>" 1>&2
+   exit 1
+fi
+
 validate_repository_name "$1"
 name="$1"
 
diff --git a/finish-import b/finish-import
index 680e87c..097e640 100755
--- a/finish-import
+++ b/finish-import
@@ -6,6 +6,12 @@ BINDIR=/home/admin/gitadmin-bin
 
 . $BINDIR/functions
 
+if [ $# != 1 ] ; then
+   echo "Too many arguments" 1>&2
+   echo "Usage: finish-import <repository-name>" 1>&2
+   exit 1
+fi
+
 validate_repository_name "$1"
 name="$1"
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]