summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/tempnam.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-09-05 21:18:17 +0000
committerderaadt <deraadt@openbsd.org>1996-09-05 21:18:17 +0000
commit2e3bbee5ed561770d8c50722c6c9a83e0cf73231 (patch)
treecb2f76cd4f971800c602874bec0773deb2b5ac47 /lib/libc/stdio/tempnam.c
parentld has some funny things going with alignments... (diff)
downloadwireguard-openbsd-2e3bbee5ed561770d8c50722c6c9a83e0cf73231.tar.xz
wireguard-openbsd-2e3bbee5ed561770d8c50722c6c9a83e0cf73231.zip
issetugid backwards, duh; thanks bitblt
Diffstat (limited to 'lib/libc/stdio/tempnam.c')
-rw-r--r--lib/libc/stdio/tempnam.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/tempnam.c b/lib/libc/stdio/tempnam.c
index 5c7a8150955..9795696b8b0 100644
--- a/lib/libc/stdio/tempnam.c
+++ b/lib/libc/stdio/tempnam.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: tempnam.c,v 1.3 1996/08/25 10:11:08 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tempnam.c,v 1.4 1996/09/05 21:18:17 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -56,7 +56,7 @@ tempnam(dir, pfx)
if (!pfx)
pfx = "tmp.";
- if (issetugid() && (f = getenv("TMPDIR"))) {
+ if (issetugid() == 0 && (f = getenv("TMPDIR"))) {
(void)snprintf(name, MAXPATHLEN, "%s%s%sXXXXXX", f,
*(f + strlen(f) - 1) == '/'? "": "/", pfx);
if (f = mktemp(name))