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

Mark D. Baushke mdb at bridge2.ESD.3Com.COM
Thu May 25 10:15:53 AEST 1989


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 at bridge2.ESD.3Com.COM>
Nameserver: mdb at 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.)



More information about the Comp.sources.bugs mailing list