diff options
author | djm <djm> | 2011-09-23 00:47:29 +0000 |
---|---|---|
committer | djm <djm> | 2011-09-23 00:47:29 +0000 |
commit | e121cbcc5b798a156b0984adff982af7a23333a1 (patch) | |
tree | 7bf8e6720881e898d22e30c60f483a539eb83d23 | |
parent | cc803f4892d99ad66fa91e20fba2c5c355643542 (diff) | |
download | openssh-e121cbcc5b798a156b0984adff982af7a23333a1.tar.gz |
- 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-- | ChangeLog | 4 | ||||
-rw-r--r-- | openbsd-compat/mktemp.c | 22 |
2 files changed, 5 insertions, 21 deletions
@@ -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 = |