diff options
author | pjd <pjd@FreeBSD.org> | 2013-03-16 23:10:40 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2013-03-16 23:10:40 +0000 |
commit | c2c41ac818b26f3cd71a73cfc6a75d96551593cf (patch) | |
tree | 4af4e7f88d7e8ac5dce3da138cbb10692a408065 /tools/regression/security/cap_test | |
parent | 2c33737ccb39296e83e0325b02a83ee7e1c5c95f (diff) | |
download | FreeBSD-src-c2c41ac818b26f3cd71a73cfc6a75d96551593cf.zip FreeBSD-src-c2c41ac818b26f3cd71a73cfc6a75d96551593cf.tar.gz |
The mode argument for open(2)/openat(2) only makes sense if the O_CREAT flag
was given.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'tools/regression/security/cap_test')
-rw-r--r-- | tools/regression/security/cap_test/cap_test_capabilities.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/regression/security/cap_test/cap_test_capabilities.c b/tools/regression/security/cap_test/cap_test_capabilities.c index b6423f8..9702354 100644 --- a/tools/regression/security/cap_test/cap_test_capabilities.c +++ b/tools/regression/security/cap_test/cap_test_capabilities.c @@ -207,27 +207,27 @@ try_file_ops(int filefd, int dirfd, cap_rights_t rights) ret = openat(dirfd, "cap_fsync", O_CREAT, 0600); CHECK(ret >= 0); CHECK(close(ret) == 0); - ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDONLY, 0600); + ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDONLY); CHECK_RESULT(openat(O_FSYNC | O_RDONLY), CAP_FSYNC | CAP_READ | CAP_LOOKUP, ret >= 0); CHECK(ret == -1 || close(ret) == 0); - ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY, 0600); + ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY); CHECK_RESULT(openat(O_FSYNC | O_WRONLY), CAP_FSYNC | CAP_WRITE | CAP_LOOKUP, ret >= 0); CHECK(ret == -1 || close(ret) == 0); - ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR, 0600); + ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR); CHECK_RESULT(openat(O_FSYNC | O_RDWR), CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0); CHECK(ret == -1 || close(ret) == 0); - ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDONLY, 0600); + ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDONLY); CHECK_RESULT(openat(O_SYNC | O_RDONLY), CAP_FSYNC | CAP_READ | CAP_LOOKUP, ret >= 0); CHECK(ret == -1 || close(ret) == 0); - ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY, 0600); + ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY); CHECK_RESULT(openat(O_SYNC | O_WRONLY), CAP_FSYNC | CAP_WRITE | CAP_LOOKUP, ret >= 0); CHECK(ret == -1 || close(ret) == 0); - ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR, 0600); + ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR); CHECK_RESULT(openat(O_SYNC | O_RDWR), CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0); CHECK(ret == -1 || close(ret) == 0); |