git: 5e85f383da66 - main - vfs_syscalls.c::flags_to_right(): O_DSYNC should be allowed for CAP_FSYNC
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Oct 2025 16:15:04 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=5e85f383da6661bf29ca6054a330406889d8ac60
commit 5e85f383da6661bf29ca6054a330406889d8ac60
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-10-24 09:42:35 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-10-24 16:09:25 +0000
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
---
share/man/man4/rights.4 | 3 ++-
sys/kern/vfs_syscalls.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/share/man/man4/rights.4 b/share/man/man4/rights.4
index 8f5f6ad9c2d2..0223ba0b6b88 100644
--- a/share/man/man4/rights.4
+++ b/share/man/man4/rights.4
@@ -281,7 +281,8 @@ Permit
and
.Xr openat 2
with
-.Dv O_FSYNC
+.Dv O_DSYNC ,
+.Dv O_FSYNC ,
or
.Dv O_SYNC
flag.
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 9e1275359715..1a739d354f1f 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -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))