From 6029bf447b8681005abea8adc4e239f62f9bab20 Mon Sep 17 00:00:00 2001 From: "Leigh B. Stoller" Date: Wed, 21 Aug 2002 13:30:59 +0000 Subject: [PATCH] Rorg slightly so that we do the first time stuff after both accounts are created. Fixes problem with SFS key generation happening before account is created on ops. --- tbsetup/mkacct.in | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tbsetup/mkacct.in b/tbsetup/mkacct.in index ae0b3db60..5f70a242b 100755 --- a/tbsetup/mkacct.in +++ b/tbsetup/mkacct.in @@ -253,10 +253,6 @@ if (system("egrep -q -s '^${user}:' /etc/passwd")) { "-g $default_groupname -s $PBAG")) { fatal("Could not add user $user to local node."); } - # - # First time account is made, do some extra work. - # - FirstTime(); } else { print "Updating user $user ($user_number) on local node.\n"; @@ -267,11 +263,6 @@ else { if (system("$USERMOD $user -c \"$fullname\" ")) { fatal("Could not modify user $user on local node."); } - - # - # Temp Hack! - # - FirstTime(); } # @@ -315,6 +306,11 @@ if ($control_node ne $BOSSNODE) { } } +# +# Do "first time" stuff. +# +FirstTime(); + # # Create a new authorized keys file from DB. # @@ -425,14 +421,14 @@ sub FirstTime() chown($user_number, $default_groupgid, "$SFSDIR") or fatal("Could not chown $SFSDIR: $!"); - $dosfs = 0; + $dosfs = 1; } # # Check for missing identity file # if (! -e "$SFSDIR/identity") { - $dosfs = 0; + $dosfs = 1; } if ($dosfs) { @@ -460,7 +456,8 @@ sub FirstTime() if ($ident =~ /.*,.*,.*,(.*),(.*)/) { DBQueryFatal("replace into user_sfskeys ". - "values ('$user', '$2', '${user}:${1}:${user}::', now())"); + "values ('$user', '$2', '${user}:${1}:${user}::', ". + "now())"); } else { warn("*** $0:\n". -- GitLab