Commit 9cf27516 authored by Leigh B Stoller's avatar Leigh B Stoller

Skip all of the collaboration tools stuff for nonlocal users and for

users that have their "nocollabtools" bit set (elabman, geniuser,
etc).
parent f97868c1
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -258,6 +258,8 @@ my $usr_shell = $target_user->shell();
my $usr_admin = $target_user->admin();
my $wpswd = $target_user->w_pswd();
my $wikionly = $target_user->wikionly();
my $isnonlocal = $target_user->IsNonLocal();
my $nocollabtools = $target_user->nocollabtools();
#
# Get the users earliest project membership to use as the default group
......@@ -398,7 +400,7 @@ sub AddUser()
$fullname =~ s/\"/\'/g;
$fullname =~ s/([^\\])([\'\"\(\)])/$1\\$2/g;
if ($CONTROL ne $BOSSNODE) {
if (!$isnonlocal) {
print "Adding user $user ($user_number) to $CONTROL.\n";
if (system("$SSH -host $CONTROL ".
......@@ -436,6 +438,9 @@ sub AddUser()
}
$UID = $SAVEUID;
goto skipstuff
if ($isnonlocal || $nocollabtools);
#
# Do the ssh thing. Invoke as real user for auditing.
#
......@@ -473,7 +478,7 @@ sub AddUser()
# Generate the SSL cert for the user.
system("$MKUSERCERT $user");
#
# Must update the exports file or else nodes will complain. There
# is a bit of race in here since this update happens after the
......@@ -493,6 +498,7 @@ sub AddUser()
if ($CONTROL ne $BOSSNODE) {
GenerateSFSKey();
}
skipstuff:
return 0;
}
......@@ -524,7 +530,7 @@ sub DelUser()
}
}
if ($CONTROL ne $BOSSNODE) {
if (! $isnonlocal) {
print "Removing user $user from $CONTROL\n";
if (system("$SSH -host $CONTROL '$USERDEL $user'")) {
......@@ -535,6 +541,9 @@ sub DelUser()
}
$UID = $SAVEUID;
goto skipstuff
if ($isnonlocal || $nocollabtools);
$EUID = $UID;
#
# Must update the exports file or else nodes will complain. Note
......@@ -565,6 +574,7 @@ sub DelUser()
$EUID = 0;
$sfsupdate = 1;
skipstuff:
return 0;
}
......@@ -611,6 +621,10 @@ sub UpdatePassword()
fatal("Could not update password encryption string for $target_user");
}
# Go no further if a nonlocal user.
return 0
if ($isnonlocal);
# Send auditing email before next step in case of failure.
SENDMAIL("$fullname <$user_email>",
"Password for '$user' has been changed",
......@@ -757,7 +771,7 @@ sub UpdateUser(;$)
#
# Sanity check.
#
if ($webonly) {
if ($webonly || $isnonlocal) {
return 0;
}
if (!defined($freezeopt) && ($status ne USERSTATUS_ACTIVE)) {
......@@ -867,6 +881,9 @@ sub UpdateEmail()
fatal("Could not update email address for $target_user");
}
return 0
if ($isnonlocal);
# Send auditing email before next step in case of failure.
SENDMAIL("$fullname <$user_email>",
"Email Address for '$user' Modified",
......@@ -1018,6 +1035,10 @@ sub CheckDotFiles()
my $cshrc = "$HOMEDIR/$user/.cshrc";
my $profile = "$HOMEDIR/$user/.profile";
# No home dirs for these.
return 0
if ($webonly || $isnonlocal);
if (! -d "$HOMEDIR/$user") {
return 0;
}
......
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