Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/c063 O_SEARCH tests: expect revoke +x failure...
details: https://anonhg.NetBSD.org/src/rev/1c9562935ba9
branches: trunk
changeset: 1007169:1c9562935ba9
user: kamil <kamil%NetBSD.org@localhost>
date: Sat Feb 08 19:58:36 2020 +0000
description:
O_SEARCH tests: expect revoke +x failure on NFS
Patch by Kyle Evans (FreeBSD)
PR misc/54946
diffstat:
tests/lib/libc/c063/t_o_search.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diffs (59 lines):
diff -r 95f16625b3ba -r 1c9562935ba9 tests/lib/libc/c063/t_o_search.c
--- a/tests/lib/libc/c063/t_o_search.c Sat Feb 08 17:06:03 2020 +0000
+++ b/tests/lib/libc/c063/t_o_search.c Sat Feb 08 19:58:36 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18:06 martin Exp $ */
+/* $NetBSD: t_o_search.c,v 1.10 2020/02/08 19:58:36 kamil Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,11 +29,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_o_search.c,v 1.9 2020/02/06 12:18:06 martin Exp $");
+__RCSID("$NetBSD: t_o_search.c,v 1.10 2020/02/08 19:58:36 kamil Exp $");
#include <atf-c.h>
#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/statvfs.h>
#include <sys/stat.h>
#include <dirent.h>
@@ -55,6 +57,11 @@
#define USE_O_SEARCH
#endif
+#ifdef __FreeBSD__
+#define statvfs statfs
+#define fstatvfs fstatfs
+#endif
+
#define DIR "dir"
#define FILE "dir/o_search"
#define BASEFILE "o_search"
@@ -311,8 +318,9 @@
}
ATF_TC_BODY(o_search_revokex, tc)
{
+ struct statvfs vst;
+ struct stat sb;
int dfd, fd;
- struct stat sb;
ATF_REQUIRE(mkdir(DIR, 0755) == 0);
ATF_REQUIRE((fd = open(FILE, O_CREAT|O_RDWR, 0644)) != -1);
@@ -322,6 +330,11 @@
/* Drop permissions. The kernel must still not check the exec bit. */
ATF_REQUIRE(chmod(DIR, 0000) == 0);
+
+ fstatvfs(dfd, &vst);
+ if (strcmp(vst.f_fstypename, "nfs") == 0)
+ atf_tc_expect_fail("NFS protocol cannot observe O_SEARCH semantics");
+
ATF_REQUIRE(fstatat(dfd, BASEFILE, &sb, 0) == 0);
ATF_REQUIRE(close(dfd) == 0);
Home |
Main Index |
Thread Index |
Old Index