summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-09-23 10:47:29 +1000
committerDamien Miller <djm@mindrot.org>2011-09-23 10:47:29 +1000
commit3a359b3228fae226d4d73e7b9021c15904d274b4 (patch)
treee95466df056e68230bfccf90c5af8393b8affc52
parentdc0e09b41c0de295e1c5d902a52343259130e76f (diff)
- millert@cvs.openbsd.org 2008/08/21 16:54:44
[mktemp.c] Remove useless code, the kernel will set errno appropriately if an element in the path does not exist. OK deraadt@ pvalchev@
-rw-r--r--ChangeLog4
-rw-r--r--openbsd-compat/mktemp.c22
2 files changed, 5 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dac102d..99292ce0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,10 @@
- deraadt@cvs.openbsd.org 2008/07/22 21:47:45
[mktemp.c]
use arc4random_uniform(); ok djm millert
+ - millert@cvs.openbsd.org 2008/08/21 16:54:44
+ [mktemp.c]
+ Remove useless code, the kernel will set errno appropriately if an
+ element in the path does not exist. OK deraadt@ pvalchev@
20110922
- OpenBSD CVS Sync
diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c
index 5bdf3e6d..94580652 100644
--- a/openbsd-compat/mktemp.c
+++ b/openbsd-compat/mktemp.c
@@ -1,7 +1,7 @@
/* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */
/* Changes: Removed mktemp */
-/* $OpenBSD: mktemp.c,v 1.21 2008/07/22 21:47:45 deraadt Exp $ */
+/* $OpenBSD: mktemp.c,v 1.22 2008/08/21 16:54:44 millert Exp $ */
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
@@ -112,26 +112,6 @@ _gettemp(path, doopen, domkdir, slen)
}
start = trv + 1;
- /* Check the target directory. */
- if (doopen || domkdir) {
- for (;; --trv) {
- if (trv <= path)
- break;
- if (*trv == '/') {
- *trv = '\0';
- rval = stat(path, &sbuf);
- *trv = '/';
- if (rval != 0)
- return(0);
- if (!S_ISDIR(sbuf.st_mode)) {
- errno = ENOTDIR;
- return(0);
- }
- break;
- }
- }
- }
-
for (;;) {
if (doopen) {
if ((*doopen =