diff options
| author | Rick Macklem <rmacklem@FreeBSD.org> | 2025-05-04 21:58:56 +0000 |
|---|---|---|
| committer | Rick Macklem <rmacklem@FreeBSD.org> | 2025-05-04 21:58:56 +0000 |
| commit | f61844833ee8e39f7568b27f562d7e26897bb73d (patch) | |
| tree | 762ada5f262a259192e3844faa5cb1abc19d7cc6 | |
| parent | 9639de2a6f7eec8b2158782fbfab3419d507fdc5 (diff) | |
vfs_vnops.c: Make O_NAMEDATTR Solaris compatible
When the O_XATTR flag is used in a Solaris open(2),
the named attribute directory is created, if it does
not already exist. (Solaris does not require or allow
O_CREAT for this case.)
The consensus on the mailing list was that O_NAMEDATTR
should behave the same way, as in "create the named
attribute directory if it does not exist even if O_CREAT
is not specified.
This patch makes this change. Note that CREATENAMED is
still useful for the NFSv4 server.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D50139
Fixes: 2ec2ba7e232d ("vfs: Add VFS/syscall support for Solaris style extended attributes")
| -rw-r--r-- | sys/kern/vfs_vnops.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index f1d3ba2ac08b..eaa1d298bdc6 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -208,11 +208,8 @@ open2nameif(int fmode, u_int vn_open_flags) res |= OPENREAD; if ((fmode & FWRITE) != 0) res |= OPENWRITE; - if ((fmode & O_NAMEDATTR) != 0) { - res |= OPENNAMED; - if ((fmode & O_CREAT) != 0) - res |= CREATENAMED; - } + if ((fmode & O_NAMEDATTR) != 0) + res |= OPENNAMED | CREATENAMED; if ((vn_open_flags & VN_OPEN_NOAUDIT) == 0) res |= AUDITVNODE1; if ((vn_open_flags & VN_OPEN_NOCAPCHECK) != 0) |
