From owner-cvs-all Tue Oct 20 21:38:47 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA15285 for cvs-all-outgoing; Tue, 20 Oct 1998 21:38:47 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA15280; Tue, 20 Oct 1998 21:38:46 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.1/8.9.1) id VAA01979; Tue, 20 Oct 1998 21:37:26 -0700 (PDT) (envelope-from dillon) Date: Tue, 20 Oct 1998 21:37:26 -0700 (PDT) From: Matthew Dillon Message-Id: <199810210437.VAA01979@apollo.backplane.com> To: Peter Wemm Cc: Bruce Evans , cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdio mktemp.c References: <199810210245.KAA14596@spinner.netplex.com.au> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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. (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