home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2750 < prev    next >
Internet Message Format  |  1991-02-12  |  32KB

  1. From: ggw%wolves@cs.duke.edu (Gregory G. Woodbury)
  2. Newsgroups: alt.sources,comp.mail.elm
  3. Subject: Elm 2.3 patches (2 of 11)
  4. Message-ID: <1991Feb13.022925.15198@wolves.uucp>
  5. Date: 13 Feb 91 02:29:25 GMT
  6. X-Checksum-Snefru: dccb552d 5bc3f64a 2cd75949 50434e18
  7.  
  8. Archive-name: elm2.3/patch.02
  9. >From ...sunybcs!dsinc!dsinc.DSI.COM!syd Sun Jun 10 23:25:39 EDT 1990
  10. >From: syd@dsinc.DSI.COM (Syd Weinstein)
  11. >Newsgroups: comp.mail.elm,comp.sources.bugs
  12. >Subject: elm 2.3 Patch #2
  13. >Keywords: elm patch
  14. >Message-ID: <1990Jun10.035325.22099@DSI.COM>
  15. >Date: 10 Jun 90 03:53:25 GMT
  16. >Sender: syd@DSI.COM (Syd Weinstein)
  17. >Organization: Datacomp Systems, Inc., Huntingdon Valley, PA 19006
  18. >Lines: 1014
  19.  
  20. Summary: This is an official patch for elm 2.3 system.  Please apply it.
  21. Priority: MEDIUM
  22.  
  23. More of the release cleanup, more to come still...
  24.  
  25. Update install to update test prompts for alias current message
  26. >From: Syd
  27.  
  28. Some wait system calls return with -1 and errno=4 (interrupted system call) when the
  29. editor is invoked, suspended, and then resumed.  Loop until wait returns pid, or
  30. returns -1 *if errno != EINTR*.  If wait returns -1 and errno = EINTR, we wait again.
  31. Some flock()s refuse to exclusively lock a fd open for read-only access.
  32. >From: pdc%lunch.wpd@sgi.com (Paul Close)
  33.  
  34. Use a close-on-exec pipe to diagnose exec() failures.
  35. >From: tct!chip@uunet.UU.NET (Chip Salzenberg)
  36.  
  37. Allow use of submit with mmdf instead of sendmail stub
  38. >From: martin <martin@hppcmart.grenoble.hp.com>
  39.  
  40. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your elm source
  41.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  42.     If you don't have the patch program, apply the following by hand,
  43.     or get patch (version 2.0, latest patchlevel).
  44.  
  45.     After patching:
  46.         sh Configure -d
  47.         make
  48.         make install
  49.  
  50.     If patch indicates that patchlevel is the wrong version, you may need
  51.     to apply one or more previous patches, or the patch may already
  52.     have been applied.  See the patchlevel.h file to find out what has or
  53.     has not been applied.  In any event, don't continue with the patch.
  54.  
  55.     If you are missing previous patches they can be obtained from our:
  56.     archive server.
  57.  
  58.     Syd Weinstein
  59.     elm@DSI.COM
  60.  
  61.     The patches are available from the dsinc archive server
  62.     Send the following message to archive-server@DSI.COM for
  63.     a list of available patches:
  64.  
  65.     Subject: patch list
  66.     send index elm
  67.  
  68. Index: hdrs/patchlevel.h
  69. Prereq: 1
  70. *** ../elm2.3/hdrs/patchlevel.h    Tue Jun  5 22:02:31 1990
  71. --- hdrs/patchlevel.h    Sat Jun  9 21:18:04 1990
  72. ***************
  73. *** 1 ****
  74. ! #define PATCHLEVEL 1
  75. --- 1 ----
  76. ! #define PATCHLEVEL 2
  77.  
  78. Index: Instruct
  79. *** ../elm2.3/Instruct    Sat Apr 28 22:40:44 1990
  80. --- Instruct    Sat Jun  9 21:17:13 1990
  81. ***************
  82. *** 1,7 ****
  83.                   Instructions
  84.                   ------------
  85.   
  86. !                 Last Update: $Date: 90/04/28 22:40:43 $
  87.   
  88.   
  89.       This file contains instructions on how to create and install
  90. --- 1,7 ----
  91.                   Instructions
  92.                   ------------
  93.   
  94. !                 Last Update: $Date: 90/06/09 21:17:05 $
  95.   
  96.   
  97.       This file contains instructions on how to create and install
  98. ***************
  99. *** 72,80 ****
  100.       $ elm -f test/test.mail
  101.   
  102.   should read in EIGHT messages from various people.  While here, try to
  103. ! A)lias C)urrent message for each of the eight messages to confirm that
  104. ! the reply/address system is working okay.  Now Q)uit without having 
  105. ! marked anything for deletion...answer the questions accordingly.
  106.   
  107.   If you get this far you're in wonderful shape!  In fact, you're done!
  108.   
  109. --- 72,81 ----
  110.       $ elm -f test/test.mail
  111.   
  112.   should read in EIGHT messages from various people.  While here, try to
  113. ! A)lias, A)lias current message for each of the eight messages to
  114. ! confirm that the reply/address system is working okay.  Now Q)uit
  115. ! without having marked anything for deletion...answer the questions
  116. ! accordingly.
  117.   
  118.   If you get this far you're in wonderful shape!  In fact, you're done!
  119.   
  120. ***************
  121. *** 106,114 ****
  122.   
  123.   That's it!
  124.   ----------
  125. -     Author's address:    taylor@hplabs.HP.COM
  126. -                 hplabs!taylor
  127.   
  128.     This document and the entire mail system is
  129.   
  130. --- 107,112 ----
  131.  
  132. Index: Configure
  133. Prereq: 4.1.1.1
  134. *** ../elm2.3/Configure    Tue Jun  5 22:02:33 1990
  135. --- Configure    Sat Jun  9 23:25:30 1990
  136. ***************
  137. *** 8,14 ****
  138.   # and edit it to reflect your system.  Some packages may include samples
  139.   # of config.h for certain machines, so you might look for one of those.)
  140.   #
  141. ! # $Header: /files/home/users/syd/elm.rel/RCS/Configure,v 4.1.1.1 90/05/31 20:46:41 syd Exp $
  142.   #
  143.   # Yes, you may rip this off to use in other distribution packages.
  144.   # (Note: this Configure script was generated automatically.  Rather than
  145. --- 8,14 ----
  146.   # and edit it to reflect your system.  Some packages may include samples
  147.   # of config.h for certain machines, so you might look for one of those.)
  148.   #
  149. ! # $Header: /files/home/users/syd/elm.rel/RCS/Configure,v 4.1.1.4 90/06/09 23:24:59 syd Exp $
  150.   #
  151.   # Yes, you may rip this off to use in other distribution packages.
  152.   # (Note: this Configure script was generated automatically.  Rather than
  153. ***************
  154. *** 110,115 ****
  155. --- 110,116 ----
  156.   sendmail=''
  157.   shar=''
  158.   smail=''
  159. + submit=''
  160.   tbl=''
  161.   troff=''
  162.   nroff=''
  163. ***************
  164. *** 257,263 ****
  165.   attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__"
  166.   d_newshome="/usr/NeWS"
  167.   defvoidused=7
  168. ! pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /usr/plx /usr/5bin /vol/local/bin /etc /usr/lib /lib /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb /usr/convex"
  169.   
  170.   : check for out bin directory
  171.   if test ! -d ../bin; then
  172. --- 258,264 ----
  173.   attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__"
  174.   d_newshome="/usr/NeWS"
  175.   defvoidused=7
  176. ! pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /usr/plx /usr/5bin /vol/local/bin /etc /usr/lib /lib /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb /usr/convex /usr/mmdf/bin"
  177.   
  178.   : check for out bin directory
  179.   if test ! -d ../bin; then
  180. ***************
  181. *** 526,531 ****
  182. --- 527,533 ----
  183.   sendmail
  184.   shar
  185.   smail
  186. + submit
  187.   tar
  188.   tbl
  189.   test
  190. ***************
  191. *** 2323,2332 ****
  192.       fi
  193.   fi
  194.   
  195.   : determine mail delivery agent for Elm to use
  196.   case "$mailer" in
  197.   '')
  198. !     if $test -f "$sendmail"; then
  199.       dflt="$sendmail"
  200.       elif $test -f "$rmail"; then
  201.       dflt="$rmail"
  202. --- 2325,2360 ----
  203.       fi
  204.   fi
  205.   
  206. + case "$d_mmdf" in
  207. + "$define") dflt=y;;
  208. + "$undef")  dflt=n;;
  209. + *)    if $test -f "$submit"; then
  210. +         dflt=y
  211. +     fi
  212. +     ;;
  213. + esac
  214. + $cat <<EOM
  215. +  
  216. + Some systems run MMDF as their Mail Transport Agent.  MMDF uses
  217. + a different way of delimiting messages in the mailbox files.
  218. + Usually this is a series of four Control A's.  $package needs to know
  219. + if this system uses MMDF.
  220. + EOM
  221. + rp="Does this system use MMDF as its MTA? [$dflt]"
  222. + $echo $n "$rp $c"
  223. + . myread
  224. + case "$ans" in
  225. + y*) d_mmdf="$define";;
  226. + *)  d_mmdf="$undef";;
  227. + esac
  228.   : determine mail delivery agent for Elm to use
  229.   case "$mailer" in
  230.   '')
  231. !     if $test "$d_mmdf" = "$define" -a -f "$submit"; then
  232. !     dflt="$submit"
  233. !     elif $test -f "$sendmail"; then
  234.       dflt="$sendmail"
  235.       elif $test -f "$rmail"; then
  236.       dflt="$rmail"
  237. ***************
  238. *** 2367,2372 ****
  239. --- 2395,2403 ----
  240.   if $test "$mailer" != "$sendmail"; then
  241.       sendmail=''
  242.   fi
  243. + if $test "$mailer" != "$submit"; then
  244. +     submit=''
  245. + fi
  246.   
  247.   : check for internet mailer
  248.   case "$d_internet" in
  249. ***************
  250. *** 2374,2379 ****
  251. --- 2405,2412 ----
  252.   "$undef")    dflt=n;;
  253.   *)    if $test -f "$sendmail"; then
  254.           dflt=y
  255. +     elif $test -f "$submit"; then
  256. +         dflt=y
  257.       elif $test -f "$smail"; then
  258.           dflt=y
  259.       else
  260. ***************
  261. *** 2421,2447 ****
  262.   set mkdir d_mkdir
  263.   eval $inlibc
  264.   
  265. - case "$d_mmdf" in
  266. - "$define") dflt=y;;
  267. - "$undef")  dflt=n;;
  268. - *)    dflt=n;;
  269. - esac
  270. - $cat <<EOM
  271. -  
  272. - Some systems run MMDF as their Mail Transport Agent.  MMDF uses
  273. - a different way of delimiting messages in the mailbox files.
  274. - Usually this is a series of four Control A's.  $package needs to know
  275. - if this system uses MMDF.
  276. - EOM
  277. - rp="Does this system use MMDF as its MTA? [$dflt]"
  278. - $echo $n "$rp $c"
  279. - . myread
  280. - case "$ans" in
  281. - y*) d_mmdf="$define";;
  282. - *)  d_mmdf="$undef";;
  283. - esac
  284.   : ask about newmail running in the background automatically
  285.   case "$d_newauto" in
  286.   "$define")    dflt=y;;
  287. --- 2454,2459 ----
  288. ***************
  289. *** 2510,2515 ****
  290. --- 2522,2532 ----
  291.       d_noaddfrom="$define"
  292.       d_nocheckvalid="$define"
  293.       d_usedomain="$undef"
  294. + elif $test -f "$submit"; then
  295. +     echo "You're running submit with MMDF.  Setting noaddfrom, nocheckvalid, usedomain"
  296. +     d_noaddfrom="$undef"
  297. +     d_nocheckvalid="$define"
  298. +     d_usedomain="$define"
  299.   else
  300.       case "$d_nocheckvalid" in
  301.       "$define") dflt=n;;
  302. ***************
  303. *** 2519,2525 ****
  304.   
  305.       $cat << EOM
  306.   
  307. ! Since you're not running sendmail, should I check local user entered
  308.   addresses against the valid mailboxes on this system?
  309.   EOM
  310.   
  311. --- 2536,2542 ----
  312.   
  313.       $cat << EOM
  314.   
  315. ! Since you're not running sendmail or submit, should I check local user entered
  316.   addresses against the valid mailboxes on this system?
  317.   EOM
  318.   
  319. ***************
  320. *** 3144,3149 ****
  321. --- 3161,3169 ----
  322.   elif $contains 'void.*signal' $$.tmp >/dev/null 2>&1 ; then
  323.       echo "You have void (*signal())() instead of int."
  324.       d_voidsig="$define"
  325. + elif $contains 'extern.*signal' $$.tmp >/dev/null 2>&1 ; then
  326. +     echo "You have int (*signal())() instead of void."
  327. +     d_voidsig="$undef"
  328.   elif $test -n "$d_voidsig"; then
  329.       echo $n "As you already told me, signal handlers return "
  330.       if $test "$d_voidsig" = "$define"; then
  331. ***************
  332. *** 3153,3159 ****
  333.       fi
  334.   else
  335.       echo "I can't determine whether signal handlers return void or int..."
  336. !     echo "I'm assuming they return void like ANSI and POSIX want"
  337.       d_voidsig="$define"
  338.   fi
  339.   rm -f $$.tmp
  340. --- 3173,3181 ----
  341.       fi
  342.   else
  343.       echo "I can't determine whether signal handlers return void or int..."
  344. !     echo "I'm assuming they return void like ANSI and POSIX want."
  345. !     echo "If not, you will have to change d_voidsig from $define to $undef"
  346. !     echo "in config.sh at the edit question at the end of Configure"
  347.       d_voidsig="$define"
  348.   fi
  349.   rm -f $$.tmp
  350. ***************
  351. *** 3788,3793 ****
  352. --- 3810,3816 ----
  353.   sendmail='$sendmail'
  354.   shar='$shar'
  355.   smail='$smail'
  356. + submit='$submit'
  357.   tbl='$tbl'
  358.   troff='$troff'
  359.   nroff='$nroff'
  360.  
  361.  
  362. Index: Patchlist
  363. *** ../elm2.3/Patchlist    Sat Apr 28 22:40:57 1990
  364. --- Patchlist    Sat Jun  9 23:00:32 1990
  365. ***************
  366. *** 1,3 ****
  367. ! This file will contain the date and comment header from each
  368. ! official patch as issued.  Since this is the full new release,
  369. ! there are currently no patches.
  370. --- 1,67 ----
  371. !     Elm 2.3 Patch 2 - Release cleanup - Part II
  372. !     Sat Jun  9 22:59:02 EDT 1990 (Creation date, not posting date)
  373. ! Update install to update test prompts for alias current message
  374. ! From: Syd
  375. ! Some wait system calls return with -1 and errno=4 (interrupted system call) when the
  376. ! editor is invoked, suspended, and then resumed.  Loop until wait returns pid, or
  377. ! returns -1 *if errno != EINTR*.  If wait returns -1 and errno = EINTR, we wait again.
  378. ! Some flock()s refuse to exclusively lock a fd open for read-only access.
  379. ! From: pdc%lunch.wpd@sgi.com (Paul Close)
  380. ! Use a close-on-exec pipe to diagnose exec() failures.
  381. ! From: tct!chip@uunet.UU.NET (Chip Salzenberg)
  382. ! Allow use of submit with mmdf instead of sendmail stub
  383. ! From: martin <martin@hppcmart.grenoble.hp.com>
  384. !     Elm 2.3 Patch 1 - Release cleanup - Part I
  385. !     Tue Jun  5 22:25:25 EDT 1990 (Creation date, not posting date)
  386. ! Fixed Metaconfig prototype for voidsig, the test was backwards
  387. ! (had a -z where a -n should have been)
  388. ! From: Syd
  389. ! The open system call in actions.c for EMERGENCY_MAILBOX and EMER_MBOX
  390. ! were tested with the inequality >= 0 exactly backwards.
  391. ! If the user's system mail box (/usr/spool/mail/user_id) is
  392. ! removed the attempt of filter to flock it fails.  If it does not exist then
  393. ! it should create it and then lock it.
  394. ! From: john@hopf.math.nwu.edu (John Franks)
  395. ! Allow nesting on () in comment in address
  396. ! From: Chip Rosenthal <chip@chinacat.Unicom.COM>
  397. ! Fix boundary condition in add_name_to_list() where it fails to
  398. ! print error message.
  399. ! From: Chip Rosenthal <chip@chinacat.Unicom.COM>
  400. ! Fixes the 'g' Group Reply command to send to the cc list also.
  401. ! A bad variable name caused it to be ignored.
  402. ! From: chip@chinacat.Unicom.COM (Chip Rosenthal)
  403. ! Fixes when ALLOW_SUBSHELL #define'd and you are in the
  404. ! Message Header Edit Screen and the mail you just composed
  405. ! is not a reply THEN the subshell command is executed.
  406. ! From: zvr@natasha.cs.wisc.EDU (Alexios Zavras)
  407. ! Fixes where src/curses.c attempts to set the screen size via the ioctl
  408. ! TIOCGWINSIZ if it exsists. It should only use the row or col size as
  409. ! returned from the ioctl if they are not 0.
  410. ! From: muller%sdcc10@ucsd.edu (Keith Muller)
  411. ! alias command in ELM2.3 fails because of the wrong sized aliases.hash
  412. ! newalias did not truncate existing file (aliases.hash)
  413. ! From: Toshinori Maeno <tmaeno@cc.titech.ac.jp>
  414. ! Fix htonl() double define problems
  415. ! From: Syd
  416. ! Fix aliases.hash.tmp being over 14 chars and causing rename problems
  417. ! on a 14 character limit system.
  418. ! From: Syd
  419. ! Fix now spurious error message for alias recursive expansion
  420. ! when alias lookup is on a string over 20 chars long.  If that
  421. ! long, its just not an alias, so just return.
  422. ! From: Syd
  423.  
  424.  
  425. Index: doc/Ref.guide
  426. Prereq: 4.1
  427. *** ../elm2.3/doc/Ref.guide    Sat Apr 28 22:41:15 1990
  428. --- doc/Ref.guide    Sat Jun  9 22:49:53 1990
  429. ***************
  430. *** 1,4 ****
  431. ! .\" @(#)$Id: Ref.guide,v 4.1 90/04/28 22:41:08 syd Exp $
  432.   .\"
  433.   .\"  Reference guide to the Elm mail system.
  434.   .\"  format with 
  435. --- 1,4 ----
  436. ! .\" @(#)$Id: Ref.guide,v 4.1.1.1 90/06/09 22:49:11 syd Exp $
  437.   .\"
  438.   .\"  Reference guide to the Elm mail system.
  439.   .\"  format with 
  440. ***************
  441. *** 12,17 ****
  442. --- 12,21 ----
  443.   .\"  (C) Copyright 1988, 1989, 1990 Usenet Community Trust
  444.   .\"
  445.   .\"  $Log:    Ref.guide,v $
  446. + .\" Revision 4.1.1.1  90/06/09  22:49:11  syd
  447. + .\" Droped obsolete control Q command from list
  448. + .\" From: Joe Wasik
  449. + .\" 
  450.   .\" Revision 4.1  90/04/28  22:41:08  syd
  451.   .\" checkin of Elm 2.3 as of Release PL0
  452.   .\" 
  453. ***************
  454. *** 438,444 ****
  455.   If on, this tells \f2elm\f1 that you have an HP terminal and enables
  456.   the <NEXT>, <PREV>, <HOME> and <SHIFT-HOME> keys.  (The default is OFF.)
  457.   
  458. ! .lp menus* 1.0i
  459.   If turned off, this will inhibit the Menu display on all of the 
  460.   screen displays within the \f2elm\f1 program.  (Note that this is
  461.   overridden by the similar `-m' command line option,
  462. --- 442,448 ----
  463.   If on, this tells \f2elm\f1 that you have an HP terminal and enables
  464.   the <NEXT>, <PREV>, <HOME> and <SHIFT-HOME> keys.  (The default is OFF.)
  465.   
  466. ! .lp menu* 1.0i
  467.   If turned off, this will inhibit the Menu display on all of the 
  468.   screen displays within the \f2elm\f1 program.  (Note that this is
  469.   overridden by the similar `-m' command line option,
  470.  
  471. Index: doc/Users.guide
  472. Prereq: 4.1
  473. *** ../elm2.3/doc/Users.guide    Sat Apr 28 22:41:20 1990
  474. --- doc/Users.guide    Sat Jun  9 22:50:05 1990
  475. ***************
  476. *** 1,4 ****
  477. ! .\" @(#)$Id: Users.guide,v 4.1 90/04/28 22:41:16 syd Exp $
  478.   .\"
  479.   .\"  Users guide to the ELM mail system.
  480.   .\"  format with:
  481. --- 1,4 ----
  482. ! .\" @(#)$Id: Users.guide,v 4.1.1.1 90/06/09 22:49:54 syd Exp $
  483.   .\"
  484.   .\"  Users guide to the ELM mail system.
  485.   .\"  format with:
  486. ***************
  487. *** 12,17 ****
  488. --- 12,21 ----
  489.   .\"  (C) Copyright 1988, 1989, 1990 Usenet Community Trust
  490.   .\"
  491.   .\"  $Log:    Users.guide,v $
  492. + .\" Revision 4.1.1.1  90/06/09  22:49:54  syd
  493. + .\" Droped obsolete control Q command from list
  494. + .\" From: Joe Wasik
  495. + .\" 
  496.   .\" Revision 4.1  90/04/28  22:41:16  syd
  497.   .\" checkin of Elm 2.3 as of Release PL0
  498.   .\" 
  499. ***************
  500. *** 506,513 ****
  501.   Quit \(em maybe prompting for messages to delete, store, or keep.
  502.   .lp \h'18p'Q 90p
  503.   Quick quit \(em like quit but without prompting.
  504. - .lp \h'18p'<control>-Q 90p
  505. - Exit immediately \(em don't record as read, don't save...
  506.   .lp \h'18p'r 90p
  507.   Reply to the author of current message.
  508.   .lp \h'18p's 90p
  509. --- 510,515 ----
  510.  
  511. Index: hdrs/sysdefs.SH
  512. Prereq: 4.1
  513. *** ../elm2.3/hdrs/sysdefs.SH    Sat Apr 28 22:42:15 1990
  514. --- hdrs/sysdefs.SH    Sat Jun  9 22:28:43 1990
  515. ***************
  516. *** 12,20 ****
  517.   esac
  518.   echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
  519.   sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'
  520. ! /* $Id: sysdefs.SH,v 4.1 90/04/28 22:42:14 syd Exp $ */
  521.   /*******************************************************************************
  522. !  *  The Elm Mail System  -  $Revision: 4.1 $   $State: Exp $
  523.    *
  524.    *             Copyright (c) 1986, 1987 Dave Taylor
  525.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  526. --- 12,20 ----
  527.   esac
  528.   echo "Extracting hdrs/sysdefs.h (with variable substitutions)"
  529.   sed <<!GROK!THIS! >sysdefs.h -e 's!^#undef!/\*#undef!'
  530. ! /* $Id: sysdefs.SH,v 4.1.1.1 90/06/09 22:28:42 syd Exp $ */
  531.   /*******************************************************************************
  532. !  *  The Elm Mail System  -  $Revision: 4.1.1.1 $   $State: Exp $
  533.    *
  534.    *             Copyright (c) 1986, 1987 Dave Taylor
  535.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  536. ***************
  537. *** 26,31 ****
  538. --- 26,35 ----
  539.    *
  540.    *******************************************************************************
  541.    * $Log:    sysdefs.SH,v $
  542. +  * Revision 4.1.1.1  90/06/09  22:28:42  syd
  543. +  * Allow use of submit with mmdf instead of sendmail stub
  544. +  * From: martin <martin@hppcmart.grenoble.hp.com>
  545. +  * 
  546.    * Revision 4.1  90/04/28  22:42:14  syd
  547.    * checkin of Elm 2.3 as of Release PL0
  548.    * 
  549. ***************
  550. *** 98,104 ****
  551.   
  552.   #define sendmail    "$sendmail"
  553.   #define smflags        "-oi -oem"    /* ignore dots and mail back errors */
  554. ! #define smflagsv      "-oi -oem -v"   /* Verbose voyuer mode */
  555.   #define mailer        "$mailer"
  556.   
  557.   #define mailx        "$mailx"
  558. --- 102,110 ----
  559.   
  560.   #define sendmail    "$sendmail"
  561.   #define smflags        "-oi -oem"    /* ignore dots and mail back errors */
  562. ! #define smflagsv          "-oi -oem -v"   /* Verbose voyuer mode */
  563. ! #define submitmail         "$submit"
  564. ! #define submitflags     "-mlrnxto,cc*"
  565.   #define mailer        "$mailer"
  566.   
  567.   #define mailx        "$mailx"
  568.  
  569. Index: src/editmsg.c
  570. Prereq: 4.1
  571. *** ../elm2.3/src/editmsg.c    Sat Apr 28 22:42:49 1990
  572. --- src/editmsg.c    Sat Jun  9 23:33:31 1990
  573. ***************
  574. *** 1,8 ****
  575.   
  576. ! static char rcsid[] = "@(#)$Id: editmsg.c,v 4.1 90/04/28 22:42:47 syd Exp $";
  577.   
  578.   /*******************************************************************************
  579. !  *  The Elm Mail System  -  $Revision: 4.1 $   $State: Exp $
  580.    *
  581.    *             Copyright (c) 1986, 1987 Dave Taylor
  582.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  583. --- 1,8 ----
  584.   
  585. ! static char rcsid[] = "@(#)$Id: editmsg.c,v 4.1.1.1 90/06/09 23:33:06 syd Exp $";
  586.   
  587.   /*******************************************************************************
  588. !  *  The Elm Mail System  -  $Revision: 4.1.1.1 $   $State: Exp $
  589.    *
  590.    *             Copyright (c) 1986, 1987 Dave Taylor
  591.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  592. ***************
  593. *** 14,19 ****
  594. --- 14,23 ----
  595.    *
  596.    *******************************************************************************
  597.    * $Log:    editmsg.c,v $
  598. +  * Revision 4.1.1.1  90/06/09  23:33:06  syd
  599. +  * Only say cannot invoke on -1 error which is cannot do exec in system call
  600. +  * From: Syd
  601. +  * 
  602.    * Revision 4.1  90/04/28  22:42:47  syd
  603.    * checkin of Elm 2.3 as of Release PL0
  604.    * 
  605. ***************
  606. *** 76,82 ****
  607.       if (cursor_control)
  608.         transmit_functions(OFF);        /* function keys are local */
  609.   
  610. !     if ((stat = system_call(buffer, SH, TRUE, FALSE)) != 0) { 
  611.         dprint(1,(debugfile, 
  612.             "System call failed with stat %d (edit_the_message)\n", 
  613.             stat));
  614. --- 80,86 ----
  615.       if (cursor_control)
  616.         transmit_functions(OFF);        /* function keys are local */
  617.   
  618. !     if ((stat = system_call(buffer, SH, TRUE, FALSE)) == -1) { 
  619.         dprint(1,(debugfile, 
  620.             "System call failed with stat %d (edit_the_message)\n", 
  621.             stat));
  622.  
  623. Index: src/leavembox.c
  624. Prereq: 4.1
  625. *** ../elm2.3/src/leavembox.c    Sat Apr 28 22:43:20 1990
  626. --- src/leavembox.c    Sat Jun  9 21:53:32 1990
  627. ***************
  628. *** 1,8 ****
  629.   
  630. ! static char rcsid[] = "@(#)$Id: leavembox.c,v 4.1 90/04/28 22:43:18 syd Exp $";
  631.   
  632.   /*******************************************************************************
  633. !  *  The Elm Mail System  -  $Revision: 4.1 $   $State: Exp $
  634.    *
  635.    *             Copyright (c) 1986, 1987 Dave Taylor
  636.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  637. --- 1,8 ----
  638.   
  639. ! static char rcsid[] = "@(#)$Id: leavembox.c,v 4.1.1.1 90/06/09 21:33:23 syd Exp $";
  640.   
  641.   /*******************************************************************************
  642. !  *  The Elm Mail System  -  $Revision: 4.1.1.1 $   $State: Exp $
  643.    *
  644.    *             Copyright (c) 1986, 1987 Dave Taylor
  645.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  646. ***************
  647. *** 14,19 ****
  648. --- 14,26 ----
  649.    *
  650.    *******************************************************************************
  651.    * $Log:    leavembox.c,v $
  652. +  * Revision 4.1.1.1  90/06/09  21:33:23  syd
  653. +  * Some wait system calls return with -1 and errno=4 (interrupted system call) when the
  654. +  * editor is invoked, suspended, and then resumed.  Loop until wait returns pid, or
  655. +  * returns -1 *if errno != EINTR*.  If wait returns -1 and errno = EINTR, we wait again.
  656. +  * Some flock()s refuse to exclusively lock a fd open for read-only access.
  657. +  * From: pdc%lunch.wpd@sgi.com (Paul Close)
  658. +  * 
  659.    * Revision 4.1  90/04/28  22:43:18  syd
  660.    * checkin of Elm 2.3 as of Release PL0
  661.    * 
  662. ***************
  663. *** 795,801 ****
  664.         /* Now we also need to lock the file with flock(2) */
  665.   
  666.         /* Open mail file separately for locking */
  667. !       if((flock_fd = open(cur_folder, O_RDONLY)) < 0) {
  668.       dprint(1, (debugfile, 
  669.           "Error encountered attempting to reopen %s for lock\n", cur_folder));
  670.       dprint(1, (debugfile, "** %s - %s **\n", error_name(errno),
  671. --- 802,808 ----
  672.         /* Now we also need to lock the file with flock(2) */
  673.   
  674.         /* Open mail file separately for locking */
  675. !       if((flock_fd = open(cur_folder, O_RDWR)) < 0) {
  676.       dprint(1, (debugfile, 
  677.           "Error encountered attempting to reopen %s for lock\n", cur_folder));
  678.       dprint(1, (debugfile, "** %s - %s **\n", error_name(errno),
  679.  
  680. Index: src/mailmsg2.c
  681. Prereq: 4.1
  682. *** ../elm2.3/src/mailmsg2.c    Sat Apr 28 22:43:30 1990
  683. --- src/mailmsg2.c    Sat Jun  9 23:20:28 1990
  684. ***************
  685. *** 1,8 ****
  686.   
  687. ! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 4.1 90/04/28 22:43:28 syd Exp $";
  688.   
  689.   /*******************************************************************************
  690. !  *  The Elm Mail System  -  $Revision: 4.1 $   $State: Exp $
  691.    *
  692.    *             Copyright (c) 1986, 1987 Dave Taylor
  693.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  694. --- 1,8 ----
  695.   
  696. ! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 4.1.1.2 90/06/09 23:20:24 syd Exp $";
  697.   
  698.   /*******************************************************************************
  699. !  *  The Elm Mail System  -  $Revision: 4.1.1.2 $   $State: Exp $
  700.    *
  701.    *             Copyright (c) 1986, 1987 Dave Taylor
  702.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  703. ***************
  704. *** 14,19 ****
  705. --- 14,26 ----
  706.    *
  707.    *******************************************************************************
  708.    * $Log:    mailmsg2.c,v $
  709. +  * Revision 4.1.1.2  90/06/09  23:20:24  syd
  710. +  * fix typo
  711. +  * 
  712. +  * Revision 4.1.1.1  90/06/09  22:28:39  syd
  713. +  * Allow use of submit with mmdf instead of sendmail stub
  714. +  * From: martin <martin@hppcmart.grenoble.hp.com>
  715. +  * 
  716.    * Revision 4.1  90/04/28  22:43:28  syd
  717.    * checkin of Elm 2.3 as of Release PL0
  718.    * 
  719. ***************
  720. *** 339,347 ****
  721.                                )
  722.   #endif
  723.           
  724. !          strcpy(mailerflags, (sendmail_verbose ? smflagsv : smflags));
  725.         else
  726. !          mailerflags[0] ='\0';
  727.   
  728.         quote_args(very_long_buffer, strip_parens(strip_commas(expanded_to)));
  729.         strcpy(expanded_to, very_long_buffer);
  730. --- 346,356 ----
  731.                                )
  732.   #endif
  733.           
  734. !         strcpy(mailerflags, (sendmail_verbose ? smflagsv : smflags));
  735. !       else if (strcmp(submitmail, mailer) == 0)
  736. !         strcpy(mailerflags, submitflags);
  737.         else
  738. !         mailerflags[0] ='\0';
  739.   
  740.         quote_args(very_long_buffer, strip_parens(strip_commas(expanded_to)));
  741.         strcpy(expanded_to, very_long_buffer);
  742.  
  743.  
  744. Index: src/syscall.c
  745. Prereq: 4.1
  746. *** ../elm2.3/src/syscall.c    Sat Apr 28 22:44:19 1990
  747. --- src/syscall.c    Sat Jun  9 22:00:14 1990
  748. ***************
  749. *** 1,8 ****
  750.   
  751. ! static char rcsid[] = "@(#)$Id: syscall.c,v 4.1 90/04/28 22:44:18 syd Exp $";
  752.   
  753.   /*******************************************************************************
  754. !  *  The Elm Mail System  -  $Revision: 4.1 $   $State: Exp $
  755.    *
  756.    *             Copyright (c) 1986, 1987 Dave Taylor
  757.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  758. --- 1,8 ----
  759.   
  760. ! static char rcsid[] = "@(#)$Id: syscall.c,v 4.1.1.2 90/06/09 22:00:13 syd Exp $";
  761.   
  762.   /*******************************************************************************
  763. !  *  The Elm Mail System  -  $Revision: 4.1.1.2 $   $State: Exp $
  764.    *
  765.    *             Copyright (c) 1986, 1987 Dave Taylor
  766.    *             Copyright (c) 1988, 1989, 1990 USENET Community Trust
  767. ***************
  768. *** 14,19 ****
  769. --- 14,30 ----
  770.    *
  771.    *******************************************************************************
  772.    * $Log:    syscall.c,v $
  773. +  * Revision 4.1.1.2  90/06/09  22:00:13  syd
  774. +  * Use a close-on-exec pipe to diagnose exec() failures.
  775. +  * From: tct!chip@uunet.UU.NET (Chip Salzenberg)
  776. +  * 
  777. +  * Revision 4.1.1.1  90/06/09  21:33:22  syd
  778. +  * Some wait system calls return with -1 and errno=4 (interrupted system call) when the
  779. +  * editor is invoked, suspended, and then resumed.  Loop until wait returns pid, or
  780. +  * returns -1 *if errno != EINTR*.  If wait returns -1 and errno = EINTR, we wait again.
  781. +  * Some flock()s refuse to exclusively lock a fd open for read-only access.
  782. +  * From: pdc%lunch.wpd@sgi.com (Paul Close)
  783. +  * 
  784.    * Revision 4.1  90/04/28  22:44:18  syd
  785.    * checkin of Elm 2.3 as of Release PL0
  786.    * 
  787. ***************
  788. *** 28,33 ****
  789. --- 39,45 ----
  790.   #include "headers.h"
  791.   
  792.   #include <signal.h>
  793. + #include <errno.h>
  794.   
  795.   #ifdef BSD
  796.   #  include <sys/wait.h>
  797. ***************
  798. *** 111,117 ****
  799.           a message being edited when a user connection is
  800.           dropped is recovered by vi's expreserve program **/
  801.   
  802. !     int stat = 0, pid, w;
  803.   #if defined(BSD) && !defined(WEXITSTATUS)
  804.       union wait status;
  805.   #else
  806. --- 123,130 ----
  807.           a message being edited when a user connection is
  808.           dropped is recovered by vi's expreserve program **/
  809.   
  810. !     int pfd[2], stat, pid, w, iteration;
  811. !     char *sh;
  812.   #if defined(BSD) && !defined(WEXITSTATUS)
  813.       union wait status;
  814.   #else
  815. ***************
  816. *** 128,175 ****
  817.       register int (*oldstop)(), (*oldstart)();
  818.   # endif 
  819.   #endif
  820. !     
  821. !     dprint(2, (debugfile,
  822. !         "System Call: %s\n\t%s\n", shell_type == SH? "/bin/sh" : shell,
  823. !         string));
  824.   
  825. ! #ifdef VFORK
  826. !     if ((pid = vfork()) == 0)
  827. ! #else
  828. !     if ((pid = fork()) == 0)
  829. ! #endif
  830. !     {
  831. !       setgid(groupid);    /* and group id            */
  832. !       setuid(userid);    /* back to the normal user! */
  833.   
  834. !       if(allow_signals) {
  835. !         /* program to exec should handle interrupt, accidental hangup, and stop signals */
  836. !         (void)signal(SIGHUP, SIG_DFL);
  837. !         if (allow_interrupt)
  838. !           (void)signal(SIGINT, SIG_DFL);
  839. !         else
  840. !           (void)signal(SIGINT, SIG_IGN);
  841. ! #ifdef SIGTSTP
  842. !         (void)signal(SIGTSTP, SIG_DFL);
  843. !         (void)signal(SIGCONT, SIG_DFL);
  844. ! #endif
  845. !       } else {
  846. !         /* program to exec should ignore interrupt, accidental hangup, and stop signals */
  847. !         (void)signal(SIGHUP, SIG_IGN);
  848. !         (void)signal(SIGINT, SIG_IGN);
  849. ! #ifdef SIGTSTP
  850. !         (void)signal(SIGTSTP, SIG_IGN);
  851. !         (void)signal(SIGCONT, SIG_IGN);
  852. ! #endif
  853. !       }
  854.   
  855. !       if (strlen(shell) > 0 && shell_type == USER_SHELL) {
  856. !         execl(shell, argv_zero(shell), "-c", string, (char *) 0);
  857. !       }
  858. !       else 
  859. !         execl("/bin/sh", "sh", "-c", string, (char *) 0);
  860. !       _exit(127);
  861.       }
  862.   
  863.       istat = signal(SIGINT, SIG_IGN);
  864.       qstat = signal(SIGQUIT, SIG_IGN);
  865. --- 141,165 ----
  866.       register int (*oldstop)(), (*oldstart)();
  867.   # endif 
  868.   #endif
  869. !     extern int errno;
  870.   
  871. !     sh = (shell_type == USER_SHELL) ? shell : "/bin/sh";
  872. !     dprint(2, (debugfile, "System Call: %s\n\t%s\n", sh, string));
  873.   
  874. !     /*
  875. !      * Note the neat trick with close-on-exec pipes.
  876. !      * If the child's exec() succeeds, then the pipe read returns zero.
  877. !      * Otherwise, it returns the zero byte written by the child
  878. !      * after the exec() is attempted.  This is the cleanest way I know
  879. !      * to discover whether an exec() failed.   --CHS
  880. !      */
  881.   
  882. !     if (pipe(pfd) == -1) {
  883. !       perror("pipe");
  884. !       return -1;
  885.       }
  886. +     fcntl(pfd[0], F_SETFD, 1);
  887. +     fcntl(pfd[1], F_SETFD, 1);
  888.   
  889.       istat = signal(SIGINT, SIG_IGN);
  890.       qstat = signal(SIGQUIT, SIG_IGN);
  891. ***************
  892. *** 178,204 ****
  893.       oldstart = signal(SIGCONT, SIG_DFL);
  894.   #endif
  895.   
  896. !     while ((w = wait(&status)) != pid && w != -1)
  897. !         ;
  898.   
  899.   
  900. !     if (w == pid) {
  901.   #ifdef    WEXITSTATUS
  902. !       stat = WEXITSTATUS(status);
  903.   #else
  904.   # ifdef    BSD
  905. !       if (status.w_retcode != 0) stat = status.w_retcode;
  906.   # else
  907. !       stat = status;
  908.   # endif
  909.   #endif
  910. !     }
  911. !     (void)signal(SIGINT, istat);
  912. !     (void)signal(SIGQUIT, qstat);
  913.   #ifdef SIGTSTP
  914. !     (void)signal(SIGTSTP, oldstop);
  915. !     (void)signal(SIGCONT, oldstart);
  916.   #endif
  917.   
  918.       return(stat);
  919. --- 168,254 ----
  920.       oldstart = signal(SIGCONT, SIG_DFL);
  921.   #endif
  922.   
  923. !     stat = -1;        /* Assume failure. */
  924.   
  925. +     for (iteration = 0; iteration < 5; ++iteration) {
  926. +       if (iteration > 0)
  927. +         sleep(2);
  928.   
  929. ! #ifdef VFORK
  930. !       pid = vfork();
  931. ! #else
  932. !       pid = fork();
  933. ! #endif
  934. !       if (pid != -1)
  935. !         break;
  936. !     }
  937. !     if (pid == -1) {
  938. !       perror("fork");
  939. !     }
  940. !     else if (pid == 0) {
  941. !       /*
  942. !        * Set group and user back to their original values.
  943. !        * Note that group must be set first.
  944. !        */
  945. !       setgid(groupid);
  946. !       setuid(userid);
  947. !       /*
  948. !        * Program to exec may or may not be able to handle
  949. !        * interrupt, quit, hangup and stop signals.
  950. !        */
  951. !       (void) signal(SIGHUP, allow_signals ? SIG_DFL : SIG_IGN);
  952. !       (void) signal(SIGINT, (allow_signals && allow_interrupt)?SIG_DFL:SIG_IGN);
  953. !       (void) signal(SIGQUIT, (allow_signals && allow_interrupt)?SIG_DFL:SIG_IGN);
  954. ! #ifdef SIGTSTP
  955. !       (void) signal(SIGTSTP, allow_signals ? SIG_DFL : SIG_IGN);
  956. !       (void) signal(SIGCONT, allow_signals ? SIG_DFL : SIG_IGN);
  957. ! #endif
  958. !       /* Go for it. */
  959. !       execl(sh, argv_zero(sh), "-c", string, (char *) 0);
  960. !       /* If exec fails, we write a byte to the pipe before exiting. */
  961. !       perror(sh);
  962. !       write(pfd[1], "", 1);
  963. !       _exit(127);
  964. !     }
  965. !     else {
  966. !       int rd;
  967. !       char ch;
  968. !       /* Try to read a byte from the pipe. */
  969. !       close(pfd[1]);
  970. !       rd = read(pfd[0], &ch, 1);
  971. !       close(pfd[0]);
  972. !       while ((w = wait(&status)) != pid)
  973. !           if (w == -1 && errno != EINTR)
  974. !           break;
  975. !       /* If we read a byte from the pipe, the exec failed. */
  976. !       if (rd > 0)
  977. !         stat = -1;
  978. !       else if (w == pid) {
  979.   #ifdef    WEXITSTATUS
  980. !         stat = WEXITSTATUS(status);
  981.   #else
  982.   # ifdef    BSD
  983. !         stat = status.w_retcode;
  984.   # else
  985. !         stat = status;
  986.   # endif
  987.   #endif
  988. !       }
  989. !       }
  990. !   
  991. !     (void) signal(SIGINT, istat);
  992. !     (void) signal(SIGQUIT, qstat);
  993.   #ifdef SIGTSTP
  994. !     (void) signal(SIGTSTP, oldstop);
  995. !     (void) signal(SIGCONT, oldstart);
  996.   #endif
  997.   
  998.       return(stat);
  999.  
  1000. -- 
  1001. =====================================================================
  1002. Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
  1003. Datacomp Systems, Inc.                          Voice: (215) 947-9900
  1004. syd@DSI.COM or dsinc!syd                        FAX:   (215) 938-0235
  1005.  
  1006.  
  1007. -- 
  1008. Gregory G. Woodbury @ The Wolves Den UNIX, Durham NC
  1009. UUCP: ...dukcds!wolves!ggw   ...mcnc!wolves!ggw           [use the maps!]
  1010. Domain: ggw@cds.duke.edu     ggw%wolves@mcnc.mcnc.org
  1011. [The line eater is a boojum snark! ]           <standard disclaimers apply>
  1012.