git: dbdb47165ad3 - stable/14 - 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, 31 Oct 2025 14:42:39 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=dbdb47165ad3cb1b23625510cf4a9d872b93c48c
commit dbdb47165ad3cb1b23625510cf4a9d872b93c48c
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-10-24 09:42:35 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-10-31 14:42:17 +0000
vfs_syscalls.c::flags_to_right(): O_DSYNC should be allowed for CAP_FSYNC
(cherry picked from commit 5e85f383da6661bf29ca6054a330406889d8ac60)
---
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 2d44a1060006..6669f75e1674 100644
--- a/share/man/man4/rights.4
+++ b/share/man/man4/rights.4
@@ -276,7 +276,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 9c5c5b9dfa80..99f9e129f4cd 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1074,7 +1074,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))