Commit 5197ce4e authored by Leigh Stoller's avatar Leigh Stoller

Buch of changes to support pids and gids more then 12/16 characters.

Now the limit is pid=48 and gid=32.

Note that the FreeBSD clients croak on NFS mounts that are too long
(way shorter then MAXPATHLEN!). Sigh.
parent dc275b71
......@@ -320,24 +320,18 @@ if ($oldgroup) {
# The unix group name must be globally unique. Form a name and check it.
# Subgroup names have a project-name prefix, and a numeric suffix if needed.
#
my $unix_gname = substr($group_pid, 0, 3) . "-" . $group_id;
my $unix_gname = substr($group_pid, 0, 3) . "-" . substr($group_id, 0, 12);
my $maxtries = 99;
my $count = 0;
my $TBDB_UNIXGLEN = 16; # XXX Where should this be?
while ($count < $maxtries) {
if (length($unix_gname) > $TBDB_UNIXGLEN) {
UserError("GroupId: Unix group name $unix_gname is too long!");
}
my $query_result =
DBQueryFatal("select gid from groups where unix_name='$unix_gname'");
if (!$query_result->numrows) {
last;
}
last
if (!$query_result->numrows);
$count++;
$unix_gname = substr($group_pid, 0, 3) . "-" .
substr($group_id, 0, length($group_id) - 2) . "$count";
substr($group_id, 0, 10) . "$count";
}
if ($count == $maxtries) {
UserError("GroupId: Could not form a unique Unix group name!");
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -20,20 +20,21 @@ use POSIX ":sys_wait_h";
#
sub usage()
{
print "Usage: linktest.proxy [-d level] -u user -g gid -e pid/eid ".
print "Usage: linktest.proxy [-d level] -u user -p unix_pid -g unix_gid -e pid/eid ".
"-l level -o logfile -t timeout -r\n";
exit(-1);
}
my $optlist = "d:u:g:e:l:o:t:r";
my $optlist = "d:u:g:e:l:o:t:rp:";
my $debug = 0;
my $user;
my $gid;
my $pid;
my $eid;
my $level;
my $logfile;
my $timeout;
my $reportonly = 0;
my $unix_gid;
my $unix_pid;
#
# Configure variables
......@@ -80,14 +81,16 @@ if (@ARGV) {
}
if (! defined($options{"u"}) ||
! defined($options{"e"}) ||
! defined($options{"p"}) ||
! defined($options{"l"}) ||
! defined($options{"g"})) {
usage();
}
$user = $options{"u"};
$gid = $options{"g"};
$level = $options{"l"};
$user = $options{"u"};
$level = $options{"l"};
$unix_gname = $options{"g"};
$unix_pname = $options{"p"};
if ($options{"e"} =~ /^([-\w]*)\/([-\w]*)$/) {
$pid = $1;
......@@ -96,7 +99,6 @@ if ($options{"e"} =~ /^([-\w]*)\/([-\w]*)$/) {
else {
usage();
}
if (defined($options{"d"})) {
$debug = $options{"d"};
}
......@@ -118,13 +120,13 @@ my (undef,undef,$unix_uid) = getpwnam($user) or
die("*** $0:\n".
" No such user $user\n");
my (undef,undef,$unix_ggid) = getgrnam($gid) or
my (undef,undef,$unix_ggid) = getgrnam($unix_gname) or
die("*** $0:\n".
" No such group $gid\n");
" No such group $unix_gname\n");
my (undef,undef,$unix_pgid) = getgrnam($pid) or
my (undef,undef,$unix_pgid) = getgrnam($unix_pname) or
die("*** $0:\n".
" No such group $pid\n");
" No such group $unix_pname\n");
# Flip to user and never go back!
$GID = $unix_ggid;
......
#!/usr/bin/perl -wT
#
# 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;
......@@ -170,6 +170,8 @@ if (! $experiment->AccessCheck($this_user, TB_EXPT_DESTROY)) {
# Need the unix_gidname info to pass to ops.
my $unix_gidname = $experiment->GetGroup()->unix_name();
my $errlog = $experiment->UserDir() . "/logs/linktest.log";
my $project = $experiment->GetProject();
my $unix_pidname = $project->unix_name()
#
# Lets see if there is a linktest running already.
......@@ -325,6 +327,7 @@ push(@cmdargs, ("-t", "$timeout"))
push(@cmdargs, "-l");
push(@cmdargs, (defined($level) ? $level : $experiment->linktest_level()));
push(@cmdargs, ("-g", $unix_gidname));
push(@cmdargs, ("-p", $unix_pidname));
push(@cmdargs, ("-u", $dbuid));
push(@cmdargs, ("-e", "$pid/$eid"));
push(@cmdargs, ("-o", $errlog));
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2007 University of Utah and the Flux Group.
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -11,8 +11,8 @@
#define TBDB_FLEN_VNAME (32 + 1)
#define TBDB_FLEN_EID (32 + 1)
#define TBDB_FLEN_UID (8 + 1)
#define TBDB_FLEN_PID (12 + 1)
#define TBDB_FLEN_GID (16 + 1)
#define TBDB_FLEN_PID (48 + 1)
#define TBDB_FLEN_GID (32 + 1)
#define TBDB_FLEN_NODECLASS (10 + 1)
#define TBDB_FLEN_NODETYPE (30 + 1)
#define TBDB_FLEN_IP (16 + 1)
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005-2010 University of Utah and the Flux Group.
# Copyright (c) 2005-2011 University of Utah and the Flux Group.
# All rights reserved.
#
package Project;
......@@ -210,6 +210,7 @@ sub Update($$)
sub Create($$$$)
{
my ($class, $pid, $leader, $argref) = @_;
my $unix_gname = $pid;
#
# The array of inserts is assumed to be safe already. Generate
......@@ -219,8 +220,31 @@ sub Create($$$$)
map("$_=" . DBQuoteSpecial($argref->{$_}),
keys(%{$argref})));
# Form a proper unix group name, which is limited to 16 chars.
if (length($pid) > 16) {
$unix_gname = substr($pid, 0, 16);
my $maxtries = 9;
my $count = 0;
while ($count < $maxtries) {
my $query_result =
DBQueryFatal("select gid from groups ".
"where unix_name='$unix_gname'");
last
if (!$query_result->numrows);
$count++;
$unix_gname = substr($pid, 0, 15) . "$count";
}
if ($count == $maxtries) {
print STDERR "Project->Create: ".
"Could not form a unique Unix group name!";
return undef;
}
}
# First create the underlying default group for the project.
my $newgroup = Group->Create(undef, $pid, $leader, 'Default Group', $pid);
my $newgroup =
Group->Create(undef, $pid, $leader, 'Default Group', $unix_gname);
return undef
if (!defined($newgroup));
......
This diff is collapsed.
......@@ -726,9 +726,9 @@ REPLACE INTO table_regex VALUES ('experiments','sync_server','text','redirect','
REPLACE INTO table_regex VALUES ('groups','project','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('groups','pid_idx','text','redirect','projects:pid_idx',0,0,NULL);
REPLACE INTO table_regex VALUES ('groups','gid','text','regex','^[a-zA-Z][-\\w]+$',2,12,NULL);
REPLACE INTO table_regex VALUES ('groups','gid','text','regex','^[a-zA-Z][-\\w]+$',2,32,NULL);
REPLACE INTO table_regex VALUES ('groups','gid_idx','text','regex','^[\\d]+$',1,12,NULL);
REPLACE INTO table_regex VALUES ('groups','group_id','text','redirect','groups:gid',2,12,NULL);
REPLACE INTO table_regex VALUES ('groups','group_id','text','redirect','groups:gid',2,32,NULL);
REPLACE INTO table_regex VALUES ('groups','group_leader','text','redirect','users:uid',2,8,NULL);
REPLACE INTO table_regex VALUES ('groups','group_description','text','redirect','default:tinytext',0,256,NULL);
REPLACE INTO table_regex VALUES ('groups','change','text','regex','^permit$',0,0,NULL);
......@@ -742,7 +742,7 @@ REPLACE INTO table_regex VALUES ('nseconfigs','vname','text','redirect','virt_no
REPLACE INTO table_regex VALUES ('nseconfigs','nseconfig','text','regex','^[\\040-\\176\\012\\011\\015]*$',0,16777215,NULL);
REPLACE INTO table_regex VALUES ('projects','newuser_xml','text','regex','^[-_\\w\\.\\/:+]*$',1,256,NULL);
REPLACE INTO table_regex VALUES ('projects','newpid','text','regex','^[a-zA-Z][-a-zA-Z0-9]+$',2,12,NULL);
REPLACE INTO table_regex VALUES ('projects','newpid','text','regex','^[a-zA-Z][-a-zA-Z0-9]+$',2,48,NULL);
REPLACE INTO table_regex VALUES ('projects','head_uid','text','redirect','users:uid',0,0,NULL);
REPLACE INTO table_regex VALUES ('projects','name','text','redirect','default:tinytext',0,256,NULL);
REPLACE INTO table_regex VALUES ('projects','funders','text','redirect','default:tinytext',0,256,NULL);
......@@ -750,11 +750,10 @@ REPLACE INTO table_regex VALUES ('projects','public','int','redirect','default:t
REPLACE INTO table_regex VALUES ('projects','linked_to_us','int','redirect','default:tinyint',0,1,NULL);
REPLACE INTO table_regex VALUES ('projects','public_whynot','text','redirect','default:tinytext',0,256,NULL);
REPLACE INTO table_regex VALUES ('projects','default_user_interface','text','regex','^(emulab|plab)$',2,12,NULL);
REPLACE INTO table_regex VALUES ('projects','pid','text','regex','^[-\\w]+$',2,12,NULL);
REPLACE INTO table_regex VALUES ('projects','pid','text','regex','^[-\\w]+$',2,48,NULL);
REPLACE INTO table_regex VALUES ('projects','pid_idx','text','regex','^[\\d]+$',1,12,NULL);
REPLACE INTO table_regex VALUES ('projects','URL','text','redirect','default:tinytext',0,0,NULL);
REPLACE INTO table_regex VALUES ('reserved','vname','text','redirect','virt_nodes:vname',1,32,NULL);
REPLACE INTO table_regex VALUES ('users','uid','text','regex','^[a-zA-Z][\\w]+$',2,8,NULL);
REPLACE INTO table_regex VALUES ('users','uid_idx','text','regex','^[\\d]+$',1,12,NULL);
REPLACE INTO table_regex VALUES ('users','usr_phone','text','regex','^[-\\d\\(\\)\\+\\.x ]+$',7,64,NULL);
......
#
# Expand length of pid to 48, and gid to 32.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
my $force = 1;
my %pidtables1 = ("bridges" => "pid",
"delays" => "pid",
"linkdelays" => "pid",
"newdelays" => "pid",
"nodes" => "reserved_pid",
"switch_paths" => "pid",
"traces" => "pid",
"wireless_stats" => "data_pid");
my %pidtables2 = ("datapository_databases" => "pid",
"delta_proj" => "pid",
"elabinelab_attributes" => "pid",
"elabinelab_vlans" => "pid",
"event_groups" => "pid",
"eventlist" => "pid",
"experiment_blobs" => "pid",
"experiment_features" => "pid",
"experiment_stats" => "pid",
"experiment_template_inputs" => "pid",
"experiment_template_instance_bindings" => "pid",
"experiment_template_instances" => "pid",
"experiment_template_parameters" => "pid",
"experiment_template_settings" => "pid",
"experiment_templates" => "pid",
"experiments" => "pid",
"exppid_access" => "pid",
"firewall_rules" => "pid",
"firewalls" => "pid",
"group_features" => "pid",
"group_membership" => "pid",
"group_policies" => "pid",
"group_stats" => "pid",
"groups" => "pid",
"ifaces" => "pid",
"images" => "pid",
"ipport_ranges" => "pid",
"ipsubnets" => "pid",
"lans" => "pid",
"last_reservation" => "pid",
"motelogfiles" => "pid",
"next_reserve" => "pid",
"node_reservations" => "pid",
"nodetypeXpid_permissions" => "pid",
"nseconfigs" => "pid",
"nsfiles" => "pid",
"os_info" => "pid",
"partitions" => "imagepid",
"plab_slices" => "pid",
"port_registration" => "pid",
"portmap" => "pid",
"proj_memb" => "pid",
"project_stats" => "pid",
"projects" => "pid",
"reserved" => "pid",
"reserved_vlantags" => "pid",
"v2pmap" => "pid",
"virt_agents" => "pid",
"virt_blobs" => "pid",
"virt_bridges" => "pid",
"virt_client_service_ctl" => "pid",
"virt_client_service_hooks" => "pid",
"virt_client_service_opts" => "pid",
"virt_firewalls" => "pid",
"virt_lan_lans" => "pid",
"virt_lan_member_settings" => "pid",
"virt_lan_settings" => "pid",
"virt_lans" => "pid",
"virt_node_desires" => "pid",
"virt_node_motelog" => "pid",
"virt_node_startloc" => "pid",
"virt_nodes" => "pid",
"virt_parameters" => "pid",
"virt_paths" => "pid",
"virt_programs" => "pid",
"virt_routes" => "pid",
"virt_simnode_attributes" => "pid",
"virt_tiptunnels" => "pid",
"virt_trafgens" => "pid",
"virt_user_environment" => "pid",
"virt_vtypes" => "pid",
"vis_graphs" => "pid",
"vis_nodes" => "pid",
"vlans" => "pid");
my %pidtables3 = ("exppid_access" => "exp_pid",
"reserved" => "old_pid");
my %gidtables = ("datapository_databases" => "gid",
"experiment_stats" => "gid",
"experiment_templates" => "gid",
"experiments" => "gid",
"group_features" => "gid",
"group_membership" => "gid",
"group_policies" => "gid",
"group_stats" => "gid",
"groups" => "gid",
"images" => "gid",
"motelogfiles" => "gid",
"unixgroup_membership" => "gid");
foreach my $table (keys(%pidtables1)) {
my $slot = $pidtables1{$table};
my $type = DBSlotType($table, $slot);
if ($force || !($type =~ /48/)) {
DBQueryFatal("alter table `$table` modify `$slot` ".
" varchar(48) default NULL");
}
}
foreach my $table (keys(%pidtables2)) {
my $slot = $pidtables2{$table};
my $type = DBSlotType($table, $slot);
if ($force || !($type =~ /48/)) {
DBQueryFatal("alter table `$table` modify `$slot` ".
" varchar(48) NOT NULL default ''");
}
}
foreach my $table (keys(%pidtables3)) {
my $slot = $pidtables3{$table};
my $type = DBSlotType($table, $slot);
if ($force || !($type =~ /48/)) {
DBQueryFatal("alter table `$table` modify `$slot` ".
" varchar(48) NOT NULL default ''");
}
}
foreach my $table (keys(%gidtables)) {
my $slot = $gidtables{$table};
my $type = DBSlotType($table, $slot);
if ($force || !($type =~ /32/)) {
DBQueryFatal("alter table `$table` modify `$slot` ".
" varchar(32) NOT NULL default ''");
}
}
DBQueryFatal("REPLACE INTO table_regex VALUES ".
" ('projects','pid','text','regex','^[-\\\\w]+\$',2,48,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
" ('projects','newpid','text','regex', ".
" '^[a-zA-Z][-a-zA-Z0-9]+\$',2,48,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
" ('groups','gid','text','regex', ".
" '^[a-zA-Z][-\\\\w]+\$',2,32,NULL)");
DBQueryFatal("REPLACE INTO table_regex VALUES ".
" ('groups','group_id','text','redirect', ".
" 'groups:gid',2,32,NULL)");
return 0;
}
......@@ -25,13 +25,12 @@ sub usage()
"-l logfile -t record_file start|stop|replay\n";
exit(-1);
}
my $optlist = "u:e:k:dl:g:t:aN";
my $optlist = "u:e:k:dl:g:t:aNp:";
my $debug = 0;
my $runagent= 0;
my $user;
my $pid;
my $eid;
my $gid;
my $keyfile;
my $logfile;
my $recordfile;
......@@ -93,6 +92,7 @@ if (@ARGV != 1) {
if (! defined($options{"u"}) ||
! defined($options{"e"}) ||
! defined($options{"g"}) ||
! defined($options{"p"}) ||
! defined($options{"l"}) ||
! defined($options{"k"})) {
usage();
......@@ -114,7 +114,8 @@ if (defined($options{"N"})) {
$logfile = $options{"l"};
$keyfile = $options{"k"};
$user = $options{"u"};
$gid = $options{"g"};
$unix_gname = $options{"g"};
$unix_pname = $options{"p"};
$action = $ARGV[0];
if ($options{"e"} =~ /^([-\w]*)\/([-\w]*)$/) {
......@@ -198,13 +199,13 @@ my (undef,undef,$unix_uid) = getpwnam($user) or
die("*** $0:\n".
" No such user $user\n");
my (undef,undef,$unix_ggid) = getgrnam($gid) or
my (undef,undef,$unix_ggid) = getgrnam($unix_gname) or
die("*** $0:\n".
" No such group $gid\n");
" No such group $unix_gname\n");
my (undef,undef,$unix_pgid) = getgrnam($pid) or
my (undef,undef,$unix_pgid) = getgrnam($unix_pname) or
die("*** $0:\n".
" No such group $pid\n");
" No such group $unix_pname\n");
my $LOGDIR = `dirname $logfile`;
$LOGDIR =~ s/\s+$//;
......
......@@ -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.
#
......@@ -133,6 +133,7 @@ if (! $experiment) {
my $pid = $experiment->pid();
my $eid = $experiment->eid();
my $expstate = $experiment->state();
my $project = $experiment->GetProject();
#
# Check permission. Only people with permission to destroy the experiment
......@@ -209,6 +210,7 @@ $cmd .= " -t " . $experiment->UserDir() . "/logs/events"
$cmd .= " -l " . $experiment->UserDir() . "/logs/event-sched.log";
$cmd .= " -k " . $experiment->EventKeyPath();
$cmd .= " -g " . $group->unix_name();
$cmd .= " -p " . $project->unix_name();
$cmd .= " -e $pid/$eid";
$cmd .= " -u $user_uid";
$cmd .= " $action";
......
#!/usr/bin/perl -wT
#
# 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;
......@@ -290,11 +290,13 @@ $EUID = 0;
#
# This acts as check (and we need the numeric uid) in case mkacct failed!
#
#
my $unix_name = $target_project->unix_name();
my (undef,undef,$uid) = getpwnam($leader_uid)
or fatal("$leader_uid not in passwd file");
my (undef,undef,$gid) = getgrnam($pid)
my (undef,undef,$gid) = getgrnam($unix_name)
or fatal("$pid not in group file");
#
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005, 2006 University of Utah and the Flux Group.
# Copyright (c) 2005-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -37,6 +37,7 @@ use lib "@prefix@/lib";
use libaudit;
use libdb;
use libtestbed;
use Project;
#
# We have to run this script as root.
......@@ -52,10 +53,18 @@ if (! $CVSSUPPORT) {
}
my $query_result =
DBQueryFatal("select pid,head_uid from projects");
DBQueryFatal("select pid_idx from projects");
my $PROJROOT = PROJROOT();
while (my ($pid,$projhead) = $query_result->fetchrow_array()) {
while (my ($pid_idx) = $query_result->fetchrow_array()) {
my $project = Project->Lookup($pid_idx);
next
if (!defined($project));
my $pid = $project->pid();
my $projhead = $project->head_uid();
my $unix_name = $project->unix_name();
next
if (! -d "$PROJROOT/$pid");
......@@ -67,8 +76,8 @@ while (my ($pid,$projhead) = $query_result->fetchrow_array()) {
my (undef,undef,$uid) = getpwnam($projhead)
or fatal("$projhead not in passwd file");
my (undef,undef,$gid) = getgrnam($pid)
or fatal("$pid not in group file");
my (undef,undef,$gid) = getgrnam($unix_name)
or fatal("$unix_name not in group file");
if (! -e $CVSDIR) {
if (! mkdir("$CVSDIR", 0770)) {
......
......@@ -446,7 +446,8 @@ if (isset($formfields["exp_linktest"]) && $formfields["exp_linktest"] != "") {
#
# Grab the unix GID for running scripts.
#
$unix_gid = $group->unix_gid();
$unix_pgid = $project->unix_gid();
$unix_ggid = $group->unix_gid();
#
# Run the backend script.
......@@ -455,7 +456,7 @@ $unix_gid = $group->unix_gid();
#
set_time_limit(0);
$retval = SUEXEC($uid, "$exp_pid,$unix_gid" . $extragroups ,
$retval = SUEXEC($uid, "$unix_pgid,$unix_ggid" . $extragroups ,
"webbatchexp $batcharg -E $exp_desc $exp_swappable ".
"$linktestarg -p $exp_pid -g $exp_gid -e $exp_id ".
($nonsfile ? "" : "$thensfile"),
......
......@@ -20,8 +20,10 @@ $NODERELOADPENDING_EID = "reloadpending";
# All these constants need to go at some point, replaced by data from
# the regex table.
$TBDB_UIDLEN = 8;
$TBDB_PIDLEN = 12;
$TBDB_GIDLEN = 12;
# These are both shorter then the DB lengths, but since some images croak
# on very long mount point names, we keep them short via this interface.
$TBDB_PIDLEN = 16;
$TBDB_GIDLEN = 16;
$TBDB_UNIXGLEN = 16;
$TBDB_NODEIDLEN = 10;
$TBDB_PHONELEN = 32;
......
<?php
#
# 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.
#
include("defs.php3");
......@@ -25,7 +25,9 @@ $pid = $experiment->pid();
$eid = $experiment->eid();
$gid = $experiment->gid();
$state = $experiment->state();
$unix_gid = $experiment->UnixGID();
$unix_ggid= $experiment->UnixGID();
$project = $experiment->Project();
$unix_pgid= $project->unix_gid();
#
# Standard Testbed Header
......@@ -641,7 +643,7 @@ foreach ($changes as $lan => $foo) {
}
}
if (! ($result = ChangeDelayConfig($uid, $pid, $unix_gid,
if (! ($result = ChangeDelayConfig($uid, $unix_pgid, $unix_ggid,
$args, $errors))) {
# Always respit the form so that the form fields are not lost.
# I just hate it when that happens so lets not be guilty of it ourselves.
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -25,6 +25,8 @@ $optargs = OptionalPageArguments("canceled", PAGEARG_BOOLEAN,
$imageid = $image->imageid();
$imagename = $image->imagename();
$pid = $image->pid();
$project = $image->Project();
$unix_pgid = $project->unix_gid();
#
# Verify permission.
......@@ -94,7 +96,8 @@ if (!isset($confirmed)) {
#
STARTBUSY("Removing imageid");
$retval = SUEXEC($uid, $pid, "webfrisbeekiller $imageid", SUEXEC_ACTION_DIE);
$retval = SUEXEC($uid, $unix_pgid,
"webfrisbeekiller $imageid", SUEXEC_ACTION_DIE);
DBQueryFatal("lock tables images write, os_info write, osidtoimageid write");
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -102,6 +102,8 @@ flush();
# We need the unix gid for the project for running the scripts below.
#
$unix_gid = $experiment->UnixGID();
$project = $experiment->Project();
$unix_pid = $project->unix_gid();
if ($instance) {
$guid = $instance->guid();
......@@ -118,7 +120,7 @@ STARTBUSY("Terminating " . ($instance ? "Instance." : "Experiment."));
#
# Run the backend script.
#
$retval = SUEXEC($uid, "$pid,$unix_gid", $command, SUEXEC_ACTION_IGNORE);
$retval = SUEXEC($uid, "$unix_pid,$unix_gid", $command, SUEXEC_ACTION_IGNORE);
HIDEBUSY();
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -34,6 +34,8 @@ $eid = $experiment->eid();
$gid = $experiment->gid();
$expstate = $experiment->state();
$unix_gid = $experiment->UnixGID();
$project = $experiment->Project();
$unix_pid = $project->unix_gid();
if (strcmp($expstate, $TB_EXPTSTATE_ACTIVE) &&
strcmp($expstate, $TB_EXPTSTATE_SWAPPED)) {
......@@ -159,7 +161,7 @@ if (strcmp($mode, "record") == 0) {
ignore_user_abort(1);
# Start the script and pipe its output to the user.
$fp = popen("$TBSUEXEC_PATH $uid $pid,$unix_gid webfeedback ".
$fp = popen("$TBSUEXEC_PATH $uid $unix_pid,$unix_gid webfeedback ".
"-d $duration $pid $gid $eid", "r");
if (! $fp) {
USERERROR("Feedback failed!", 1);
......@@ -197,7 +199,7 @@ else if (strcmp($mode, "clear") == 0) {
if (isset($clear_bootstrap) && !strcmp($clear_bootstrap, "1"))
$options .= " -b";
if ($options != "") {
$retval = SUEXEC($uid, "$pid,$unix_gid",
$retval = SUEXEC($uid, "$unix_pid,$unix_gid",
"webfeedback $options $pid $gid $eid",
SUEXEC_ACTION_USERERROR);
......@@ -220,7 +222,7 @@ else if (strcmp($mode, "clear") == 0) {
fclose($fp);
chmod($nsfile, 0666);
$retval = SUEXEC($uid, "$pid,$unix_gid",
$retval = SUEXEC($uid, "$unix_pid,$unix_gid",
"webswapexp " . ($reboot ? "-r " : "") .
($eventrestart ? "-e " : "") .
"-s modify $pid $eid $nsfile",
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005, 2006, 2007 University of Utah and the Flux Group.
# Copyright (c) 2005-2011 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -25,6 +25,8 @@ $optargs = OptionalPageArguments("vnode", PAGEARG_STRING);
$pid = $experiment->pid();
$eid = $experiment->eid();
$unix_gid = $experiment->UnixGID();
$project = $experiment->Project();
$unix_pid = $project->unix_gid();
if (!$experiment->AccessCheck($this_user, $TB_EXPT_MODIFY)) {
USERERROR("You do not have permission to run linktest on $pid/$eid!", 1);
......@@ -81,7 +83,7 @@ $cmd = "weblinkmon_ctl " .
((isset($vnode) ? "-s $vnode " : "")) .
"$pid $eid $linklan $action";
$retval = SUEXEC($uid, "$pid,$unix_gid", $cmd, SUEXEC_ACTION_IGNORE);
$retval = SUEXEC($uid, "$unix_pid,$unix_gid", $cmd, SUEXEC_ACTION_IGNORE);
if ($retval) {
# Ug, I know this hardwired return value is bad!
if ($retval == 2) {
......