vfs_syscalls.c::flags_to_right(): O_DSYNC should be allowed for CAP_FSYNC

Noted by:	arrowd
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D53315
This commit is contained in:
Konstantin Belousov committed 2025-10-24 19:09:25 +03:00
1 parent 4dbe662817
commit 5e85f383da
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -281,7 +281,8 @@ Permit
and
.Xr openat 2
with
.Dv O_FSYNC
.Dv O_DSYNC ,
.Dv O_FSYNC ,
or
.Dv O_SYNC
flag.
+1 -1
View File
@@ -1119,7 +1119,7 @@ flags_to_rights(int flags, cap_rights_t *rightsp)
if (flags & O_TRUNC)
cap_rights_set_one(rightsp, CAP_FTRUNCATE);
if (flags & (O_SYNC | O_FSYNC))
if (flags & (O_SYNC | O_FSYNC | O_DSYNC))
cap_rights_set_one(rightsp, CAP_FSYNC);
if (flags & (O_EXLOCK | O_SHLOCK))