diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2025-10-24 09:42:35 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2025-10-24 16:09:25 +0000 |
| commit | 5e85f383da6661bf29ca6054a330406889d8ac60 (patch) | |
| tree | 4aefbdc2e607eff409634f0cf6675095258c8d9b | |
| parent | 4dbe6628179d8e6bf400bfdb4bfa869bdc102a56 (diff) | |
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
| -rw-r--r-- | share/man/man4/rights.4 | 3 | ||||
| -rw-r--r-- | 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)) |
