[Commits] idmgr branch master updated.

Martin Langhoff martin at laptop.org
Tue Sep 15 06:07:56 EDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "/home/olpc-code/git/projects/idmgr".

The branch, master has been updated
       via  af830efca6af919a71b94ddcb641ecf2cf541c24 (commit)
      from  a9c941f466fd5949965332bffbc25c8ece5f0ded (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

 scripts/create_user |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit af830efca6af919a71b94ddcb641ecf2cf541c24
Author: Martin Langhoff <martin at laptop.org>
Date:   Tue Sep 15 12:05:28 2009 +0200

    create_user: fix handling of parameters - fixes empty authorized_keys
    
    We need doublequotes for interpolation. Single quotes look more
    symmetrical in if [ "$a" == 'x' ] constructs but we want the left
    side to be interpolated and the right side to be taken literally.

diff --git a/scripts/create_user b/scripts/create_user
index 4e1a898..96cd522 100755
--- a/scripts/create_user
+++ b/scripts/create_user
@@ -40,13 +40,13 @@ die() {
 PASSWD_ONLY=0
 # this option allows the homedir setup (including dealings with ssh key)
 # to be skipped. useful when restoring from backups.
-if [ '$1' == '--passwd-only' ]; then
+if [ "$1" == '--passwd-only' ]; then
 	PASSWD_ONLY=1
 fi
 
 read username
 read full_name
-if [ '$PASSWD_ONLY' == '0' ]; then
+if [ "$PASSWD_ONLY" == '0' ]; then
 	read uuid       #unused!
 	read pubkey
 fi
@@ -54,7 +54,7 @@ fi
 # check for sane values
 export LC_ALL=C
 echo "$username" | grep -s -E '^[A-Z]{3}[A-F0-9]{8}$' &> /dev/null || die "bad username"
-if [ '$PASSWD_ONLY' == '0' ]; then
+if [ "$PASSWD_ONLY" == '0' ]; then
 	echo "$pubkey" | grep -s -E '^[A-Za-z0-9+/=]+$' &> /dev/null || die "bad public key"
 fi
 
@@ -78,7 +78,7 @@ else
     NEW_USER=1
 fi
 
-[ '$PASSWD_ONLY' == '1' ] && exit 0
+[ "$PASSWD_ONLY" == '1' ] && exit 0
 
 #from here, if a new user was created, a failure will leave the user
 #there but unconfigured. So rather than simply dying, we try to clean
-----------------------------------------------------------------------


--
/home/olpc-code/git/projects/idmgr


More information about the Commits mailing list