Date: Tue, 20 Oct 1998 21:37:26 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Peter Wemm <peter@netplex.com.au> Cc: Bruce Evans <bde@zeta.org.au>, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdio mktemp.c Message-ID: <199810210437.VAA01979@apollo.backplane.com> References: <199810210245.KAA14596@spinner.netplex.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
I think the fchmod() idea after the open() is the right solution, but the manual page isn't 100% crystal clear because there is still an implied assumption that the umask will effect the file permissions on create as it does with other library calls. :-) I could go either way. My personal preference would be to fix the manual page to read 'mode 0600 masked by the current umask' and *not* put in the fchmod(), because I can certainly see a program expecting to create a file with read-only permissions by setting the umask and calling mkstemp() to get the read+write descriptor. It would be phenominally dumb programmer to depend on it, but I can see it. No matter what, though, 0666 is absolutely, definitely, wrong. And since I am not a phenominaly dumb programmer, the fchmod() to 0600 (and amending the manual page to clear up the umask confusion) works for me too. -Matt Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet Communications & God knows what else. <dillon@backplane.com> (Please include original email in any response) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810210437.VAA01979>