Commit d123e03d authored by Mike Hibler's avatar Mike Hibler

Create archive directory (expinfo) entry with unix gid of the project.

This is because at different times, users in different subgroups can
create an experiment with the same name. If the directory has the
unix group of the initial experiment with that name, then any other future
experiment with that name but in a different subgroup will not be able
to write the directory.
parent 46cc4ef7
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -181,8 +181,20 @@ if (! -e $expinfo) {
if (! mkdir($expinfo, 0777)) {
fatal("Could not create $expinfo: $!");
}
if (! chowner($UID, $unix_gid, "$expinfo")) {
fatal("Could not chown $expinfo to $UID/$unix_gid: $!");
#
# expinfo dir should have the group ID of the primary project group.
# This is because at different times, users in different subgroups can
# create an experiment with the same name. If the directory has the
# group of the initial experiment with that name, then any other future
# experiment with that name but in a different subgroup will not be able
# to write the directory.
#
my $ugid = $unix_gid;
if ($pid ne $gid) {
$ugid = $group->GetProject()->unix_gid();
}
if (! chowner($UID, $ugid, "$expinfo")) {
fatal("Could not chown $expinfo to $UID/$ugid: $!");
}
}
......
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