All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 1feeef0c authored by Leigh B. Stoller's avatar Leigh B. Stoller

Swap rmprojdir for rmproj, which also removes the group from the

group file so that we do not get gid reuse (the DB will reuse numbers
that have been deallocated).
parent 2d04d705
...@@ -929,7 +929,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -929,7 +929,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
security/GNUmakefile security/paperbag \ security/GNUmakefile security/paperbag \
tbsetup/GNUmakefile tbsetup/console_setup tbsetup/mkacct-ctrl \ tbsetup/GNUmakefile tbsetup/console_setup tbsetup/mkacct-ctrl \
tbsetup/os_load tbsetup/os_setup tbsetup/mkprojdir tbsetup/power \ tbsetup/os_load tbsetup/os_setup tbsetup/mkprojdir tbsetup/power \
tbsetup/resetvlans tbsetup/rmacct-ctrl tbsetup/rmprojdir \ tbsetup/resetvlans tbsetup/rmacct-ctrl tbsetup/rmproj \
tbsetup/sched_reload tbsetup/tbdoit tbsetup/tbstopit \ tbsetup/sched_reload tbsetup/tbdoit tbsetup/tbstopit \
tbsetup/ir/GNUmakefile tbsetup/ir/postassign tbsetup/snmpit \ tbsetup/ir/GNUmakefile tbsetup/ir/postassign tbsetup/snmpit \
tbsetup/ir/assign_wrapper tbsetup/ns2ir/GNUmakefile \ tbsetup/ir/assign_wrapper tbsetup/ns2ir/GNUmakefile \
......
...@@ -95,7 +95,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -95,7 +95,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
security/GNUmakefile security/paperbag \ security/GNUmakefile security/paperbag \
tbsetup/GNUmakefile tbsetup/console_setup tbsetup/mkacct-ctrl \ tbsetup/GNUmakefile tbsetup/console_setup tbsetup/mkacct-ctrl \
tbsetup/os_load tbsetup/os_setup tbsetup/mkprojdir tbsetup/power \ tbsetup/os_load tbsetup/os_setup tbsetup/mkprojdir tbsetup/power \
tbsetup/resetvlans tbsetup/rmacct-ctrl tbsetup/rmprojdir \ tbsetup/resetvlans tbsetup/rmacct-ctrl tbsetup/rmproj \
tbsetup/sched_reload tbsetup/tbdoit tbsetup/tbstopit \ tbsetup/sched_reload tbsetup/tbdoit tbsetup/tbstopit \
tbsetup/ir/GNUmakefile tbsetup/ir/postassign tbsetup/snmpit \ tbsetup/ir/GNUmakefile tbsetup/ir/postassign tbsetup/snmpit \
tbsetup/ir/assign_wrapper tbsetup/ns2ir/GNUmakefile \ tbsetup/ir/assign_wrapper tbsetup/ns2ir/GNUmakefile \
......
...@@ -15,7 +15,7 @@ BIN_STUFF = power snmpit tbend tbrun tbprerun tbreport \ ...@@ -15,7 +15,7 @@ BIN_STUFF = power snmpit tbend tbrun tbprerun tbreport \
SBIN_STUFF = resetvlans savevlans console_setup.proxy sched_reload SBIN_STUFF = resetvlans savevlans console_setup.proxy sched_reload
LIBEXEC_STUFF = mkprojdir rmprojdir mkacct-ctrl rmacct-ctrl \ LIBEXEC_STUFF = mkprojdir rmproj mkacct-ctrl rmacct-ctrl \
os_setup mkexpdir tbdoit tbstopit console_setup os_setup mkexpdir tbdoit tbstopit console_setup
LIB_STUFF = libtbsetup.pm LIB_STUFF = libtbsetup.pm
...@@ -59,8 +59,8 @@ post-install: ...@@ -59,8 +59,8 @@ post-install:
chmod 775 $(INSTALL_LIBEXECDIR) chmod 775 $(INSTALL_LIBEXECDIR)
chown root $(INSTALL_LIBEXECDIR)/mkprojdir chown root $(INSTALL_LIBEXECDIR)/mkprojdir
chmod u+s $(INSTALL_LIBEXECDIR)/mkprojdir chmod u+s $(INSTALL_LIBEXECDIR)/mkprojdir
chown root $(INSTALL_LIBEXECDIR)/rmprojdir chown root $(INSTALL_LIBEXECDIR)/rmproj
chmod u+s $(INSTALL_LIBEXECDIR)/rmprojdir chmod u+s $(INSTALL_LIBEXECDIR)/rmproj
chown root $(INSTALL_LIBEXECDIR)/mkacct-ctrl chown root $(INSTALL_LIBEXECDIR)/mkacct-ctrl
chmod u+s $(INSTALL_LIBEXECDIR)/mkacct-ctrl chmod u+s $(INSTALL_LIBEXECDIR)/mkacct-ctrl
chown root $(INSTALL_LIBEXECDIR)/rmacct-ctrl chown root $(INSTALL_LIBEXECDIR)/rmacct-ctrl
......
...@@ -3,13 +3,14 @@ use Mysql; ...@@ -3,13 +3,14 @@ use Mysql;
use English; use English;
# #
# Remove a project directory hierarchy. Actually, the project directory # Remove a project. We delete the project directory hierarchy and the
# we remove the group from /etc/group. Actually, the project directory
# is *renamed* from $pid to $pid-`date +20%y%m%d-%H.%M.%S` since we do # is *renamed* from $pid to $pid-`date +20%y%m%d-%H.%M.%S` since we do
# not want to be so destructive. # not want to be so destructive.
# #
# usage: rmprojdir <pid> # usage: rmprojdir <pid>
# #
# TODO: Allow for the head of a project delete it. # TODO: Allow for the head of a project to delete it.
# #
# #
...@@ -25,6 +26,7 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; ...@@ -25,6 +26,7 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
my $PROJROOT = "/proj"; my $PROJROOT = "/proj";
my $dbh = Mysql->connect("localhost",$DBNAME,"script","none"); my $dbh = Mysql->connect("localhost",$DBNAME,"script","none");
my $db_result= ""; my $db_result= "";
my $control_node = "plastic";
# #
# Check args. # Check args.
...@@ -96,5 +98,36 @@ if (! rename($pid, $newname)) { ...@@ -96,5 +98,36 @@ if (! rename($pid, $newname)) {
exit(-1); exit(-1);
} }
#
# Chown the owner/group to root and set the permissions so no one is
# allowed to look inside.
#
if (! chmod(0700, $newname)) {
print STDOUT "Could not chmod directory $newname to 0700: $!\n";
exit(-1);
}
if (! chown(0, 0, $newname)) {
print STDOUT "Could not chown directory $newname to 0/0: $!\n";
exit(-1);
}
#
# Now remove the group from the group file on both plastic and paper.
#
if (system("/usr/sbin/pw groupdel $pid")) {
print STDOUT "Could not remove group $pid fron operatons node (paper)\n";
exit(-1);
}
#
# Be real root for ssh.
#
$UID = 0;
if (system("/usr/local/bin/sshtb $control_node /usr/sbin/pw groupdel $pid")) {
print STDOUT "Could not remove group $pid fron control node (plastic)\n";
exit(-1);
}
exit(0); exit(0);
...@@ -115,8 +115,8 @@ if (system("$tbdir/tbrun $project $eid $irfile") != 0) { ...@@ -115,8 +115,8 @@ if (system("$tbdir/tbrun $project $eid $irfile") != 0) {
fatal(); fatal();
} }
print STDOUT "Running tbreport with arguments: -v $irfile 2>&1 > $repfile\n"; print STDOUT "Running tbreport with arguments: -v $project $eid $irfile 2>&1 > $repfile\n";
if (system("$tbdir/tbreport -v $irfile 2>&1 > $repfile") != 0) { if (system("$tbdir/tbreport -v $project $eid $irfile 2>&1 > $repfile") != 0) {
print STDOUT "tbreport failed!\n"; print STDOUT "tbreport failed!\n";
dumplog(); dumplog();
tbendit(); tbendit();
......
...@@ -28,8 +28,4 @@ FILES += $(wildcard $(SRCDIR)/*.php3) ...@@ -28,8 +28,4 @@ FILES += $(wildcard $(SRCDIR)/*.php3)
# #
ALLFILES = $(notdir $(FILES)) ALLFILES = $(notdir $(FILES))
# install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES))
# Do not install by default
#
install:
real-install: $(addprefix $(INSTALL_WWWDIR)/, $(ALLFILES))
...@@ -133,7 +133,7 @@ if (! $query_result) { ...@@ -133,7 +133,7 @@ if (! $query_result) {
# #
# Remove the project directory. # Remove the project directory.
# #
SUEXEC($uid, "flux", "rmprojdir $pid", 0); SUEXEC($uid, "flux", "rmproj $pid", 0);
# #
# Warm fuzzies. # Warm fuzzies.
......
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