Great Circle Associates Majordomo-Workers
(November 1996)
 

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

Subject: patch 1.94.1, try #2
From: Chan Wilson <cwilson @ slurp . neu . sgi . com>
Date: Wed, 27 Nov 1996 21:05:47 +0100
To: majordomo-workers @ greatcircle . com

Okay, lets try this again.  I've got to head home before the snow gets
any deeper, so no changelog, but I've basically rolled in the changes
that Dave (both of 'em), Jason, and Jerry noted.  

I've reworked the Makefile yet again, this time to completely use
install.sh and a couple other tweaks.

Apply the below patch, and then move digest and archive2.pl from the
contrib directory to the install directory:

	mv contrib/{digest,archive2.pl} .

and put the second included file (install.sh) into your install
directory as well.  Else it just won't work.

I'll stick these up on the ftp server tomorrow or later tonight.
diff -u ./.cvsignore ../majordomo-1.94.1/.cvsignore
--- ./.cvsignore	Wed Nov 27 20:58:13 1996
+++ ../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	Wed Nov 27 20:58:13 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	Wed Nov 27 20:58:13 1996
+++ ../majordomo-1.94.1/Makefile	Wed Nov 27 20:45:40 1996
@@ -1,9 +1,9 @@
-#$Modified: Sun Oct 20 15:22:53 1996 by cwilson $
+#$Modified: Wed Nov 27 19:33:45 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.54 $
+# $Date: 1996/11/27 19:45:40 $
+# $Header: /sources/cvsrepos/majordomo/Makefile,v 1.54 1996/11/27 19:45:40 cwilson Exp $
 # 
 
 #  This is the Makefile for Majordomo.  
@@ -10,34 +10,52 @@
 # 
 #-------------  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)
+ 
+# Put the location of your Perl binary here:
+PERL = /bin/perl
+ 
+# Where do you want Majordomo to be installed?  This CANNOT be the
+# current directory (where you unpacked the distribution)
+W_HOME = /usr/test/majordomo-$(VERSION)
+ 
+# Where do you want man pages to be installed?
+MAN = $(W_HOME)/man
+ 
+# 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
+ 
+# These set the permissions for all installed files and executables (except
+# the wrapper), respectively.  Some sites may wish to make these more
+# lenient, or more restrictive.
+# respectively.
+FILE_MODE = 644
+EXEC_MODE = 755
+HOME_MODE = 751
+
+# 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_OWNER = root
+WRAPPER_GROUP = $(W_GROUP)
+WRAPPER_MODE = 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_OWNER = $(W_USER)
+# WRAPPER_GROUP = $(W_GROUP)
+# WRAPPER_CHMOD = 6755
+# POSIX = 
 
-# 
-# Where do you want the manual pages installed?  By default, this is 
-# $(W_HOME)/man/man[18]
+# 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
+# MTAs require certain group memberships before allowing the message sender
+# to be set arbitrarily.
 #
-W_MAN = $(W_HOME)/man
-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
+# MAIL_GID = 	numeric_gid_of_MTA
 
 # 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
@@ -44,76 +62,39 @@
 # 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)
+W_MAJORDOMO_CF =	$(W_HOME)/majordomo.cf
 
-# ARCHCMD=`arch`
-# ARCHCMD=`uname -m`
+# a directory for temp files..
 
-#------------- 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
-
-POSIX = -DPOSIX_UID=$(W_USER) -DPOSIX_GID=$(W_GROUP)
-
-# 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
-# MTAs require certain group memberships before allowing the message sender
-# to be set arbitrarily.
-#
-# MAIL_GID = 	numeric_gid_of_MTA
-
+TMPDIR = /usr/tmp
 
 #--------YOU SHOULDN'T HAVE TO CHANGE ANYTHING BELOW THIS LINE.-------------
 
-VERSION =	1.94
+VERSION =	1.94.1
 
-WRAPPER_FLAGS = -DBIN=\"$(W_BIN)\" -DPATH=\"PATH=$(W_PATH)\" \
-	-DHOME=\"HOME=$(W_HOME)\" -DSHELL=\"SHELL=$(W_SHELL)\" \
+# For those stupid machines that try to use csh. Doh!
+SHELL = /bin/sh
+
+WRAPPER_FLAGS = -DBIN=\"$(W_HOME)\" -DPATH=\"PATH=$(W_PATH)\" \
+	-DHOME=\"HOME=$(W_HOME)\" -DSHELL=\"SHELL=$(SHELL)\" \
 	-DMAJORDOMO_CF=\"MAJORDOMO_CF=$(W_MAJORDOMO_CF)\"      \
 	$(POSIX)
 
-# For those stupid machines that try to use csh. Doh!
-SHELL = /bin/sh
+INSTALL = ./install.sh
 
-TOOLS =		archive2.pl archive.pl archive_mh.pl \
+TMP = $(TMPDIR)/mj-install-$(VERSION)
+
+TOOLS =		 archive.pl archive_mh.pl \
 		digest.send makeindex.pl \
-		logsummary.pl new-list sequencer digest
+		logsummary.pl new-list sequencer 
 
 BINBIN =	approve bounce medit
 
 BIN = 		bounce-remind config_parse.pl majordomo majordomo.pl \
 		majordomo_version.pl request-answer resend \
-		shlock.pl config-test 
+		shlock.pl config-test archive2.pl digest
+
+INSTALL_FLAGS = -o $(W_USER) -g $(W_GROUP)
 
 default: 
 	@echo "make what?"
@@ -136,10 +117,8 @@
 
 
 install-wrapper: wrapper
-	@echo "Installing wrapper in $(W_BIN), owner/group $(WRAPPER_CHOWN), perms $(WRAPPER_CHMOD)"
-	@cp wrapper       $(W_BIN)/wrapper
-	$(CHOWN) $(WRAPPER_CHOWN) $(W_BIN)/wrapper
-	chmod $(WRAPPER_CHMOD) $(W_BIN)/wrapper
+	$(INSTALL) -o $(WRAPPER_OWNER) -g $(WRAPPER_GROUP) \
+		-m $(WRAPPER_MODE) wrapper $(W_HOME)/wrapper
 	@echo ""
 	@echo "To verify that all the permissions and etc are correct,"
 	@echo "run the command"
@@ -154,118 +133,84 @@
 	@echo "Testing for perl ($(PERL))..."
 	@test -x $(PERL) || \
 		{ echo "You didn't correctly tell me where Perl is."; exit 1; } 
-	@test -d tmp || mkdir tmp
+	@rm -rf $(TMP); mkdir $(TMP)
 	@echo "Configuring scripts..."
-	@-for file in $(TOOLS); do \
-		cp contrib/$$file tmp ; \
+	@for file in $(TOOLS); do \
+		cp contrib/$$file $(TMP) ; \
 	done
-	@cp $(BINBIN) $(BIN) tmp
-	@cd tmp;	$(PERL) -p -i -e 's@^#!\S+perl.*@#!$(PERL)@' $(TOOLS) $(BINBIN) $(BIN) 
+	@cp $(BINBIN) $(BIN) $(TMP)
+	@cd $(TMP);	$(PERL) -p -i -e 's@^#!\S+perl.*@#!$(PERL)@' $(TOOLS) $(BINBIN) $(BIN) 
 
 
 install-scripts: config-scripts
-	@test -d $(W_HOME) || (mkdir $(W_HOME); chmod 750 $(W_HOME))
-	@-$(CHOWN) $(W_CHOWN) $(W_HOME) || \
-		( echo ""; \
-		  echo "Hmmm, if $(W_HOME) doesn't have an owner and group of"; \
-		  echo "	$(W_USER) $(W_GROUP), do a ";\
-		  echo "" ; \
-		  echo "	$(CHOWN) $(W_CHOWN) $(W_HOME)"; \
-		  echo "(as root.)"; \
-		ls -lLnd $(W_HOME); echo "")
-	@test -d $(W_BIN)/bin || (mkdir $(W_BIN)/bin; \
-		$(CHOWN) $(W_CHOWN) $(W_BIN)/bin)
+	$(INSTALL) -m $(HOME_MODE) $(INSTALL_FLAGS) . $(W_HOME)
+	$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) . $(W_HOME)/bin
 
-	@echo "Copying tools to $(W_BIN)/bin"
+	@echo "Copying tools to $(W_HOME)/bin"
 
 	@for file in $(BINBIN); do \
-		chmod +x tmp/$$file ; \
-		rm -f $(W_BIN)/bin/$$file; \
-		mv tmp/$$file $(W_BIN)/bin ; \
-		$(CHOWN) $(W_CHOWN) $(W_BIN)/bin/$$file ; \
+		$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) \
+			$$file $(W_HOME)/bin/$$file; \
 	done
 
-	@echo "Copying Majordomo files to $(W_BIN)"
+	@echo "Copying Majordomo files to $(W_HOME)"
 
 	@for file in $(BIN); do \
-		chmod +x tmp/$$file ; \
-		rm -f $(W_BIN)/$$file ; \
-		mv tmp/$$file $(W_BIN) ; \
-		$(CHOWN) $(W_CHOWN) $(W_BIN)/$$file ; \
+		$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) \
+			$$file $(W_HOME)/$$file; \
 	done
 
-	@echo "Copying archiving and other tools to $(W_BIN)/Tools"
+	@echo "Copying archiving and other tools to $(W_HOME)/Tools"
 
-	@test -d $(W_BIN)/Tools || (mkdir $(W_BIN)/Tools; \
-		$(CHOWN) $(W_CHOWN) $(W_BIN)/Tools)
+	$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) . $(W_HOME)/Tools
+
 	@for file in $(TOOLS); do \
-		chmod +x tmp/$$file ; \
-		rm -f $(W_BIN)/Tools/$$file ; \
-		mv tmp/$$file $(W_BIN)/Tools ; \
-		$(CHOWN) $(W_CHOWN) $(W_BIN)/Tools/$$file ; \
+		$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) \
+			contrib/$$file $(W_HOME)/Tools/$$file; \
 	done
 
-	@rm -rf tmp	
+	@rm -rf $(TMP)	
 
-# the install.cf target will install the sample config file in the
-# proper place unless a majordomo.cf file exists in which case the
-# majordomo.cf file will be used.
-# but now it won't overwrite an existing majordomo.cf file.
+# the install.cf target will install the sample config file in the proper
+# place unless a majordomo.cf file exists, in which case the majordomo.cf
+# file will be used. It won't overwrite an existing majordomo.cf file.  In
+# all cases, the sample.cf file must be installed so that config-test will
+# be able to check for new variables.
 install-cf:
-	@if [ ! -f $(W_BIN)/majordomo.cf ]; \
+	@if [ ! -f $(W_HOME)/majordomo.cf ]; \
 	  then \
 	    if [ -f majordomo.cf ]; \
 	      then \
 		echo "Using majordomo.cf"; \
-	  	cp majordomo.cf $(W_BIN)/majordomo.cf; \
+	  	$(INSTALL) -m $(FILE_MODE) $(INSTALL_FLAGS) \
+			majordomo.cf $(W_HOME)/majordomo.cf; \
 	      else \
 		echo "Using sample.cf"; \
-		cp sample.cf $(W_BIN)/majordomo.cf; \
+		$(INSTALL) -m $(FILE_MODE) $(INSTALL_FLAGS) \
+			sample.cf $(W_HOME)/majordomo.cf; \
 	    fi; \
 	else \
 	   echo "Using installed majordomo.cf"; \
 	fi;
-	@-rm -f $(W_BIN)/sample.cf; cp sample.cf $(W_BIN); \
-		$(CHOWN) $(W_CHOWN) $(W_BIN)/sample.cf
-	@-$(CHOWN) $(W_CHOWN) $(W_BIN)/majordomo.cf  || \
-		( echo ""; \
-		  echo "Hmmm, if $(W_HOME) doesn't have an owner and group of"; \
-		  echo "	$(W_USER) $(W_GROUP), do a "; \
-		  echo ""; \
-		  echo "	$(CHOWN) $(W_CHOWN) $(W_HOME)" ; \
-		  echo "(as root.)"; \
-		ls -lLnd $(W_HOME); echo "")
-
+	@$(INSTALL) -m $(FILE_MODE) $(INSTALL_FLAGS) \
+		sample.cf $(W_HOME)
 
 install-man:
-	@echo "Copying manual pages to $(MAN1) and $(MAN8)"
-	@test -w $(W_MAN) || (mkdir $(W_MAN); \
-		$(CHOWN) $(W_CHOWN) $(W_MAN) )
-	@test -w $(MAN1) || (mkdir $(MAN1); \
-		$(CHOWN) $(W_CHOWN) $(MAN1) )
-	@test -w $(MAN8) || (mkdir $(MAN8); \
-		$(CHOWN) $(W_CHOWN) $(MAN8) )
-	@cp Doc/man/approve.1 $(MAN1)
-	@cp Doc/man/digest.1 $(MAN1)
-	@cp Doc/man/bounce-remind.1 $(MAN1)
-	@cp Doc/man/majordomo.8 $(MAN8)
-#	@-$(CHOWN) $(W_CHOWN) $(W_BIN)/man/man[18]/*
-
-
-install-shared: install-wrapper-shared install-scripts
-
-install-wrapper-shared: wrapper
-	@test -d $(W_BIN)/wrappers || mkdir $(W_BIN)/wrappers
-	@test -d $(W_BIN)/wrappers/$(W_GROUP) || mkdir $(W_BIN)/wrappers/$(W_GROUP)
-	strip wrapper
-	cp wrapper $(W_BIN)/wrappers/$(W_GROUP)/wrapper.$(ARCHCMD)
-	cp wrapper.sh $(W_BIN)/wrappers/$(W_GROUP)/wrapper
-	@echo 'run make permissions-shared' as root to set permissions
-
-permissions-shared:
-	@$(CHOWN) $(W_CHOWN) $(W_BIN)/wrappers/$(W_GROUP)/wrapper.$(ARCHCMD)
-	@$(CHOWN) $(W_CHOWN) $(W_BIN)/.
-	chmod $(W_CHMOD) $(W_BIN)/wrappers/$(W_GROUP)/wrapper.$(ARCHCMD)
+	@echo "Installing manual pages in $(MAN)"
+	@$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) \
+		. $(MAN)
+	@$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) \
+		. $(MAN)/man1
+	@$(INSTALL) -m $(EXEC_MODE) $(INSTALL_FLAGS) \
+		. $(MAN)/man8
+	@$(INSTALL) -m $(FILE_MODE) $(INSTALL_FLAGS) \
+		Doc/man/approve.1 $(MAN)/man1/approve.1
+	@$(INSTALL) -m $(FILE_MODE) $(INSTALL_FLAGS) \
+		Doc/man/digest.1 $(MAN)/man1/digest.1
+	@$(INSTALL) -m $(FILE_MODE) $(INSTALL_FLAGS) \
+		Doc/man/bounce-remind.1 $(MAN)/man1/bounce-remind.1
+	@$(INSTALL) -m $(FILE_MODE) $(INSTALL_FLAGS) \
+		Doc/man/majordomo.8 $(MAN)/man8/majordomo.8
 
 wrapper: wrapper.c
 	cc  $(WRAPPER_FLAGS) -o wrapper wrapper.c
diff -u ./approve ../majordomo-1.94.1/approve
--- ./approve	Wed Nov 27 20:58:13 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';
 
Only in ../majordomo-1.94.1: archive2.pl
diff -u ./bounce ../majordomo-1.94.1/bounce
--- ./bounce	Wed Nov 27 20:58:13 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	Wed Nov 27 20:58:13 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	Wed Nov 27 20:58:13 1996
+++ ../majordomo-1.94.1/config-test	Wed Nov 27 20:47:19 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.10 1996/11/27 19:47:19 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>
@@ -16,6 +16,43 @@
 
 $registration_file = ".majordomo_registration";
 
+$default_uid = 123;
+
+if (!$ENV{'MAJORDOMO_CF'}) {
+    print <<"STOP"
+
+\a\aYou're attempting to run $0 the wrong way!
+    Let's try running it through ./wrapper instead, hmm?
+
+    sleep 2; exec ./wrapper config-test
+
+STOP
+    ;
+    sleep 2;
+    if (-x "./wrapper") {
+	exec("./wrapper config-test");
+    } else {
+	print <<"dummy"
+Well, shoot, you forget to run 
+
+    make install-wrapper
+
+as well!  Better go do that...
+dummy
+    ;
+	exit 1;
+    }
+}
+
+
+
+&header('');
+&header("Config-test for Majordomo");
+&header('');
+print "\n\n";
+
+
+
 &header("Obvious things:");
 
 &header("environment variables");
@@ -45,6 +82,40 @@
 print "   real      user  = $uid_name (uid $<)\n";
 print "   real      group = @gid_names (gid $( )\n";
 
+if ($< == $default_uid) { 		# the default uid
+    print <<"idontthinkso"
+I think it's highly unlikely that you're using the default
+user id of $default_uid for majordomo.  Lemme check...
+
+idontthinkso
+    ;
+    $name = (getpwuid($default_uid))[0];
+    if (! $name ) {
+	print <<"ithoughtso"
+
+Hah!  I thought so!  You've forgotten to use the right user id 
+in the Makefile.  Make sure that W_USER and W_GROUP are set to 
+the correct values in the Makefile, and run 
+	make install-wrapper 
+again.
+
+ithoughtso
+;#'
+	exit 1;
+    } else {
+	print <<"wellokay"
+Hmm!  The user with the uid of $default_uid is $name, so
+at least the user exists.  If this isn't the majordomo user,
+make sure that W_USER and W_GROUP are set to the correct values
+in the Makefile, and run 
+	make install-wrapper 
+again.
+
+wellokay
+;#'
+    }    
+}
+
 &header('');
 print "\n\tNon obvious things that cause headaches:\n\n";
 &header('');
@@ -121,7 +192,7 @@
 	&bad("list directory $listdir has bad permissions");
     }
 } else {
-    print "Hmmm, list directory $listdir doesn't exist or isn't a directory.";
+    print "Hmmm, list directory $listdir doesn't exist\n or isn't a directory.\n";
     print "Let me try to make it for you...\n";
     if ( mkdir( $listdir, 0777) ) {
 	&good("list directory $listdir created.\n");
@@ -133,9 +204,9 @@
 &header("log");
 
 if ( ! -e $log ) {
-    print "Logfile $log didn't exist, trying to create...";
+    print "Logfile $log didn't exist, trying to create...\n ";
     if (open(A, ">$log") && close(A) ) { # sesame
-	print "okay, now chmod'ing\n";
+	print "okay, now chmod'ing..\n";
 	chmod (0664, $log) || &bad( "chmod on $log failed, $!");
     } else {
 	&bad("Couldn't create logfile $log, $!\n");
@@ -221,12 +292,12 @@
 open(S, 'sample.cf') || &bad("Couldn't open sample.cf for reading, $!");
 
 while (<S>) {
-    next if !/^($\w+)/;
+    next if !/^(\$\w+)/;
     $config{$1} = 2;
 }
 
 while (<$cf>) {
-    next if !/^($\w+)/;
+    next if !/^(\$\w+)/;
     $config{$1}++;
 }
 
@@ -243,12 +314,12 @@
     push (@unknown, $_) if $config{$_} == 1;
 }
 
-if ($#new > 0) {
+if ($#new >= 0) {
     print "\nNew configuration variables (see sample.cf):\n";
     foreach (@new) { print "\t$_\n"; }
 }
 
-if ($#unknown > 0) {
+if ($#unknown >= 0) {
     print "\nUnknown configuration variables in existing majordomo.cf:\n";
     foreach (@unknown) { print "\t$_\n"; }
 }
@@ -257,6 +328,14 @@
     print "Nope, none that I see.\n";
 }
 
+print "\nHave you configured where Majordomo is?\n";
+print "\t\$whereami is $whereami\n";
+if ($whereami eq "this.domain.wont.resolve") {
+    &bad("\$whereami hasn't been changed yet!");
+} else {
+    &good("yup!");
+}
+
 &header("end of tests");
 
 print "\n\n";
@@ -287,10 +366,11 @@
 I see you haven't registered this version of Majordomo.
 By registering, you will be notified of patches and further releases
 of Majordomo.  Shall I send email to majordomo-registration\@greatcircle.com
+to register this version?  (I'll cc $whoami_owner)
 ZOT
 
 #'
-    print "to register this version?  [y] ";
+    print "[yes] ";
 	if ( <> !~ /n/i) {
 	    open(f,">$registration_file") 
 		|| die "couldn't create $registration_file, $!";
@@ -306,7 +386,7 @@
 	    &set_mail_sender($whoami_owner);
 	    &set_mailer($bounce_mailer);
 
-	    &sendmail(REG, "majordomo-registration\@greatcircle.com", 
+	    &sendmail(REG, "majordomo-registration\@greatcircle.com,$whoami_owner", 
 		      "Majordomo Registration");
 	    print REG "Majordomo Version: $majordomo_version\n";
 	    print REG "Perl version $]\n";
@@ -314,7 +394,7 @@
 	    print REG "Uname: " . `uname -a`;
 	    close REG;
 	} else {
-	    print "Well, alright then.\n\n";
+	    print "Hmmpf!\n\n";
 	}	
     }	
 
@@ -327,8 +407,12 @@
 sub bad { print "BAD:  $_[0]\n"; $BAD++;}
 
 sub header {
-    print '-' x ( ( 60 - (length($_[0]) + 2) ) / 2),
-    " $_[0] ", '-' x ( ( 60 - (length($_[0]) + 2) ) / 2), "\n";
+    if (length $_[0]) {
+	print '-' x ( ( 60 - (length($_[0]) + 2) ) / 2),
+	" $_[0] ", '-' x ( ( 60 - (length($_[0]) + 2) ) / 2), "\n";
+    } else {
+	print '-' x 60, "\n";
+    }
 }
 
 #
diff -u ./config_parse.pl ../majordomo-1.94.1/config_parse.pl
--- ./config_parse.pl	Wed Nov 27 20:58:13 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
Only in ../majordomo-1.94.1: digest
Common subdirectories: ./include and ../majordomo-1.94.1/include
Only in ../majordomo-1.94.1: install.sh
diff -u ./majordomo ../majordomo-1.94.1/majordomo
--- ./majordomo	Wed Nov 27 20:58:13 1996
+++ ../majordomo-1.94.1/majordomo	Wed Nov 27 20:48:02 1996
@@ -1,5 +1,5 @@
 #!/bin/perl
-# $Modified: Tue Oct  8 20:30:45 1996 by cwilson $
+# $Modified: Wed Nov 27 19:42:41 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.72 $
+# $Date: 1996/11/27 19:48:02 $
+# $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.
@@ -79,11 +79,16 @@
   unless defined $sendmail_command;
 $bounce_mailer = "$sendmail_command -f\$sender -t"
   unless defined $bounce_mailer;
+
+
 &set_abort_addr($whoami_owner);
 &set_mail_from($whoami);
 &set_mail_sender($whoami_owner);
 &set_mailer($bounce_mailer);
 
+$majordomo_dont_reply = $majordomo_dont_reply 
+    || '(mailer-daemon|uucp|listserv|majordomo)\@';
+
 # where do we look for files, by default?
 if (!defined($filedir)) {
     $filedir = $listdir;
@@ -104,9 +109,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,19 +121,25 @@
 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)) {
-    print STDERR "$whoami punting to avoid mail loop.\n";
+    &abort( "$whoami punting to avoid mail loop.\n");
     exit 0;
 }
 
 if (! &valid_addr($reply_to)) {
-    print STDERR "$whoami: $reply_to is not a valid return address.\n";
+    &abort( "$whoami: $reply_to is not a valid return address.\n");
     exit 2;
 }
 
+# robots should not reply to other robots...
+if ($reply_to =~ m/$majordomo_dont_reply/i) {
+      &abort( "$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 +394,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 +458,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 +666,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 +701,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 +1032,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 +1045,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 +1087,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 +1504,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 +1547,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 +1688,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	Wed Nov 27 20:58:13 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	Wed Nov 27 20:58:13 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 Nov 27 20:58:13 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	Wed Nov 27 20:58:13 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	Wed Nov 27 20:58:13 1996
+++ ../majordomo-1.94.1/resend	Wed Nov 27 20:48:47 1996
@@ -1,16 +1,16 @@
 #!/bin/perl
-# $Modified: Tue Oct 15 22:50:15 1996 by cwilson $
+# $Modified: Wed Nov 27 18:41:06 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.75 $
+# $Date: 1996/11/27 19:48:47 $
+# $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	Wed Nov 27 20:58:13 1996
+++ ../majordomo-1.94.1/sample.cf	Wed Nov 27 20:49:29 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,23 @@
 #   $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 +160,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 +181,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), 
@@ -266,5 +296,9 @@
 $global_taboo_body = <<'END';
 END
 
+# Majordomo will not send replies to addresses which match this.
+# The match is done case-insensitively.
+$majordomo_dont_reply = '(mailer-daemon|uucp|listserv|majordomo)\@';
+
 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.26 1996/11/27 19:49:29 cwilson Exp $
diff -u ./shlock.pl ../majordomo-1.94.1/shlock.pl
--- ./shlock.pl	Wed Nov 27 20:58:13 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);
Only in ../majordomo-1.94.1: todo.local
diff -u ./wrapper.c ../majordomo-1.94.1/wrapper.c
--- ./wrapper.c	Wed Nov 27 20:58:13 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	Wed Nov 27 20:58:13 1996
+++ ../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 $

#! /bin/sh

## (From INN-1.4, written by Rich Salz)
##  $Revision: 1.1 $
##  A script to install files and directories.

PROGNAME=`basename $0`

##  Paths to programs.  CHOWN and WHOAMI are checked below.
CHOWN=chown
CHGRP=chgrp
CHMOD=chmod
CP=cp
LN=ln
MKDIR=mkdir
MV=mv
RM=rm
STRIP=strip
WHOAMI=whoami

##  Some systems don't support -x, so we have to use -f.
if [ ${CHOWN} = chown ] ; then
    if [ -f /etc/chown ] ; then
	CHOWN=/etc/chown
    else
	if [ -f /usr/etc/chown ] ; then
	    CHOWN=/usr/etc/chown
	fi
    fi
fi

if [ ${WHOAMI} = whoami ] ; then
    if [ -f /usr/ucb/whoami ] ; then
	WHOAMI=/usr/ucb/whoami
    fi
fi

##  Defaults.
CHOWNIT=false
CHGROUPIT=false
CHMODIT=false
STRIPIT=false
BACKIT=false
TOUCHIT=true
SAVESRC=false
ROOT=unknown

##  Process JCL.
MORETODO=true
while ${MORETODO} ; do
    case X"$1" in
    X-b)
	BACKIT=true
	BACKUP="$2"
	shift
	;;
    X-b*)
	BACKIT=true
	BACKUP=`expr "$1" : '-b\(.*\)'`
	;;
    X-c)
	SAVESRC=true
	;;
    X-g)
	GROUP="$2"
	CHGROUPIT=true
	shift
	;;
    X-g*)
	GROUP=`expr "$1" : '-g\(.*\)'`
	CHGROUPIT=true
	;;
    X-G)
	case ${ROOT} in
	unknown)
	    case `${WHOAMI}` in
	    root)
		ROOT=true
		;;
	    *)
		ROOT=false
		;;
	    esac
	    ;;
	esac
	GROUP="$2"
	shift
	${ROOT} && CHGROUPIT=true
	;;
    X-G*)
	case ${ROOT} in
	unknown)
	    case `${WHOAMI}` in
	    root)
		ROOT=true
		;;
	    *)
		ROOT=false
		;;
	    esac
	    ;;
	esac
	if ${ROOT} ; then
	    GROUP=`expr "$1" : '-g\(.*\)'`
	    CHGROUPIT=true
	fi
	;;
    X-m)
	MODE="$2"
	CHMODIT=true
	shift
	;;
    X-m*)
	MODE=`expr "$1" : '-m\(.*\)'`
	CHMODIT=true
	;;
    X-n)
	TOUCHIT=false
	;;
    X-o)
	OWNER="$2"
	CHOWNIT=true
	shift
	;;
    X-o*)
	OWNER=`expr "$1" : '-o\(.*\)'`
	CHOWNIT=true
	;;
    X-O)
	case ${ROOT} in
	unknown)
	    case `${WHOAMI}` in
	    root)
		ROOT=true
		;;
	    *)
		ROOT=false
		;;
	    esac
	    ;;
	esac
	OWNER="$2"
	shift
	${ROOT} && CHOWNIT=true
	;;
    X-O*)
	case ${ROOT} in
	unknown)
	    case `${WHOAMI}` in
	    root)
		ROOT=true
		;;
	    *)
		ROOT=false
		;;
	    esac
	    ;;
	esac
	if ${ROOT} ; then
	    OWNER=`expr "$1" : '-o\(.*\)'`
	    CHOWNIT=true
	fi
	;;
    X-s)
	STRIPIT=true
	;;
    X--)
	shift
	MORETODO=false
	;;
    X-*)
	echo "${PROGNAME}:  Unknown flag $1" 1>&2
	exit 1
	;;
    *)
	MORETODO=false
	;;
    esac
    ${MORETODO} && shift
done

##  Process arguments.
if [ $# -ne 2 ] ; then
    echo "Usage:  ${PROGNAME} [flags] source destination"
    exit 1
fi

##  Making a directory?
if [ X"$1" = X. ] ; then
    DEST="$2"
    if [ ! -d "${DEST}" ] ; then
	${MKDIR} "${DEST}" || exit 1
    fi
    if ${CHOWNIT} ; then
	${CHOWN} "${OWNER}" "${DEST}" || exit 1
    fi
    if ${CHGROUPIT} ; then
	${CHGRP} "${GROUP}" "${DEST}" || exit 1
    fi
    if ${CHMODIT} ; then
	umask 0
	${CHMOD} "${MODE}"  "${DEST}" || exit 1
    fi
    exit 0
fi

##  Get the destination and a temp file in the destination diretory.
if [ -d "$2" ] ; then
    DEST="$2/$1"
    TEMP="$2/$$.tmp"
else
    DEST="$2"
    TEMP="`expr "$2" : '\(.*\)/.*'`/$$.tmp"
fi

##  If not given the same name, we must try to copy.
if [ X"$1" != X"$2" -o $SAVESRC ] ; then
    if cmp -s "$1" "${DEST}" ; then
	##  Files are same; touch or not.
	${TOUCHIT} && touch "${DEST}"
    else
	##  If destination exists and we wish to backup, link to backup.
	if [ -f "${DEST}" ] ; then
	    if ${BACKIT} ; then
		${RM} -f "${DEST}${BACKUP}"
		${LN} "${DEST}" "${DEST}${BACKUP}"
	    fi
	fi
	##  Copy source to the right dir, then move to right spot.
	##  Done in two parts so we can hope for atomicity.
	${RM} -f "${TEMP}" || exit 1
	${CP} "$1" "${TEMP}" || exit 1
	${MV} -f "${TEMP}" "${DEST}" || exit 1
    fi
fi

##  Strip and set the modes.
if ${STRIPIT} ; then
    ${STRIP} "${DEST}" || exit 1
fi
if ${CHOWNIT} ; then
    ${CHOWN} "${OWNER}" "${DEST}" || exit 1
fi
if ${CHGROUPIT} ; then
    ${CHGRP} "${GROUP}" "${DEST}" || exit 1
fi
if ${CHMODIT} ; then
    umask 0
    ${CHMOD} "${MODE}"  "${DEST}" || exit 1
fi
exit 0

--Chan
	 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: Majordomo v1.94: problem with shlock.pl
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: Re: config-test
From: Brock Rozen <brozen@webdreams.com>
Indexed By Thread Previous: Help with MajorCool
From: shane@centre.edu (Shane Wilson)
Next: Re: patch 1.94.1, try #2
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>

Google
 
Search Internet Search www.greatcircle.com