🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1124

movemail

#1124
From: Leigh B. Stoller
Date: Fri, 28 Oct 1988 17:49
42 lines
1609 bytes
Gnu 18.44, but the same applies to 18.52. The diffs are from 18.44.

In the movemail.c function no checking is done on the close of the
outbox before the inbox is zapped. This is critical in an NFS
environment, when a write of the outbox could fail for any number
of reasons. In general, it is good practice to check anyway.

Leigh

*** /tmp/,RCSt1005423	Fri Oct 28 11:42:09 1988
--- /tmp/,RCSt2005423	Fri Oct 28 11:42:10 1988
***************
*** 168,173 ****
--- 168,185 ----
  	break;
      }
  
+   /* Check to make sure no errors before we zap the inbox.
+    */
+   if (close(outdesc) != 0) {
+     int saved_errno = errno;
+     (void) unlink (outname);
+ #ifndef MAIL_USE_FLOCK
+     (void) unlink (lockname);
+ #endif /* not MAIL_USE_FLOCK */ 
+     errno = saved_errno;
+     pfatal_with_name (outname);
+   }
+     
  #ifdef MAIL_USE_FLOCK
  #ifdef STRIDE
     /* Stride has flock(), but no ftruncate().  This mess will do. */
***************
*** 177,183 ****
  #endif /* STRIDE */
  #endif /* MAIL_USE_FLOCK */
    close (indesc);
-   close (outdesc);
  #ifndef MAIL_USE_FLOCK
    /* Delete the input file; if we can't, at least get rid of its contents.  */
    if (unlink (inname) < 0)
--- 189,194 ----
Technical Details
Message-ID: <8810281749.AA05659@cs.utah.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!CS.UTAH.EDU!stoller

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!CS.UTAH.EDU!stoller
From: stoller@CS.UTAH.EDU (Leigh B. Stoller)
Newsgroups: gnu.emacs.bug
Subject: movemail
Message-ID: <8810281749.AA05659@cs.utah.edu>
Date: 28 Oct 88 17:49:19 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 42