Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/sys Fix the errno tests so if someone messes ...
details: https://anonhg.NetBSD.org/src/rev/77de50a8e1a5
branches: trunk
changeset: 768538:77de50a8e1a5
user: dholland <dholland%NetBSD.org@localhost>
date: Thu Aug 18 19:48:03 2011 +0000
description:
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.
diffstat:
tests/lib/libc/sys/t_truncate.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r f2911bbeec30 -r 77de50a8e1a5 tests/lib/libc/sys/t_truncate.c
--- a/tests/lib/libc/sys/t_truncate.c Thu Aug 18 19:34:47 2011 +0000
+++ b/tests/lib/libc/sys/t_truncate.c Thu Aug 18 19:48:03 2011 +0000
@@ -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)
Home |
Main Index |
Thread Index |
Old Index