summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2014-10-21 18:10:05 +0000
committerngie <ngie@FreeBSD.org>2014-10-21 18:10:05 +0000
commitde5d2aed228b369a9376232eb04089d856fcf9f7 (patch)
tree70740a01673bfe04691bf9af4397a0339be5b985 /contrib/netbsd-tests
parent4407112560047b3197089512cd629830a9d3dc4f (diff)
downloadFreeBSD-src-de5d2aed228b369a9376232eb04089d856fcf9f7.zip
FreeBSD-src-de5d2aed228b369a9376232eb04089d856fcf9f7.tar.gz
Port t_chroot to FreeBSD
- Add missing #include sys/stat.h for mkdir(2) - Omit the fchroot(2) tests because the support is not present on FreeBSD Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_chroot.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_chroot.c b/contrib/netbsd-tests/lib/libc/sys/t_chroot.c
index ce71708..651dc10 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_chroot.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_chroot.c
@@ -42,6 +42,10 @@ __RCSID("$NetBSD: t_chroot.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $");
#include <string.h>
#include <unistd.h>
+#ifdef __FreeBSD__
+#include <sys/stat.h>
+#endif
+
ATF_TC(chroot_basic);
ATF_TC_HEAD(chroot_basic, tc)
{
@@ -167,6 +171,7 @@ ATF_TC_BODY(chroot_perm, tc)
atf_tc_fail("chroot(2) succeeded as unprivileged user");
}
+#ifdef __NetBSD__
ATF_TC(fchroot_basic);
ATF_TC_HEAD(fchroot_basic, tc)
{
@@ -298,6 +303,7 @@ ATF_TC_BODY(fchroot_perm, tc)
if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
atf_tc_fail("fchroot(2) succeeded as unprivileged user");
}
+#endif
ATF_TP_ADD_TCS(tp)
{
@@ -305,9 +311,11 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, chroot_basic);
ATF_TP_ADD_TC(tp, chroot_err);
ATF_TP_ADD_TC(tp, chroot_perm);
+#ifdef __NetBSD__
ATF_TP_ADD_TC(tp, fchroot_basic);
ATF_TP_ADD_TC(tp, fchroot_err);
ATF_TP_ADD_TC(tp, fchroot_perm);
+#endif
return atf_no_error();
}
OpenPOWER on IntegriCloud