commit_logmsg.in 616 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2006, 2007 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
use strict;
use Getopt::Std;

# un-taint path
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};

#print "Log: @ARGV\n";

#
# Simply record the log message for later.
#
my $id = getpgrp();
my $logfile  = shift(@ARGV);
my $filename = "/tmp/#cvs.logmsg.${id}";
my $docommit = "/tmp/#cvs.docommit.${id}";

if (-e $docommit) {
    system("cp -p $logfile $filename") == 0
	or die("Could not copy $logfile $filename!\n");
}
exit(0);