Skip to content

Commit

Permalink
Allow for different errors on invalid subrights
Browse files Browse the repository at this point in the history
Specifying subrights without the corresponding CAP_IOCTL/CAP_FCNTL
fails, but it can fail with different error value (ENOTCAPABLE, EINVAL).
  • Loading branch information
daviddrysdale committed Nov 13, 2015
1 parent 1739762 commit c12451a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fcntl.cc
Expand Up @@ -313,7 +313,7 @@ TEST(Fcntl, PreserveSubRights) {
EXPECT_OK(cap_rights_limit(fd, &rights));
EXPECT_OK(cap_fcntls_get(fd, &fcntls));
EXPECT_EQ((cap_fcntl_t)0, fcntls);
EXPECT_NOTCAPABLE(cap_fcntls_limit(fd, CAP_FCNTL_GETFL));
EXPECT_EQ(-1, cap_fcntls_limit(fd, CAP_FCNTL_GETFL));

close(fd);
unlink(TmpFile("cap_fcntl_subrightpreserve"));
Expand Down
2 changes: 1 addition & 1 deletion ioctl.cc
Expand Up @@ -102,7 +102,7 @@ TEST(Ioctl, PreserveSubRights) {
nioctls = cap_ioctls_get(fd, ioctls, 16);
EXPECT_OK(nioctls);
EXPECT_EQ(0, nioctls);
EXPECT_NOTCAPABLE(cap_ioctls_limit(fd, &ioctl_nread, 1));
EXPECT_EQ(-1, cap_ioctls_limit(fd, &ioctl_nread, 1));

close(fd);
}
Expand Down

0 comments on commit c12451a

Please sign in to comment.