To: smail-alpha@veritas.com (Smail3 Patch Distribution List) Subject: Patch #25 to Smail3.1 I will be away from my computer for several weeks starting December 13, through the first week of January. As a parting gesture just before making myself incommunicado, I offer this patch to fix many of the problems that have been reported in the last two patches (primarily patch #23). Since patch #23 was a very large patch with quite a bit of new functionality in it (compared to most smail patches, anyway), the release has shown itself to have more than the usual number of obvious bugs. Such is life, I suppose. If you have problems with the patch, I will be around until Thursday afternoon. After that, you will have to resolve the problems among yourselves through smail3-wizards@cs.athabascau.ca, or by going to one of the previous patch levels. -- tron |-<=>-| ARPAnet: veritas!tron@apple.com tron@veritas.com UUCPnet: {apple,pyramid}!veritas!tron ----------------------------------------------------------------------- Notes about patch #25 Release 3.1.25 is primarily a bug fix patch release to smail3.1.24. It includes some portability enhancements, but no new features. This release contains the following changes and bug fixes: 1. A bug in the mailbox locking code was introduced in 3.1.23 that caused basic non-POSIX System V systems to dereference an uninitialized pointer, which often caused core dumps. 2. The installation scripts will now use an rm/mv sequence as a backup if mv doesn't work. HP-UX 7.0 will fail to rename a file if the destination is being executed (even if the destination is not the only link). However, an rm will work, so an rm/mv sequence should fix this problem. 3. HP-UX 8.0 is now listed as POSIX compliant. 4. A few of the longer identifiers in src/default.c were too long for some SCO C compilers. The troublesome identifiers were shortened. 5. The YP support added into mkdbm in release 3.1.23 used gethostname, explicitly, which many systems do not support. The command can now be compiled (like most of smail) to use gethostname, uname, or an ASCII file containing a hostname. 6. The LOCAL_MAIL_FILE variable can now be set in the EDITME file (although it is not described). 7. The UUWHO_USE_DBM EDITME flag didn't work, because it was not being propogated to the defs.h file. It also didn't work if NDBM was specified in HAVE, but DBM was not, even though compatibility code was added in releaes 3.1.23 to make this work. Finally, mkuuwho didn't work with DBM because of a mixup in some shell case patterns. 8. Added an official patch to pathalias that was apparently posted to the net some time ago, but which I didn't know about. 9. appendfile.c will no longer include in an attempt to get the utimbuf structure. Your system should define utimbuf in either , or , or should define DECLARE_UTIMBUF to get smail to define utimbuf itself. 10. Smail will now call siginterrupt for 4.3BSD, in an attempt to have signals interrupt the accept() system call. 11. The bind router can now use the res_search function rather than the older res_mkquery. This apparently works better, at least under recent SunOS releases. 12. The samples/bind/routers file incorrectly mentioned the defname attribute when it should have mentioned defnames. 13. Made an attempt at fixing the dbmclose macro in dbm_compat.h so that it didn't cause compiler warnings on machines that don't handle (void)0 so well with the ?: operator. 14. The compatbility getopt() function is not compiled if libc has one, to avoid differences with any declared function prototypes. 15. The bind router will now declare h_errno, rather than expecting the header file to define it. 16. Some inconsistent uses of a sometimes allocated pointer were fixed in unsharmap.c that may have caused core dumps on some machines. 17. HP-UX 7.0 cannot handle a newline within a pattern in a shell case statement. Thus, just for HP-UX 7.0 smail will use a much slower operation (involving an echo to "wc -l") in conf/lib/mkdefs.sh, when building defs.sed files. Variables which contain newlines are weeded out when generating defs.sed files, to ensure that the files are parsable. ----------------------------------------------------------------------- The following changes should be applied to the version 3.1.24.1 sources for smail, to produce smail3.1.25.1. The version number that you are running can be found in the `level' file at the top of the source tree. It can also be found by running the command: smail -V -v For information on smail releases and how you can obtain a complete smail release or a patch release, send mail to the address: smail-patch@veritas.com or to the !-style address: ...{amdahl,apple,pyramid,uunet}!veritas!smail-patch include as the first line of the message one of the following lines: send help send index send patch where is a single patch number (e.g., 17) or a single patch range (e.g., 4-7) and where is your address relative to veritas. The is optional and if omitted your return path is used. The following patch should be applied to the smail3.1.24.1 release. To apply this patch, obtain a copy of the program patch, release 2.0 or higher. The patch utility has been posted to the USENET group comp.sources.unix, and is available from most sites that archive public domain programs. Apply this patch using the command: patch -p [-d /SMAIL_SOURCE_PATH] < this_patch_file where "-d /SMAIL_SOURCE_PATH" specifies a root based path to the top of the smail source tree, and where "patchfile" is the name of the file in which this patch is stored. The "-d /SMAIL_SOURCE_PATH" is not needed if the current directory is already the top of the smail source tree. NOTE: Don't forget the -p !!!!! Prereq: PATCH_NUMBER=24 Index: patchnum *************** *** 1,3 **** ! # @(#)patchnum 1.12 20 Nov 1991 01:02:34 ! PATCH_NUMBER=24 ! PATCH_DATE=20-nov-91 --- 1,3 ---- ! # @(#)patchnum 1.13 10 Dec 1991 00:03:53 ! PATCH_NUMBER=25 ! PATCH_DATE=09-dec-91 Prereq: 3.1.24.1 Index: level *************** *** 1,2 **** ! # @(#)level 1.13 20 Nov 1991 01:02:30 ! 3.1.24.1 Wed Nov 20 01:01:52 PST 1991 --- 1,2 ---- ! # @(#)level 1.14 10 Dec 1991 00:03:48 ! 3.1.25.1 Tue Dec 10 00:03:16 PST 1991 Index: README *************** *** 56,61 **** --- 56,155 ---- delivery_mode=queued + CHANGES IN THE 3.1.25 RELEASE + + Release 3.1.25 is primarily a bug fix patch release to smail3.1.24. + It includes some portability enhancements, but no new features. This + release contains the following changes and bug fixes: + + 1. A bug in the mailbox locking code was introduced in 3.1.23 that + caused basic non-POSIX System V systems to dereference an + uninitialized pointer, which often caused core dumps. + + 2. The installation scripts will now use an rm/mv sequence as a + backup if mv doesn't work. HP-UX 7.0 will fail to rename a file + if the destination is being executed (even if the destination is + not the only link). However, an rm will work, so an rm/mv + sequence should fix this problem. + + 3. HP-UX 8.0 is now listed as POSIX compliant. + + 4. A few of the longer identifiers in src/default.c were too long for + some SCO C compilers. The troublesome identifiers were shortened. + + 5. The YP support added into mkdbm in release 3.1.23 used + gethostname, explicitly, which many systems do not support. The + command can now be compiled (like most of smail) to use + gethostname, uname, or an ASCII file containing a hostname. + + 6. The LOCAL_MAIL_FILE variable can now be set in the EDITME file + (although it is not described). + + 7. The UUWHO_USE_DBM EDITME flag didn't work, because it was not + being propogated to the defs.h file. It also didn't work if NDBM + was specified in HAVE, but DBM was not, even though compatibility + code was added in releaes 3.1.23 to make this work. Finally, + mkuuwho didn't work with DBM because of a mixup in some shell case + patterns. + + 8. Added an official patch to pathalias that was apparently posted to + the net some time ago, but which I didn't know about. + + 9. appendfile.c will no longer include in an attempt to + get the utimbuf structure. Your system should define utimbuf in + either , or , or should define + DECLARE_UTIMBUF to get smail to define utimbuf itself. + + 10. Smail will now call siginterrupt for 4.3BSD, in an attempt to have + signals interrupt the accept() system call. + + 11. The bind router can now use the res_search function rather than + the older res_mkquery. This apparently works better, at least + under recent SunOS releases. + + 12. The samples/bind/routers file incorrectly mentioned the defname + attribute when it should have mentioned defnames. + + 13. Made an attempt at fixing the dbmclose macro in dbm_compat.h so + that it didn't cause compiler warnings on machines that don't + handle (void)0 so well with the ?: operator. + + 14. The compatbility getopt() function is not compiled if libc has + one, to avoid differences with any declared function prototypes. + + 15. The bind router will now declare h_errno, rather than expecting + the header file to define it. + + 16. Some inconsistent uses of a sometimes allocated pointer were fixed + in unsharmap.c that may have caused core dumps on some machines. + + 17. HP-UX 7.0 cannot handle a newline within a pattern in a shell case + statement. Thus, just for HP-UX 7.0 smail will use a much slower + operation (involving an echo to "wc -l") in conf/lib/mkdefs.sh, + when building defs.sed files. Variables which contain newlines + are weeded out when generating defs.sed files, to ensure that the + files are parsable. + + + NOTE ABOUT PATCH TO BIND + + The patch to bind causes smail to use the res_search function. This + supposedly interacts with the "defnames" attribute correctly on some + versions of the resolver library. However, it doesn't work correctly + in my version (standard SVR4.0 version 3 from AT&T), so beware. If + this doesn't work, try adding OBSOLETE_RESOLVER to MISC_DEFINES in the + EDITME file. + + + ACKNOWLEDGEMENTS FOR PATCH 25 + + This patch was made possible with the help of the following people + that I can recall: Bell Aten, Alan Barrett, Neal D. Becker, + Uwe Doering, David J. Fiander, Bill Heiser, Guenter Kreis, + Simon Leinen, Jan-Piet Mens, Klaus Elmquist Nielsen, Jim O'Connor, + Chip Salzenberg, Roy Smith, and Tony Sumrall. + + CHANGES IN THE 3.1.24 RELEASE Release 3.1.24 is an emergency patch release to smail3.1.23. This *************** *** 419,425 **** are interested, please send mail. ! ACKNOWLEDGEMENTS FOR THIS PATCH The comprehensive nature of this patch was made possible by the help of many people. Here is a partial list: Bill Aten, Larry Auton, Alan --- 513,519 ---- are interested, please send mail. ! ACKNOWLEDGEMENTS FOR PATCH 23 The comprehensive nature of this patch was made possible by the help of many people. Here is a partial list: Bill Aten, Larry Auton, Alan Index: conf/EDITME-dist *************** *** 1,4 **** ! # @(#)conf/EDITME-dist 1.23 15 Nov 1991 16:27:06 # # EDITME - edit me to perform high level configuration of smail # --- 1,4 ---- ! # @(#)conf/EDITME-dist 1.27 10 Dec 1991 01:09:30 # # EDITME - edit me to perform high level configuration of smail # *************** *** 83,89 **** # # If you wish to use the GNU dbm library, then add -lgdbm to LIBS # (perhaps with a -L to indicate the directory containing gdbm), ! # and then add HAVE_NDBM to the HAVE variable. #LIBS=-lgdbm # use the GNU dbm library #LIBS="-L/usr/local/lib -lgdbm" # if gdbm is in /usr/local/lib --- 83,89 ---- # # If you wish to use the GNU dbm library, then add -lgdbm to LIBS # (perhaps with a -L to indicate the directory containing gdbm), ! # and then add NDBM to the HAVE variable. #LIBS=-lgdbm # use the GNU dbm library #LIBS="-L/usr/local/lib -lgdbm" # if gdbm is in /usr/local/lib *************** *** 216,222 **** # If LMAIL is defined below and the specified file does not exist, # then the binmail makefile install rule will attempt to move # /bin/mail to LMAIL and then copy binmail into /bin/mail. If LMAIL ! # is defined and the file LMAIL does not exist, then the binmail # makefile will refuse to install binmail. # # If LMAIL is not defined then /bin/mail is not touched. --- 216,222 ---- # If LMAIL is defined below and the specified file does not exist, # then the binmail makefile install rule will attempt to move # /bin/mail to LMAIL and then copy binmail into /bin/mail. If LMAIL ! # is defined and the file LMAIL does exist, then the binmail # makefile will refuse to install binmail. # # If LMAIL is not defined then /bin/mail is not touched. *************** *** 268,277 **** --- 268,290 ---- # reason to use the System V forwarding convention, it is sufficient # to disable it. To disable the System V forwarding convention, add # NO_FORWARDTO_FILE to MISC_DEFINES. + # + # IMPORTANT FOR USERS OF OLD BIND RELEASES + # + # The bind resolver can make use of features in newer releases of + # BIND (named). In particular, it will use the res_search function, + # rather than older res_mkquery function. If you do not have the + # new BIND release (e.g., res_search is listed as an undefined + # variable when you link smail), then add OBSOLETE_RESOLVER to + # MISC_DEFINES. Also, the res_search function does not appear to + # interract correctly with the 'defnames' attribute to the bind + # driver, on some versions of the resolv library, so beware. If bind + # doesn't work for you, try defining OBSOLETE_RESOLVER. #MISC_DEFINES=ISC_SOCKET_TIME_BUG #MISC_DEFINES=NO_FORWARDTO_FILE # recommended for BSD systems #MISC_DEFINES=ISC_SOCKET_TIME_BUG:NO_FORWARDTO_FILE + #MISC_DEFINES=OBSOLETE_RESOLVER # HAVE - miscellaneous supported features Index: conf/lib/inst.sh *************** *** 1,6 **** : #!/bin/sh ! # @(#)conf/lib/inst.sh 1.4 23 Jul 1991 22:23:52 # Install a file under a list of names. # # usage: sh inst.sh [-lsr] [-u user] [-g group] [-m mode] [-d dir] src [dst...] --- 1,6 ---- : #!/bin/sh ! # @(#)conf/lib/inst.sh 1.5 09 Dec 1991 23:10:35 # Install a file under a list of names. # # usage: sh inst.sh [-lsr] [-u user] [-g group] [-m mode] [-d dir] src [dst...] *************** *** 130,138 **** if $dbg mv "$new" "$dst" < /dev/null; then echo "$srcfile installed as $dst" else ! $dbg rm -f "$new" "$old" ! echo "inst: failed to install $srcfile as $dst" 1>&2 ! exit 1 fi # if -r flag specified, remove the .O file --- 130,147 ---- if $dbg mv "$new" "$dst" < /dev/null; then echo "$srcfile installed as $dst" else ! # some systems (HP-UX 7.0) can't do a mv if the ! # destination is an executable, however, an rm/mv ! # sequence may work ! echo "inst: try removing destination and trying again" 1>&2 ! if $dbg rm -f "$dst" && ! $dbg mv "$new" "$dst" < /dev/null; then ! echo "inst: rm/mv succeeded: $srcfile installed as $dst" 1>&2 ! else ! $dbg rm -f "$new" "$old" ! echo "inst: failed to install $srcfile as $dst" 1>&2 ! exit 1 ! fi fi # if -r flag specified, remove the .O file *************** *** 188,202 **** ?*) # link to previous $dbg rm -f "$new" "$old" $dbg ln "$dst" "$old" 2> /dev/null ! if $dbg ln "$lastdst" "$new" 2> /dev/null && ! $dbg mv "$new" "$dst" < /dev/null then ! echo "$lastdst linked to $dst" ! case "$rm_old" in ! ?*) rm -f "$old";; ! esac ! lastdst="$dst" ! continue fi;; *) # copy $dbg rm -f "$new" "$old" --- 197,229 ---- ?*) # link to previous $dbg rm -f "$new" "$old" $dbg ln "$dst" "$old" 2> /dev/null ! if $dbg ln "$lastdst" "$new" 2> /dev/null then ! if $dbg mv "$new" "$dst" < /dev/null ! then ! echo "$lastdst linked to $dst" ! case "$rm_old" in ! ?*) rm -f "$old";; ! esac ! lastdst="$dst" ! continue ! else ! # some systems (HP-UX 7.0) can't do a mv ! # if the destination is an executable, ! # however, an rm/mv sequence may work ! echo "inst: try removing destination and trying again" 1>&2 ! if $dbg rm -f "$dst" && ! $dbg mv "$new" "$dst" < /dev/null; then ! echo "inst: rm/mv succeeded: $lastdst linked to $dst" 1>&2 ! lastdst="$dst" ! continue ! else ! $dbg rm -f "$new" "$old" ! echo "inst: failed to install $srcfile as $dst" 1>&2 ! err=1 ! continue ! fi ! fi fi;; *) # copy $dbg rm -f "$new" "$old" *************** *** 256,265 **** if $dbg mv "$new" "$dst" < /dev/null; then echo "$srcfile installed as $dst" else ! $dbg rm -f "$new" "$old" ! echo "inst: failed to install $srcfile as $dst" 1>&2 ! err=1 ! continue fi lastdst="$dst" --- 283,301 ---- if $dbg mv "$new" "$dst" < /dev/null; then echo "$srcfile installed as $dst" else ! # some systems (HP-UX 7.0) can't do a mv if the ! # destination is an executable, however, an rm/mv ! # sequence may work ! echo "inst: try removing destination and trying again" 1>&2 ! if $dbg rm -f "$dst" && ! $dbg mv "$new" "$dst" < /dev/null; then ! echo "inst: rm/mv succeeded: $srcfile installed as $dst" 1>&2 ! else ! $dbg rm -f "$new" "$old" ! echo "inst: failed to install $srcfile as $dst" 1>&2 ! err=1 ! continue ! fi fi lastdst="$dst" Index: conf/lib/instm.sh *************** *** 1,6 **** : #!/bin/sh ! # @(#)conf/lib/instm.sh 1.4 23 Jul 1991 22:23:56 # Install a set of files into a directory # # usage: sh instm.sh [-sr] [-u user] [-g group] [-m mode] dir file... --- 1,6 ---- : #!/bin/sh ! # @(#)conf/lib/instm.sh 1.5 09 Dec 1991 23:10:39 # Install a set of files into a directory # # usage: sh instm.sh [-sr] [-u user] [-g group] [-m mode] dir file... *************** *** 120,129 **** if $dbg mv "$new" "$dst" < /dev/null; then echo "installed $file as $dst" else ! $dbg rm -f "$new" "$old" ! echo "instm: failed to install $file as $dst" 1>&2 ! err=1 ! continue fi case "$rm_old" in ?*) rm -f "$old";; --- 120,138 ---- if $dbg mv "$new" "$dst" < /dev/null; then echo "installed $file as $dst" else ! # some systems (HP-UX 7.0) can't do a mv if the ! # destination is an executable, however, an rm/mv ! # sequence may work ! echo "inst: removing destination and trying again" 1>&2 ! if $dbg rm -f "$dst" && ! $dbg mv "$new" "$dst" < /dev/null; then ! echo "inst: rm/mv succeeded: $file installed as $dst" 1>&2 ! else ! $dbg rm -f "$new" "$old" ! echo "instm: failed to install $file as $dst" 1>&2 ! err=1 ! continue ! fi fi case "$rm_old" in ?*) rm -f "$old";; Index: conf/lib/mkdefs.sh *************** *** 1,5 **** #!/bin/sh ! # @(#)conf/lib/mkdefs.sh 1.19 03 Nov 1991 04:56:30 # Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll # --- 1,5 ---- #!/bin/sh ! # @(#)conf/lib/mkdefs.sh 1.22 09 Dec 1991 18:34:42 # Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll # *************** *** 485,491 **** */ #define MAILBOX_DIR "$MAILBOX_DIR" ! #define LOCAL_MAIL_FILE "$MAILBOX_DIR/\${lc:user}" #define CONSOLE "$CONSOLE" $LOCKING_PROTOCOL $DECLARE_STRINGS --- 485,491 ---- */ #define MAILBOX_DIR "$MAILBOX_DIR" ! #define LOCAL_MAIL_FILE "$LOCAL_MAIL_FILE" #define CONSOLE "$CONSOLE" $LOCKING_PROTOCOL $DECLARE_STRINGS *************** *** 559,564 **** --- 559,565 ---- -e 's/\([A-Z0-9_]*\)=$/#undef \1/p' SMALL_MEMORY=$SMALL_MEMORY USE_ASCII=$USE_ASCII + UUWHO_USE_DBM=$UUWHO_USE_DBM EOF # write out the positibe boolean list variables *************** *** 615,630 **** # write out the simple variables. Ignore variables with newlines or | chars ! nl=' ' ! for v in $VARS; do ! eval " ! case \"\$$v\" in ! *\$nl*|*'|'*) :;; ! *) echo \"s|X_${v}_X|\$$v|g\";; ! esac ! " ! done # clear the negative boolean list variables (IFS="$sep"; for i in $NO_HAVE; do echo "s|X_HAVE_${i}_X||g"; done) --- 616,647 ---- # write out the simple variables. Ignore variables with newlines or | chars ! if [ ! -z "$CASE_NO_NEWLINES" ]; then ! # HP-UX 7.0 cannot handle newlines within a case pattern. ! # Thus, we will use wc to find newlines, instead. ! ! for v in $VARS; do ! eval " ! if [ \`echo \"\$$v\" | wc -l\` -eq 1 ]; then ! case \"\$$v\" in ! *'|'*|*'\\'*) :;; ! *) echo \"s|X_${v}_X|\$$v|g\";; ! esac ! fi ! " ! done ! else ! nl=' ' ! for v in $VARS; do ! eval " ! case \"\$$v\" in ! *\$nl*|*'|'*|*'\\'*) :;; ! *) echo \"s|X_${v}_X|\$$v|g\";; ! esac ! " ! done ! fi # clear the negative boolean list variables (IFS="$sep"; for i in $NO_HAVE; do echo "s|X_HAVE_${i}_X||g"; done) Index: conf/os/hp-ux7.0 *************** *** 1,4 **** ! # @(#)conf/os/hp-ux7.0 1.2 11 Nov 1991 07:47:57 # # hp-ux7.0 - define characteristics of Hewlet Packard's HP-UX version 7.0 --- 1,4 ---- ! # @(#)conf/os/hp-ux7.0 1.3 09 Dec 1991 18:34:40 # # hp-ux7.0 - define characteristics of Hewlet Packard's HP-UX version 7.0 *************** *** 16,18 **** --- 16,24 ---- # HAVE - what features should be used with this operating system HAVE=BSTRING:SYS5_STRLIB:READDIR:VFPRINTF:GETOPT:DUP2:ULIMIT HAVE=$HAVE:MKDIR:SETGROUPS:DBM:NDBM:GETHOSTNAME:BSD_NETWORKING + + # HP-UX 7.0 cannot handle newlines within a case pattern, which + # mkdefs.sh normally relies on. Set CASE_NO_NEWLINES to use an even + # more grotesque looking shell expression for ignoring EDITME conf/os + # variables that have newlines. + CASE_NO_NEWLINES=true Index: conf/os/hp-ux8.0 *************** *** 1,4 **** ! # @(#)conf/os/hp-ux8.0 1.2 11 Nov 1991 07:47:31 # # hp-ux8.0 - define characteristics of Hewlet Packard's HP-UX version 8.0 # --- 1,4 ---- ! # @(#)conf/os/hp-ux8.0 1.3 09 Dec 1991 00:07:23 # # hp-ux8.0 - define characteristics of Hewlet Packard's HP-UX version 8.0 # *************** *** 7,13 **** . $ROOT/conf/os/sys5.3 # this is on an System V release 3 base # OSNAMES - Names defining this operating system ! OSNAMES="UNIX_HPUX8_0:UNIX_HPUX8:UNIX_HPUX:$OSNAMES" # CC - the C compiler to use for compiling smail CC=c89 --- 7,13 ---- . $ROOT/conf/os/sys5.3 # this is on an System V release 3 base # OSNAMES - Names defining this operating system ! OSNAMES="UNIX_HPUX8_0:UNIX_HPUX8:UNIX_HPUX:$OSNAMES:POSIX_OS" # CC - the C compiler to use for compiling smail CC=c89 Index: pd/getopt/get_opt.c *************** *** 1,5 **** /* ! * @(#)pd/getopt/get_opt.c 1.3 03 Jun 1991 02:09:04 */ /* --- 1,5 ---- /* ! * @(#)pd/getopt/get_opt.c 1.4 09 Dec 1991 01:57:22 */ /* *************** *** 27,32 **** --- 27,34 ---- #include #include "defs.h" + #ifndef HAVE_GETOPT + /*LINTLIBRARY*/ #define ERR(s, c) if(opterr){\ extern int write();\ *************** *** 88,90 **** --- 90,94 ---- } return(c); } + + #endif /* not HAVE_GETOPT */ Index: pd/pathalias/config.h *************** *** 1,4 **** ! /* Smail SCCS ID: @(#)pd/pathalias/config.h 1.6 %G 00:43:21 */ /* pathalias -- by steve bellovin, as told to peter honeyman */ /************************************************************************** --- 1,4 ---- ! /* Smail SCCS ID: @(#)pd/pathalias/config.h 1.7 %G 01:08:05 */ /* pathalias -- by steve bellovin, as told to peter honeyman */ /************************************************************************** *************** *** 68,74 **** * core dumps (or panics!), comment out the following manifest, * and use the inferior C library malloc/free. */ ! #if !defined(SMAIL_3) || !defined(NO_PALIAS_MYMALLOC) #define MYMALLOC /**/ #endif --- 68,74 ---- * core dumps (or panics!), comment out the following manifest, * and use the inferior C library malloc/free. */ ! #if !defined(SMAIL_3) && !defined(NO_PALIAS_MYMALLOC) #define MYMALLOC /**/ #endif Index: pd/pathalias/mapaux.c *************** *** 1,4 **** ! /* Smail SCCS ID: @(#)pd/pathalias/mapaux.c 1.5 %G 00:43:32 */ /* pathalias -- by steve bellovin, as told to peter honeyman */ #ifndef lint static char *sccsid = "@(#)mapaux.c 9.4 89/03/01"; --- 1,4 ---- ! /* Smail SCCS ID: @(#)pd/pathalias/mapaux.c 1.6 %G 01:08:17 */ /* pathalias -- by steve bellovin, as told to peter honeyman */ #ifndef lint static char *sccsid = "@(#)mapaux.c 9.4 89/03/01"; *************** *** 370,375 **** --- 370,376 ---- for (l = n->n_link; l != 0; l = l->l_next) { /* avoid vestigial descendants */ if ((l->l_to->n_flag & MAPPED) != 0 + || (l->l_flag & LTERMINAL) != 0 || ALTEREGO(l->l_to, parent)) continue; #ifdef DEBUG Index: samples/bind/routers *************** *** 1,4 **** ! # @(#)samples/bind/routers 1.1 20 Oct 1991 17:38:32 # This file can be used on systems which are on the Internet and which # also have uucp connections. This can be used with systems that --- 1,4 ---- ! # @(#)samples/bind/routers 1.2 09 Dec 1991 01:28:57 # This file can be used on systems which are on the Internet and which # also have uucp connections. This can be used with systems that *************** *** 27,33 **** transport = smtp; # deliver using SMTP transport local_mx_okay, # MX to local host falls through ! -defname # don't append default domain name # paths - route using a paths file, like that produced by the pathalias program paths: driver = pathalias, # general-use paths router --- 27,33 ---- transport = smtp; # deliver using SMTP transport local_mx_okay, # MX to local host falls through ! -defnames # don't append default domain name # paths - route using a paths file, like that produced by the pathalias program paths: driver = pathalias, # general-use paths router Index: src/config.h *************** *** 1,4 **** ! /* @(#)src/config.h 1.10 27 Oct 1991 19:10:10 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)src/config.h 1.11 09 Dec 1991 00:42:21 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 968,977 **** * for users. This maintains compatibility with this system. */ #if !defined(FORWARDTO_FILE) && !defined(NO_FORWARDTO_FILE) ! # ifdef UNIX_SYS5 ! # define FORWARDTO_FILE "/usr/mail/${lc:user}" # else ! # define FORWARDTO_FILE "/usr/spool/mail/${lc:user}" # endif #endif --- 968,981 ---- * for users. This maintains compatibility with this system. */ #if !defined(FORWARDTO_FILE) && !defined(NO_FORWARDTO_FILE) ! # ifdef LOCAL_MAIL_FILE ! # define FORWARDTO_FILE LOCAL_MAIL_FILE # else ! # ifdef UNIX_SYS5 ! # define FORWARDTO_FILE "/usr/mail/${lc:user}" ! # else ! # define FORWARDTO_FILE "/usr/spool/mail/${lc:user}" ! # endif # endif #endif Index: src/default.c *************** *** 1,4 **** ! /* @(#)src/default.c 1.7 03 Nov 1991 03:59:41 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)src/default.c 1.8 09 Dec 1991 00:29:05 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 914,920 **** * * The message is transferred in local format. */ ! static struct pipe_private local_demand_transport_priv = { DEMAND_UUX_COMMAND, /* demand uux to remote rmail */ /* to run uux as other than the nobody user, put the login name here */ NULL, /* execute the program as nobody */ --- 914,920 ---- * * The message is transferred in local format. */ ! static struct pipe_private ldemand_transport_priv = { DEMAND_UUX_COMMAND, /* demand uux to remote rmail */ /* to run uux as other than the nobody user, put the login name here */ NULL, /* execute the program as nobody */ *************** *** 922,928 **** 0022, /* umask for child process */ }; ! static struct transport local_demand_transport = { "local_demand", /* demand transport over uux */ "pipe", /* uses pipe transport driver */ SUCC, /* point to next transport */ --- 922,928 ---- 0022, /* umask for child process */ }; ! static struct transport ldemand_transport = { "local_demand", /* demand transport over uux */ "pipe", /* uses pipe transport driver */ SUCC, /* point to next transport */ *************** *** 933,942 **** NULL, NULL, NULL, /* hdrremove, hdrinsert, hdrappend */ NULL, /* no shadow transport */ NULL, /* no recourse on failures */ ! (char *)&local_demand_transport_priv, /* demand private configuration */ }; #undef SUCC ! #define SUCC (&local_demand_transport) /* setup for forward link */ /* --- 933,942 ---- NULL, NULL, NULL, /* hdrremove, hdrinsert, hdrappend */ NULL, /* no shadow transport */ NULL, /* no recourse on failures */ ! (char *)&ldemand_transport_priv, /* demand private configuration */ }; #undef SUCC ! #define SUCC (&ldemand_transport) /* setup for forward link */ /* *************** *** 1050,1056 **** * * The message is transferred in local format. */ ! static struct pipe_private local_demand_uusmtp_transport_priv = { DEMAND_UUSMTP_COMMAND, /* demand uux to remote rsmtp */ /* to run uux as other than the nobody user, put the login name here */ NULL, /* execute the program as nobody */ --- 1050,1056 ---- * * The message is transferred in local format. */ ! static struct pipe_private ldemand_uusmtp_transport_priv = { DEMAND_UUSMTP_COMMAND, /* demand uux to remote rsmtp */ /* to run uux as other than the nobody user, put the login name here */ NULL, /* execute the program as nobody */ *************** *** 1058,1064 **** 0022, /* umask for child process */ }; ! static struct transport local_demand_uusmtp_transport = { "local_demand_uusmtp", /* demand transport over uux */ "pipe", /* uses pipe transport driver */ SUCC, /* point to next transport */ --- 1058,1064 ---- 0022, /* umask for child process */ }; ! static struct transport ldemand_uusmtp_transport = { "local_demand_uusmtp", /* demand transport over uux */ "pipe", /* uses pipe transport driver */ SUCC, /* point to next transport */ *************** *** 1069,1079 **** NULL, NULL, NULL, /* hdrremove, hdrinsert, hdrappend */ NULL, /* no shadow transport */ NULL, /* no recourse on failures */ ! (char *)&local_demand_uusmtp_transport_priv, /* demand private configuration */ }; #undef SUCC ! #define SUCC (&local_demand_uusmtp_transport) /* setup for forward link */ /* --- 1069,1079 ---- NULL, NULL, NULL, /* hdrremove, hdrinsert, hdrappend */ NULL, /* no shadow transport */ NULL, /* no recourse on failures */ ! (char *)&ldemand_uusmtp_transport_priv, /* demand private configuration */ }; #undef SUCC ! #define SUCC (&ldemand_uusmtp_transport) /* setup for forward link */ /* *************** *** 1119,1125 **** * * The message is transferred in internet format. */ ! static struct pipe_private inet_demand_uusmtp_transport_priv = { DEMAND_UUSMTP_COMMAND, /* demand uux to remote rsmtp */ /* to run uux as other than the nobody user, put the login name here */ NULL, /* execute the program as nobody */ --- 1119,1125 ---- * * The message is transferred in internet format. */ ! static struct pipe_private idemand_uusmtp_transport_priv = { DEMAND_UUSMTP_COMMAND, /* demand uux to remote rsmtp */ /* to run uux as other than the nobody user, put the login name here */ NULL, /* execute the program as nobody */ *************** *** 1127,1133 **** 0022, /* umask for child process */ }; ! static struct transport inet_demand_uusmtp_transport = { "inet_demand_uusmtp", /* demand transport over uux */ "pipe", /* uses pipe transport driver */ SUCC, /* point to next transport */ --- 1127,1133 ---- 0022, /* umask for child process */ }; ! static struct transport idemand_uusmtp_transport = { "inet_demand_uusmtp", /* demand transport over uux */ "pipe", /* uses pipe transport driver */ SUCC, /* point to next transport */ *************** *** 1138,1148 **** NULL, NULL, NULL, /* hdrremove, hdrinsert, hdrappend */ NULL, /* no shadow transport */ NULL, /* no recourse on failures */ ! (char *)&inet_demand_uusmtp_transport_priv, /* demand private configuration */ }; #undef SUCC ! #define SUCC (&inet_demand_uusmtp_transport) /* setup for forward link */ #ifdef USE_SMTP_TRANSPORT --- 1138,1148 ---- NULL, NULL, NULL, /* hdrremove, hdrinsert, hdrappend */ NULL, /* no shadow transport */ NULL, /* no recourse on failures */ ! (char *)&idemand_uusmtp_transport_priv, /* demand private configuration */ }; #undef SUCC ! #define SUCC (&idemand_uusmtp_transport) /* setup for forward link */ #ifdef USE_SMTP_TRANSPORT Index: src/log.c *************** *** 1,4 **** ! /* @(#)src/log.c 1.4 21 Oct 1991 01:21:41 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)src/log.c 1.5 09 Dec 1991 00:48:33 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 171,177 **** --slash; if (slash == fn) return; /* root directory */ ! dr = xmalloc(slash - fn); (void) memcpy(dr, fn, slash - fn); dr[slash - fn] = '\0'; --- 171,177 ---- --slash; if (slash == fn) return; /* root directory */ ! dr = xmalloc(slash - fn + 1); (void) memcpy(dr, fn, slash - fn); dr[slash - fn] = '\0'; Index: src/modes.c *************** *** 1,4 **** ! /* @(#)src/modes.c 1.12 15 Nov 1991 16:33:16 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)src/modes.c 1.13 09 Dec 1991 01:15:38 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 834,839 **** --- 834,846 ---- /* set the alarm for wakeup time */ got_sigalrm = FALSE; if (process_queue && queue_interval > 0) { + #if defined(UNIX_BSD4_3) || defined(USE_SIGINTERRUPT) + /* + * We need to interrupt the accept, so ask for interrupted + * system calls from SIGALRMs. + */ + siginterrupt(SIGALRM, 1); + #endif (void) signal(SIGALRM, daemon_sigalrm); (void) alarm(queue_interval); } Index: src/routers/bind.c *************** *** 1,4 **** ! /* @(#)src/routers/bind.c 1.17 10 Nov 1991 06:19:35 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)src/routers/bind.c 1.20 10 Dec 1991 01:24:15 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 170,175 **** --- 170,183 ---- int arcount; /* count of additional records */ }; + /* + * import h_errno; many systems don't define it in + */ + + #ifndef OBSOLETE_RESOLVER + extern int h_errno; + #endif + /* functions local to this file */ #ifdef ANSI_C *************** *** 338,347 **** */ #ifdef RES_DEFNAMES if (rp->flags & BIND_DEFNAMES && strchr(addr->target, '.') == NULL) { ! _res.options |= RES_DEFNAMES; } else { ! _res.options &= ~RES_DEFNAMES; } #endif target = strip_dots(addr->target); --- 346,358 ---- */ #ifdef RES_DEFNAMES + # ifndef RES_DNSRCH + # define RES_DNSRCH 0 + # endif if (rp->flags & BIND_DEFNAMES && strchr(addr->target, '.') == NULL) { ! _res.options |= RES_DEFNAMES|RES_DNSRCH; } else { ! _res.options &= ~(RES_DEFNAMES|RES_DNSRCH); } #endif target = strip_dots(addr->target); *************** *** 715,724 **** --- 726,738 ---- int *pack_size; /* store answer packet size here */ char **error; /* store error message here */ { + #ifdef OBSOLETE_RESOLVER char msgbuf[MAXPACKET]; + #endif int msglen; int anslen; + #ifdef OBSOLETE_RESOLVER msglen = res_mkquery(QUERY, qname, C_IN, qtype, (char *)NULL, 0, (struct rrec *)NULL, msgbuf, MAXPACKET); *************** *** 726,731 **** --- 740,767 ---- if (anslen < 0) { return FILE_NOMATCH; } + #else /* not OBSOLETE_RESOLVER */ + anslen = res_search(qname, C_IN, qtype, answer, MAXPACKET); + if (anslen < 0) { + switch (h_errno) { + case NO_DATA: + case HOST_NOT_FOUND: + return DB_NOMATCH; + + case TRY_AGAIN: + *error = "Nameserver: Server failure"; + return DB_AGAIN; + + case NO_RECOVERY: + *error = "Irrecoverable nameserver error"; + return FILE_NOMATCH; + + default: + *error = "Unknown nameserver error"; + return FILE_NOMATCH; + } + } + #endif /* not OBSOLETE_RESOLVER */ *pack_size = anslen; answer->qdcount = ntohs(answer->qdcount); *************** *** 737,743 **** case NOERROR: return DB_SUCCEED; ! case FORMERR: *error = "Nameserver: Format error in packet"; return DB_FAIL; --- 773,779 ---- case NOERROR: return DB_SUCCEED; ! #ifdef OBSOLETE_RESOLVER case FORMERR: *error = "Nameserver: Format error in packet"; return DB_FAIL; *************** *** 756,762 **** case REFUSED: *error = "Nameserver: Query refused"; return FILE_AGAIN; ! default: *error = "Nameserver: Unknown response code"; return DB_FAIL; --- 792,798 ---- case REFUSED: *error = "Nameserver: Query refused"; return FILE_AGAIN; ! #endif /* OBSOLETE_RESOLVER */ default: *error = "Nameserver: Unknown response code"; return DB_FAIL; Index: src/sysdep.c *************** *** 1,4 **** ! /* @(#)src/sysdep.c 1.15 20 Nov 1991 00:57:50 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)src/sysdep.c 1.16 09 Dec 1991 00:33:00 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 848,854 **** char **plfn; { char *base; - char *p; if (fn[0] != '/') { /* --- 848,853 ---- *************** *** 885,890 **** --- 884,890 ---- { int no_trunc_flag; int name_max; + char *p; if ((int)strlen(base) > _POSIX_NAME_MAX - 2) { char *dir; *************** *** 918,924 **** #if !defined(UNIX_BSD) && !defined(UNIX_XENIX) /* allow at least enough room for a trailing .l */ ! if (strlen(p) > DIRSIZ - 2) { /* * always succeed */ --- 918,924 ---- #if !defined(UNIX_BSD) && !defined(UNIX_XENIX) /* allow at least enough room for a trailing .l */ ! if (strlen(base) > DIRSIZ - 2) { /* * always succeed */ Index: src/transports/appendfile.c *************** *** 1,4 **** ! /* @(#)src/transports/appendfile.c 1.12 11 Nov 1991 05:48:45 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)src/transports/appendfile.c 1.13 09 Dec 1991 00:50:46 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 92,99 **** time_t actime; time_t modtime; }; - # else - # include # endif # define RESTORE_ATIME # else --- 92,97 ---- Index: src/transports/smtplib.c *************** *** 1,4 **** ! /* @(#)src/transports/smtplib.c 1.6 11 Nov 1991 07:49:28 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)src/transports/smtplib.c 1.7 09 Dec 1991 01:18:16 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 288,294 **** * send the message, using the hidden dot protocol. */ smtpb->tp->flags |= PUT_DOTS; ! success = write_message(smtpb->out, tp, (struct addr *)NULL); if (success == WRITE_FAIL) { insert_addr_list(okay, defer, write_failed(tp)); --- 288,294 ---- * send the message, using the hidden dot protocol. */ smtpb->tp->flags |= PUT_DOTS; ! success = write_message(smtpb->out, tp, addr); if (success == WRITE_FAIL) { insert_addr_list(okay, defer, write_failed(tp)); Index: util/dbm_compat.h *************** *** 1,4 **** ! /* @(#)util/dbm_compat.h 1.1 21 Oct 1991 00:45:01 */ /* * dbm_compat.h: --- 1,4 ---- ! /* @(#)util/dbm_compat.h 1.3 09 Dec 1991 01:37:41 */ /* * dbm_compat.h: *************** *** 13,19 **** static DBM *db; #define dbminit(f) \ ((db = dbm_open((f),2,0)) ? 0 : (db = dbm_open((f),0,0)) ? 0 : -1) ! #define dbmclose() (db ? (void)dbm_close(db) : (void)0, db = NULL, 0) #define store(k,v) dbm_store(db,k,v,DBM_INSERT) #define fetch(k) dbm_fetch(db,k) --- 13,19 ---- static DBM *db; #define dbminit(f) \ ((db = dbm_open((f),2,0)) ? 0 : (db = dbm_open((f),0,0)) ? 0 : -1) ! #define dbmclose() ((db ? (dbm_close(db),0) : 0), db = (DBM *)NULL, 0) #define store(k,v) dbm_store(db,k,v,DBM_INSERT) #define fetch(k) dbm_fetch(db,k) *************** *** 28,30 **** --- 28,34 ---- #undef NULL /* in case dbm.h does not define NULL */ #define NULL 0 + + #ifndef HAVE_DBM /* we now support the old-style dbm functions */ + #define HAVE_DBM + #endif Index: util/mkdbm.c *************** *** 1,4 **** ! /* @(#)util/mkdbm.c 1.5 26 Oct 1991 22:40:38 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll --- 1,4 ---- ! /* @(#)util/mkdbm.c 1.6 09 Dec 1991 00:29:49 */ /* * Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll *************** *** 25,30 **** --- 25,34 ---- #include "exitcodes.h" #include "extern.h" + #if !defined(HAVE_GETHOSTNAME) && defined(HAVE_UNAME) + #include + #endif + #if !defined(HAVE_DBM) && !defined(HAVE_NDBM) /*ARGSUSED*/ *************** *** 136,150 **** datum key_lastmod, val_lastmod; datum key_master, val_master; long now; ! char nows[32], host[64]; ! (void) time(&now); ! sprintf(nows, "%10.10ld", now); if(gethostname(host, sizeof(host)) < 0) { done(EX_DATAERR); } key_lastmod.dptr = "YP_LAST_MODIFIED"; key_lastmod.dsize = strlen(key_lastmod.dptr); val_lastmod.dptr = nows; --- 140,194 ---- datum key_lastmod, val_lastmod; datum key_master, val_master; long now; ! char nows[32]; ! #ifdef HAVE_GETHOSTNAME ! char host[256]; if(gethostname(host, sizeof(host)) < 0) { done(EX_DATAERR); } + #else + #ifdef HAVE_UNAME + struct utsname utsname; + char *host; + (void) uname(&utsname); + host = utsname.nodename; + #else + #ifdef SITENAME_FILE + char host[4096]; + FILE *f; + char *p; + + f = fopen(SITENAME_FILE, "r"); + if (f == NULL) { + fprintf(stderr, "%s: cannot open ", program); + perror(SITENAME_FILE); + done(EX_OSFILE); + } + host[0] = '\0'; + fgets(host, sizeof(host), f); + if (host[0] == '\0') { + fprintf(stderr, "%s: no hostname found in %s\n", + program, SITENAME_FILE); + exit(EX_OSFILE); + } + p = strchr(host, '\n'); + if (p) + *p = '\0'; + fclose(f); + #else + fprintf(stderr, "%s: No known method for computing hostname\n", + program); + done(EX_USAGE); + #endif /* SITENAME_FILE */ + #endif /* HAVE_UNAME */ + #endif /* HAVE_GETHOSTNAME */ + + (void) time(&now); + sprintf(nows, "%10.10ld", now); + key_lastmod.dptr = "YP_LAST_MODIFIED"; key_lastmod.dsize = strlen(key_lastmod.dptr); val_lastmod.dptr = nows; *************** *** 167,172 **** --- 211,217 ---- done(EX_DATAERR); } } + /* * for errors or signals, remove the temp files */ Index: util/mkuuwho.sh *************** *** 1,5 **** #! /bin/sh ! # @(#)util/mkuuwho.sh 1.6 03 Nov 1991 01:52:58 # # Copyright (C) 1988 Ronald S. Karr and Landon Curt Noll # --- 1,5 ---- #! /bin/sh ! # @(#)util/mkuuwho.sh 1.7 09 Dec 1991 01:09:04 # # Copyright (C) 1988 Ronald S. Karr and Landon Curt Noll # *************** *** 49,56 **** UUWHO_USE_DBM="X_UUWHO_USE_DBM_X" DBM= case "$HAVE_DBM" in ! ?) case "$UUWHO_USE_DBM" in ! ?) DBM=yes;; esac;; esac --- 49,56 ---- UUWHO_USE_DBM="X_UUWHO_USE_DBM_X" DBM= case "$HAVE_DBM" in ! ?*) case "$UUWHO_USE_DBM" in ! ?*) DBM=yes;; esac;; esac *************** *** 118,124 **** # clear out the tempory uuwho database # case "$DBM" in ! ?) rm -f $TUUWHO_DATA.dir $TUUWHO_DATA.pag;; *) rm -f $TUUWHO_DATA;; esac --- 118,124 ---- # clear out the tempory uuwho database # case "$DBM" in ! ?*) rm -f $TUUWHO_DATA.dir $TUUWHO_DATA.pag;; *) rm -f $TUUWHO_DATA;; esac *************** *** 141,147 **** /bin/sh "$SHELL_ARGS" | eval "$UUWHO" -i -d "$TUUWHO_DATA" - fi case "$DBM" in ! ?) mv -f $TUUWHO_DATA.dir $UUWHO_DATA.dir # begin race condition - XXX mv -f $TUUWHO_DATA.pag $UUWHO_DATA.pag # end race condition - XXX ;; *) mv -f $TUUWHO_DATA $UUWHO_DATA --- 141,147 ---- /bin/sh "$SHELL_ARGS" | eval "$UUWHO" -i -d "$TUUWHO_DATA" - fi case "$DBM" in ! ?*) mv -f $TUUWHO_DATA.dir $UUWHO_DATA.dir # begin race condition - XXX mv -f $TUUWHO_DATA.pag $UUWHO_DATA.pag # end race condition - XXX ;; *) mv -f $TUUWHO_DATA $UUWHO_DATA Index: util/unsharmap.c *************** *** 1,4 **** ! /* @(#)util/unsharmap.c 1.6 28 Sep 1991 22:33:51 */ /* * Copyright (C) 1988 Ronald S. Karr and Landon Curt Noll * --- 1,4 ---- ! /* @(#)util/unsharmap.c 1.7 09 Dec 1991 14:34:21 */ /* * Copyright (C) 1988 Ronald S. Karr and Landon Curt Noll * *************** *** 150,157 **** while (fgets(filename, BUFSIZ, stdin) != NULL) { if ((p = check_newline(filename)) == NULL) { ! sprintf(err, "error: filename longer than %d chars\n", ! program, BUFSIZ-2); logit(err); sprintf(err, "exiting: status: 2 - %s", get_date()); logit(err); --- 150,156 ---- while (fgets(filename, BUFSIZ, stdin) != NULL) { if ((p = check_newline(filename)) == NULL) { ! sprintf(err, "error: filename longer than %d chars\n", BUFSIZ-2); logit(err); sprintf(err, "exiting: status: 2 - %s", get_date()); logit(err); *************** *** 168,188 **** lineno = 0; /* clear the line count */ if (filename[0] == '/' || newsspool == NULL) { ! article = fopen(filename, "r"); } else { pathname = xmalloc(strlen(filename) + strlen(newsspool) + 2); sprintf(pathname, "%s/%s", newsspool, filename); - article = fopen(pathname, "r"); - free(pathname); } if (article == NULL) { sprintf(err, "error: cannot open article: %s\n", pathname); logit(err); ++errors; continue; } sprintf(err, "filename: %s\n", pathname); logit(err); /* * verify the article header --- 167,190 ---- lineno = 0; /* clear the line count */ if (filename[0] == '/' || newsspool == NULL) { ! pathname = xmalloc(strlen(filename) + 1); ! strcpy(pathname, filename); } else { pathname = xmalloc(strlen(filename) + strlen(newsspool) + 2); sprintf(pathname, "%s/%s", newsspool, filename); } + + article = fopen(pathname, "r"); if (article == NULL) { sprintf(err, "error: cannot open article: %s\n", pathname); logit(err); + free(pathname); ++errors; continue; } sprintf(err, "filename: %s\n", pathname); logit(err); + free(pathname); /* * verify the article header