The mode argument for open(2)/openat(2) only makes sense if the O_CREAT flag
was given. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
b16958a100
commit
ac978022d3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248394
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user