Commit 6029bf44 authored by Leigh B. Stoller's avatar Leigh B. Stoller

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.
parent 2bc4b01e
...@@ -253,10 +253,6 @@ if (system("egrep -q -s '^${user}:' /etc/passwd")) { ...@@ -253,10 +253,6 @@ if (system("egrep -q -s '^${user}:' /etc/passwd")) {
"-g $default_groupname -s $PBAG")) { "-g $default_groupname -s $PBAG")) {
fatal("Could not add user $user to local node."); fatal("Could not add user $user to local node.");
} }
#
# First time account is made, do some extra work.
#
FirstTime();
} }
else { else {
print "Updating user $user ($user_number) on local node.\n"; print "Updating user $user ($user_number) on local node.\n";
...@@ -267,11 +263,6 @@ else { ...@@ -267,11 +263,6 @@ else {
if (system("$USERMOD $user -c \"$fullname\" ")) { if (system("$USERMOD $user -c \"$fullname\" ")) {
fatal("Could not modify user $user on local node."); fatal("Could not modify user $user on local node.");
} }
#
# Temp Hack!
#
FirstTime();
} }
# #
...@@ -315,6 +306,11 @@ if ($control_node ne $BOSSNODE) { ...@@ -315,6 +306,11 @@ if ($control_node ne $BOSSNODE) {
} }
} }
#
# Do "first time" stuff.
#
FirstTime();
# #
# Create a new authorized keys file from DB. # Create a new authorized keys file from DB.
# #
...@@ -425,14 +421,14 @@ sub FirstTime() ...@@ -425,14 +421,14 @@ sub FirstTime()
chown($user_number, $default_groupgid, "$SFSDIR") or chown($user_number, $default_groupgid, "$SFSDIR") or
fatal("Could not chown $SFSDIR: $!"); fatal("Could not chown $SFSDIR: $!");
$dosfs = 0; $dosfs = 1;
} }
# #
# Check for missing identity file # Check for missing identity file
# #
if (! -e "$SFSDIR/identity") { if (! -e "$SFSDIR/identity") {
$dosfs = 0; $dosfs = 1;
} }
if ($dosfs) { if ($dosfs) {
...@@ -460,7 +456,8 @@ sub FirstTime() ...@@ -460,7 +456,8 @@ sub FirstTime()
if ($ident =~ /.*,.*,.*,(.*),(.*)/) { if ($ident =~ /.*,.*,.*,(.*),(.*)/) {
DBQueryFatal("replace into user_sfskeys ". DBQueryFatal("replace into user_sfskeys ".
"values ('$user', '$2', '${user}:${1}:${user}::', now())"); "values ('$user', '$2', '${user}:${1}:${user}::', ".
"now())");
} }
else { else {
warn("*** $0:\n". warn("*** $0:\n".
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment