Fix Capsicum syscalls test suite.
This commit is contained in:
parent
a687854894
commit
6a23219376
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user