🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.mh
Article #1891

MH 6.6 bug in rcvstore (w/fix): mode not set to Msg-Protect correctly

#1891
From: Mark D. Baushke
Date: Thu, 25 May 1989 00:15
55 lines
2239 bytes
Disclaimer:
	This is NOT an official patch...but where else should I have
	sent it?
MH-Version: 6.6	
mh-6.6/conf/MH:
	bin	/n/mh/bin
	bboards	off
	etc	/n/mh/etc
	mail	/usr/spool/mail
	mandir  /n/mh/man
	manuals	standard
	mts	sendmail/smtp
	options	BSD42 BSD43 BERK TTYD DUMB
	options	MHE MHRC NETWORK NFS BIND RPATHS
	options	SBACKUP='"\\043"' OVERHEAD
	ccoptions -O
	ranlib on
	pop	off
	ldoptions -O
	tma off
System: Sun-3/60, SunOS 3.5	
Description:
	When run from a process with umask 077, rcvstore does not
	properly set the file permissions since it uses creat(2) to do
	so. From the man page for creat(2):
		If the file did not exist, it is given mode mode, as
		modified by the process's mode mask (see umask(2)).
	So, to the behavior is not parallel with inc(1) which does an
	explicit chmod(2).
Priority: LOW
Fix:	Apply this patch so that rcvstore does an explicit chmod to
	the new message just like inc does.

*** mh-6.6/uip/rcvstore.c.orig	Thu Oct 29 15:02:41 1987
--- mh-6.6/uip/rcvstore.c	Wed May 24 16:48:16 1989
***************
*** 161,166 ****
--- 161,168 ----
      if ((fd = creat (cp = m_scratch ("", invo_name), m_gmprot ())) == NOTOK)
  	adios (cp, "unable to create");
  
+     (void) chmod (cp, m_gmprot ()); /* creat ANDs with umask, do it right */
+ 
      cpydata (fileno (stdin), fd, "standard input", cp);
  
      if (fstat (fd, &st) == NOTOK) {

Enjoy!
--
Mark D. Baushke
UUCP:	    {3comvax,auspex,sun}!bridge2!mdb
Internet:   <@[129.213.128.4]:mdb@bridge2.ESD.3Com.COM>
Nameserver: mdb@bridge2.ESD.3Com.COM
(We should have a secondary nameserver real soon now...leading to having our
new A (and MX) records properly being published by the root nameservers.)
Technical Details
Message-ID: <MDB.89May24171553@kosciusko.ESD.3Com.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!oliveb!tymix!3comvax!bridge2!mdb

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!apple!oliveb!tymix!3comvax!bridge2!mdb
From: mdb@bridge2.ESD.3Com.COM (Mark D. Baushke)
Newsgroups: comp.mail.mh,comp.sources.bugs
Subject: MH 6.6 bug in rcvstore (w/fix): mode not set to Msg-Protect correctly
Message-ID: <MDB.89May24171553@kosciusko.ESD.3Com.COM>
Date: 25 May 89 00:15:53 GMT
Sender: news@bridge2.ESD.3Com.COM
Distribution: comp
Organization: 3Com Corp., Mountain View, CA.
Lines: 55