Commit de00bc49 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Fix owner/perm problem; The parser command is invoked as root, which

leaves a root owned, 664 file in the work directory. Insead, touch the
file before flipping to root, and append to it (file is always removed
first).
parent b06015e7
......@@ -171,6 +171,18 @@ GenDefsFile($infile);
system("cat $nsfile >> $infile") == 0
or die("Could not combine TCL defs file and the NS file!\n");
#
# Touch the output file, to avoid a root owned, 644 file.
#
if (-e $outfile) {
unlink($outfile) or
die("*** $0:\n".
" Could not unlink $outfile\n");
}
system("touch $outfile") == 0 or
die("*** $0:\n".
" Could not create $outfile\n");
#
# Build up a new command line to run the parser on ops, writing the
# result back to a file if not in anonmode. Remember to tack on the
......@@ -198,7 +210,7 @@ if ($TESTMODE) {
#
# In testmode, no ssh. Just run locally.
#
system("$cmdargs < $infile > $outfile");
system("$cmdargs < $infile >> $outfile");
}
else {
#
......@@ -206,7 +218,7 @@ else {
# back afterwards.
#
$EUID = $UID = 0;
system("sshtb -host $CONTROL $cmdargs < $infile > $outfile");
system("sshtb -host $CONTROL $cmdargs < $infile >> $outfile");
$EUID = $UID = $SAVEUID;
}
......
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