Commit 515b0d7a authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Bug Fix: Do not export the homedirs of users who are "webonly" or who

are not "active" (perhaps frozen).

Also, as a sanity check and to prevent mountd from barfing, make sure
that any directory we try to export, actually exists. This is done via
the local mount points on boss, and is perhaps not such a great idea
cause it is via NFS. Keep an eye out for problems.
parent c08dbcf9
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -71,6 +71,10 @@ use lib "@prefix@/lib";
use libdb;
use libtestbed;
my $PROJROOT = PROJROOT();
my $GROUPROOT = GROUPROOT();
my $USERROOT = USERROOT();
#
# We need to serialize this script to avoid a trashed map file. Use
# a dummy file in /var/tmp, opened for writing and flock'ed.
......@@ -210,22 +214,44 @@ while (@row = $nodes_result->fetchrow_array) {
# Construct a list of directories accessible from this node.
# First the project and group directories.
# XXX needs to be fixed for shared experiments?
push(@dirlist, "$projdir/$pid");
if (-d "$PROJROOT/$pid") {
push(@dirlist, "$projdir/$pid");
}
else {
print STDERR "*** exports_setup: $PROJROOT/$pid does not exist!\n";
}
if ($gid ne $pid) {
push(@dirlist, "$groupdir/$pid/$gid");
if (-d "$GROUPROOT/$pid/$gid") {
push(@dirlist, "$groupdir/$pid/$gid");
}
else {
print STDERR "*** exports_setup: ".
"$GROUPROOT/$pid/$gid does not exist!\n";
}
}
# Determine the users that can access this node, and add those
# users' directories to the list.
# XXX needs to be fixed for shared experiments?
$users_result =
DBQueryFatal("select distinct uid from group_membership ".
"where pid='$pid' and gid='$gid' and trust!='none'");
DBQueryFatal("select distinct g.uid from group_membership as g ".
"left join users as u on u.uid=g.uid ".
"where g.pid='$pid' and g.gid='$gid' and ".
" (g.trust!='none' and ".
" u.webonly=0 and ".
" u.status='" . USERSTATUS_ACTIVE() . "')");
while (@usersrow = $users_result->fetchrow_array) {
my $uid = $usersrow[0];
push(@dirlist, "$usersdir/$uid");
if (-d "$USERROOT/$uid") {
push(@dirlist, "$usersdir/$uid");
}
else {
print STDERR "*** exports_setup: ".
"$USERROOT/$uid does not exist!\n";
}
}
# Build up filesystem sub-lists.
......
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