From owner-freebsd-hackers Tue Dec 17 23:28:37 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id XAA21670 for hackers-outgoing; Tue, 17 Dec 1996 23:28:37 -0800 (PST) Received: from scanner.worldgate.com (scanner.worldgate.com [198.161.84.3]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id XAA21665 for ; Tue, 17 Dec 1996 23:28:35 -0800 (PST) Received: from znep.com (uucp@localhost) by scanner.worldgate.com (8.7.5/8.7.3) with UUCP id AAA16365 for hackers@freebsd.org; Wed, 18 Dec 1996 00:28:28 -0700 (MST) Received: from localhost (marcs@localhost) by alive.ampr.ab.ca (8.7.5/8.7.3) with SMTP id AAA20619 for ; Wed, 18 Dec 1996 00:28:16 -0700 (MST) Date: Wed, 18 Dec 1996 00:28:16 -0700 (MST) From: Marc Slemko X-Sender: marcs@alive.ampr.ab.ca To: hackers@freebsd.org Subject: any race conditions in this code? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Off the top of my head: char *foo; foo = mktemp(strdup("/tmp/foo.XXXXXX")); if (mkdir(foo, DEFFILEMODE) != 0) { /* die a horrible death */ exit(1); } /* do something with the directory */ I don't see any race conditions in there that could cause a security problem; the mkdir could be made to fail, but then it simply exits. It isn't as if it were creating a file and writing to it. Anyone care to disagree?