diff options
author | Mariusz Zaborski <oshogbo@FreeBSD.org> | 2016-08-30 19:58:41 +0000 |
---|---|---|
committer | Mariusz Zaborski <oshogbo@FreeBSD.org> | 2016-08-30 19:58:41 +0000 |
commit | d7795033dd391c7fd45b3e6a5abad7d75669cf88 (patch) | |
tree | 4ea802b3ebba785041b8c0eac4b9d687010ae83d /tools/regression | |
parent | 66a5fa5d99e242b91d2151ecf06776d45112eaa0 (diff) | |
download | src-d7795033dd391c7fd45b3e6a5abad7d75669cf88.tar.gz src-d7795033dd391c7fd45b3e6a5abad7d75669cf88.zip |
Fix Capsicum syscalls test suite.
Notes
Notes:
svn path=/head/; revision=305084
Diffstat (limited to 'tools/regression')
-rw-r--r-- | tools/regression/capsicum/syscalls/cap_fcntls_limit.c | 10 | ||||
-rw-r--r-- | tools/regression/capsicum/syscalls/cap_ioctls_limit.c | 12 |
2 files changed, 18 insertions, 4 deletions
diff --git a/tools/regression/capsicum/syscalls/cap_fcntls_limit.c b/tools/regression/capsicum/syscalls/cap_fcntls_limit.c index f37710d9df12..e3a05bf66149 100644 --- a/tools/regression/capsicum/syscalls/cap_fcntls_limit.c +++ b/tools/regression/capsicum/syscalls/cap_fcntls_limit.c @@ -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); diff --git a/tools/regression/capsicum/syscalls/cap_ioctls_limit.c b/tools/regression/capsicum/syscalls/cap_ioctls_limit.c index 27d85896533f..2ed00f175469 100644 --- a/tools/regression/capsicum/syscalls/cap_ioctls_limit.c +++ b/tools/regression/capsicum/syscalls/cap_ioctls_limit.c @@ -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; |