=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rdistd/server.c,v retrieving revision 1.40 retrieving revision 1.41 diff -c -r1.40 -r1.41 *** src/usr.bin/rdistd/server.c 2015/12/22 08:48:39 1.40 --- src/usr.bin/rdistd/server.c 2016/03/30 17:03:06 1.41 *************** *** 1,4 **** ! /* $OpenBSD: server.c,v 1.40 2015/12/22 08:48:39 mmcc Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: server.c,v 1.41 2016/03/30 17:03:06 millert Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. *************** *** 750,761 **** /* * Create temporary file */ ! if ((f = mkstemp(new)) < 0) { ! if (errno != ENOENT || chkparent(new, opts) < 0 || ! (f = mkstemp(new)) < 0) { ! error("%s: create failed: %s", new, SYSERR); ! return; ! } } /* --- 750,758 ---- /* * Create temporary file */ ! if (chkparent(new, opts) < 0 || (f = mkstemp(new)) < 0) { ! error("%s: create failed: %s", new, SYSERR); ! return; } /* *************** *** 1161,1173 **** /* * Make new symlink using a temporary name */ ! if (mktemp(new) == NULL || symlink(dbuf, new) < 0) { ! if (errno != ENOENT || chkparent(new, opts) < 0 || ! mktemp(new) == NULL || symlink(dbuf, new) < 0) { ! error("%s -> %s: symlink failed: %s", new, dbuf, ! SYSERR); ! return; ! } } /* --- 1158,1167 ---- /* * Make new symlink using a temporary name */ ! if (chkparent(new, opts) < 0 || mktemp(new) == NULL || ! symlink(dbuf, new) < 0) { ! error("%s -> %s: symlink failed: %s", new, dbuf, SYSERR); ! return; } /*