summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-02-07 23:28:19 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-02-07 23:28:19 +0000
commita4ff7381f04668afa45cf3c6f47d64ae7457d927 (patch)
treef337507eb29bc6e4f8791615218356eaab534ec9
parent6f842c162291fdc33270be69240fc37a7b0c079b (diff)
More paranoia, make sure temp file owner matches real uid.
-rw-r--r--usr.bin/chpass/edit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c
index 62809bf8c28..63dee16093a 100644
--- a/usr.bin/chpass/edit.c
+++ b/usr.bin/chpass/edit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: edit.c,v 1.24 2003/02/02 18:38:22 millert Exp $ */
+/* $OpenBSD: edit.c,v 1.25 2003/02/07 23:28:18 millert Exp $ */
/* $NetBSD: edit.c,v 1.6 1996/05/15 21:50:45 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: edit.c,v 1.24 2003/02/02 18:38:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: edit.c,v 1.25 2003/02/07 23:28:18 millert Exp $";
#endif
#endif /* not lint */
@@ -160,7 +160,7 @@ verify(tempname, pw)
pw_error(tempname, 1, 1);
if (fstat(fd, &sb))
pw_error(tempname, 1, 1);
- if (sb.st_size == 0 || sb.st_nlink != 1) {
+ if (sb.st_size == 0 || sb.st_nlink != 1 || sb.st_uid != uid) {
warnx("corrupted temporary file");
goto bad;
}