Date: Tue, 30 Aug 2016 19:58:41 +0000 (UTC) From: Mariusz Zaborski <oshogbo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305084 - head/tools/regression/capsicum/syscalls Message-ID: <201608301958.u7UJwf1G032550@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oshogbo Date: Tue Aug 30 19:58:41 2016 New Revision: 305084 URL: https://svnweb.freebsd.org/changeset/base/305084 Log: Fix Capsicum syscalls test suite. Modified: head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Modified: head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c ============================================================================== --- head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c Tue Aug 30 19:39:33 2016 (r305083) +++ head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c Tue Aug 30 19:58:41 2016 (r305084) @@ -157,13 +157,16 @@ static void fcntl_tests_1(int fd) { uint32_t fcntlrights; + cap_rights_t rights; CHECK(cap_fcntls_limit(fd, CAP_FCNTL_GETFL) == 0); fcntlrights = 0; CHECK(cap_fcntls_get(fd, &fcntlrights) == 0); CHECK(fcntlrights == CAP_FCNTL_GETFL); - CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_FCNTL) == 0); + CAP_ALL(&rights); + cap_rights_clear(&rights, CAP_FCNTL); + CHECK(cap_rights_limit(fd, &rights) == 0); fcntlrights = CAP_FCNTL_ALL; CHECK(cap_fcntls_get(fd, &fcntlrights) == 0); @@ -206,8 +209,11 @@ static void fcntl_tests_2(int fd) { uint32_t fcntlrights; + cap_rights_t rights; - CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_FCNTL) == 0); + CAP_ALL(&rights); + cap_rights_clear(&rights, CAP_FCNTL); + CHECK(cap_rights_limit(fd, &rights) == 0); fcntlrights = CAP_FCNTL_ALL; CHECK(cap_fcntls_get(fd, &fcntlrights) == 0); Modified: head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c ============================================================================== --- head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Tue Aug 30 19:39:33 2016 (r305083) +++ head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Tue Aug 30 19:58:41 2016 (r305084) @@ -131,6 +131,7 @@ static void ioctl_tests_1(int fd) { unsigned long cmds[2]; + cap_rights_t rights; cmds[0] = FIOCLEX; CHECK(cap_ioctls_limit(fd, cmds, 1) == 0); @@ -139,7 +140,10 @@ ioctl_tests_1(int fd) CHECK(cmds[0] == FIOCLEX); CHECK(cmds[1] == 0); - CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_IOCTL) == 0); + CAP_ALL(&rights); + cap_rights_clear(&rights, CAP_IOCTL); + + CHECK(cap_rights_limit(fd, &rights) == 0); CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0); cmds[0] = FIOCLEX; @@ -173,8 +177,12 @@ static void ioctl_tests_2(int fd) { unsigned long cmds[2]; + cap_rights_t rights; + + CAP_ALL(&rights); + cap_rights_clear(&rights, CAP_IOCTL); - CHECK(cap_rights_limit(fd, CAP_ALL & ~CAP_IOCTL) == 0); + CHECK(cap_rights_limit(fd, &rights) == 0); CHECK(cap_ioctls_get(fd, cmds, nitems(cmds)) == 0); cmds[0] = FIOCLEX;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608301958.u7UJwf1G032550>