Module Name:    src
Committed By:   dholland
Date:           Thu Aug 18 19:48:03 UTC 2011

Modified Files:
        src/tests/lib/libc/sys: t_truncate.c

Log Message:
Fix the errno tests so if someone messes up permission checks and it
fails, it won't trash your /root/profile. Instead, the victim will be
/usr/bin/fpr. This way it at least won't break the world.

XXX: this test should probably be testing such things in a rump namespace.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_truncate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_truncate.c
diff -u src/tests/lib/libc/sys/t_truncate.c:1.1 src/tests/lib/libc/sys/t_truncate.c:1.2
--- src/tests/lib/libc/sys/t_truncate.c:1.1	Thu Jul  7 06:57:54 2011
+++ src/tests/lib/libc/sys/t_truncate.c	Thu Aug 18 19:48:03 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_truncate.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $ */
+/* $NetBSD: t_truncate.c,v 1.2 2011/08/18 19:48:03 dholland Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_truncate.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $");
+__RCSID("$NetBSD: t_truncate.c,v 1.2 2011/08/18 19:48:03 dholland Exp $");
 
 #include <sys/stat.h>
 
@@ -160,7 +160,7 @@
 	ATF_REQUIRE_ERRNO(ENOENT, truncate("/a/b/c/d/e/f/g", 999) == -1);
 
 	errno = 0;
-	ATF_REQUIRE_ERRNO(EACCES, truncate("/root/.profile", 999) == -1);
+	ATF_REQUIRE_ERRNO(EACCES, truncate("/usr/bin/fpr", 999) == -1);
 }
 
 ATF_TP_ADD_TCS(tp)

Reply via email to