X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/12408a1b16c3ce5b7e203bec879ceb3d67ae09a8..fe53310bc2e7636f1dd16001684d0c5d936cd292:/openssh/openbsd-compat/mktemp.c diff --git a/openssh/openbsd-compat/mktemp.c b/openssh/openbsd-compat/mktemp.c index aff8d20..9ed1bc8 100644 --- a/openssh/openbsd-compat/mktemp.c +++ b/openssh/openbsd-compat/mktemp.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/stdio/mktemp.c */ - /* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */ /* Changes: Removed mktemp */ @@ -15,7 +13,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -34,10 +36,10 @@ #include "includes.h" -#if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) +#ifndef HAVE_MKDTEMP #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: mktemp.c,v 1.17 2003/06/02 20:18:37 millert Exp $"; +static char rcsid[] = "$OpenBSD: mktemp.c,v 1.13 1998/06/30 23:03:13 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #ifdef HAVE_CYGWIN @@ -82,8 +84,7 @@ _gettemp(path, doopen, domkdir, slen) { register char *start, *trv, *suffp; struct stat sbuf; - int rval; - pid_t pid; + int pid, rval; if (doopen && domkdir) { errno = EINVAL; @@ -100,11 +101,11 @@ _gettemp(path, doopen, domkdir, slen) return (0); } pid = getpid(); - while (trv >= path && *trv == 'X' && pid != 0) { + while (*trv == 'X' && pid != 0) { *trv-- = (pid % 10) + '0'; pid /= 10; } - while (trv >= path && *trv == 'X') { + while (*trv == 'X') { char c; pid = (arc4random() & 0xffff) % (26+26); @@ -179,4 +180,4 @@ _gettemp(path, doopen, domkdir, slen) /*NOTREACHED*/ } -#endif /* !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) */ +#endif /* !HAVE_MKDTEMP */