Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by krbdev.mit.edu (8.12.9) with ESMTP id m6I0lqo4001390; Thu, 17 Jul 2008 20:47:52 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id m6I0lkHo018416; Thu, 17 Jul 2008 20:47:46 -0400 (EDT) Received: from NOME-KING.MIT.EDU (NOME-KING.MIT.EDU [18.18.1.160]) (authenticated bits=0) (User authenticated as raeburn@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id m6I0ljjv002950 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 17 Jul 2008 20:47:45 -0400 (EDT) Message-ID: <3DD91FD0-AE54-4863-82CF-9DEE6D1621E6@mit.edu> From: Ken Raeburn To: rt-comment@krbdev.mit.edu In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Re: [krbdev.mit.edu #6002] krb5_rc_io_creat should use mkstemp MIME-Version: 1.0 (Apple Message framework v928.1) Date: Thu, 17 Jul 2008 20:47:44 -0400 References: X-Mailer: Apple Mail (2.928.1) X-Scanned-BY: MIMEDefang 2.42 X-Spam-Flag: NO X-Spam-Score: 0.00 RT-Send-Cc: X-RT-Original-Encoding: us-ascii Content-Length: 439 On Jul 17, 2008, at 11:02, Tom Yu via RT wrote: > mkstemp() does not take file mode flags, so to get the correct file > permissions on the file, we need to either use umask() (not > thread-friendly) or fchmod(). With fchmod, we would have a race condition where some other party could open the file after it was created but before the fchmod call. In the normal UNIX model, fchmod does not revoke access to an already opened file.