4 # Copyright (C) 1994-2005 The Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 ###############################################################################
17 ###############################################################################
18 ###############################################################################
20 # THIS SCRIPT IS PROBABLY BROKEN. REMOVING THE -T SWITCH ON THE #! LINE ABOVE
21 # WOULD FIX IT, BUT THIS IS INSECURE. WE RECOMMEND FIXING THE ERRORS WHICH THE
22 # -T SWITCH WILL CAUSE PERL TO REPORT BEFORE RUNNING THIS SCRIPT FROM A CVS
23 # SERVER TRIGGER. PLEASE SEND PATCHES CONTAINING THE CHANGES YOU FIND
24 # NECESSARY TO RUN THIS SCRIPT WITH THE TAINT-CHECKING ENABLED BACK TO THE
25 # <@PACKAGE_BUGREPORT@> MAILING LIST.
27 # For more on general Perl security and taint-checking, please try running the
28 # `perldoc perlsec' command.
30 ###############################################################################
31 ###############################################################################
32 ###############################################################################
34 # From: clyne@niwot.scd.ucar.EDU (John Clyne)
35 # Date: Fri, 28 Feb 92 09:54:21 MST
37 # BTW, i wrote a perl script that is similar to 'nfpipe' except that in
38 # addition to logging to a file it provides a command line option for mailing
39 # change notices to a group of users. Obviously you probably wouldn't want
40 # to mail every change. But there may be certain directories that are commonly
41 # accessed by a group of users who would benefit from an email notice.
42 # Especially if they regularly beat on the same directory. Anyway if you
43 # think anyone would be interested here it is.
48 # National Center for Atmospheric Research
49 # PO 3000, Boulder, Colorado
51 # Date: Wed Feb 26 18:34:53 MST 1992
53 # Description: Tee standard input to mail a list of users and to
54 # a file. Used by CVS logging.
56 # Usage: mfpipe [-f file] [user@host...]
58 # Environment: CVSROOT
65 # Capture output to 'file'
68 $header = "Log Message:\n";
70 $mailcmd = "| mail -s 'CVS update notice'";
76 $cvsroot = $ENV{'CVSROOT'};
85 $users = "$users $arg";
90 $mailcmd = "$mailcmd $users";
91 open(MAIL, $mailcmd) || die "Execing $mail: $!\n";
95 $logfile = "$cvsroot/LOG/$file";
96 open(FILE, ">> $logfile") || die "Opening $logfile: $!\n";
99 print FILE "$whoami $date--------BEGIN LOG ENTRY-------------\n" if ($logfile);
102 print FILE $log if ($log && $logfile);
104 print FILE $_ if ($logfile);
105 print MAIL $_ if ($users);
107 $log = "log: " if ($_ eq $header);
111 die "Write failed" if $?;
113 die "Mail failed" if $?;