Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Sep 1999 23:52:05 +0900
From:      Jun Kuriyama <kuriyama@sky.rim.or.jp>
To:        Documentation Team <freebsd-doc@freebsd.org>
Subject:   About www/en/security/security.sgml
Message-ID:  <14291.54548.4992.72159A@localhost.sky.rim.or.jp>

next in thread | raw e-mail | index | archive | help

When I try to translate this sentence, I cannot make clear whether
mkstemp() should be used or not.  Can someone clarify this?

--- www/en/security/security.sgml
<LI>Make sure to use mkstemp() instead of mktemp(), tempnam(), mkstemp() and
etc.  Also make sure to look for races in /tmp in general, being aware that
there are very few things which can be atomic in /tmp:
	<UL>
	<LI>Creating a directory.  This will either succeed or fail.</LI>
	<LI>Opening a file O_CREAT | O_EXECL</LI>
	</UL>
If you use mkstemp - above cases will be properly handled for you.  Hence
all temp files should use mkstemp() to guarantee there is not race
condition and that the permissions are correct.
<P></P></LI>
---


Jun Kuriyama // kuriyama@sky.rim.or.jp
            // kuriyama@FreeBSD.ORG


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14291.54548.4992.72159A>