4 ###############################################################################
5 ###############################################################################
6 ###############################################################################
8 # THIS SCRIPT IS PROBABLY BROKEN. REMOVING THE -T SWITCH ON THE #! LINE ABOVE
9 # WOULD FIX IT, BUT THIS IS INSECURE. WE RECOMMEND FIXING THE ERRORS WHICH THE
10 # -T SWITCH WILL CAUSE PERL TO REPORT BEFORE RUNNING THIS SCRIPT FROM A CVS
11 # SERVER TRIGGER. PLEASE SEND PATCHES CONTAINING THE CHANGES YOU FIND
12 # NECESSARY TO RUN THIS SCRIPT WITH THE TAINT-CHECKING ENABLED BACK TO THE
13 # <bug-cvs@gnu.org> MAILING LIST.
15 # For more on general Perl security and taint-checking, please try running the
16 # `perldoc perlsec' command.
18 ###############################################################################
19 ###############################################################################
20 ###############################################################################
22 # From: clyne@niwot.scd.ucar.EDU (John Clyne)
23 # Date: Fri, 28 Feb 92 09:54:21 MST
25 # BTW, i wrote a perl script that is similar to 'nfpipe' except that in
26 # addition to logging to a file it provides a command line option for mailing
27 # change notices to a group of users. Obviously you probably wouldn't want
28 # to mail every change. But there may be certain directories that are commonly
29 # accessed by a group of users who would benefit from an email notice.
30 # Especially if they regularly beat on the same directory. Anyway if you
31 # think anyone would be interested here it is.
36 # National Center for Atmospheric Research
37 # PO 3000, Boulder, Colorado
39 # Date: Wed Feb 26 18:34:53 MST 1992
41 # Description: Tee standard input to mail a list of users and to
42 # a file. Used by CVS logging.
44 # Usage: mfpipe [-f file] [user@host...]
46 # Environment: CVSROOT
53 # Capture output to 'file'
56 $header = "Log Message:\n";
58 $mailcmd = "| mail -s 'CVS update notice'";
64 $cvsroot = $ENV{'CVSROOT'};
73 $users = "$users $arg";
78 $mailcmd = "$mailcmd $users";
79 open(MAIL, $mailcmd) || die "Execing $mail: $!\n";
83 $logfile = "$cvsroot/LOG/$file";
84 open(FILE, ">> $logfile") || die "Opening $logfile: $!\n";
87 print FILE "$whoami $date--------BEGIN LOG ENTRY-------------\n" if ($logfile);
90 print FILE $log if ($log && $logfile);
92 print FILE $_ if ($logfile);
93 print MAIL $_ if ($users);
95 $log = "log: " if ($_ eq $header);
99 die "Write failed" if $?;
101 die "Mail failed" if $?;