-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FreeBSD: handle UF_NOUNLINK
chflags fflag
#16820
base: master
Are you sure you want to change the base?
Conversation
The `UF_NOUNLINK` chflags fflag is analogous to `SF_NOUNLINK`, but instead of requiring superuser privileges when setting `SF_NOUNLINK`, unprivileged users (in addition to root) can set `UF_NOUNLINK` on compatible paths. This makes commands like `chflags uunlink <foo>` work on FreeBSD. This closes openzfs#16809. Signed-off-by: Enji Cooper <[email protected]>
d9bb3d0
to
d7d19bb
Compare
This unfortunately doesn't work with UID != 0 due to other permissions checks done in zfs/module/os/freebsd/zfs/zfs_vnops_os.c Lines 4836 to 4853 in d7d19bb
The preceding block is true for root (by default on FreeBSD/Linux). It's kind of an interesting assumption for the code to make. It's true most of the time, but not all of the time, based on my review of secpolicy_fs_owner .
|
|
Correct me if I am wrong but, but it seems you are mapping |
Yes -- mapping both of the constants to I noticed that yesterday when I was trying to figure out why unprivileged users couldn't unset I have a draft (not pushed yet), which will look at splitting up the UF and SF constants for APPENDONLY, NOUNLINK, and SPARSE, since the constants are buggy in different ways. I moved the PR back to Draft mode for clarity; the change is not ready for merge. |
The
UF_NOUNLINK
chflags fflag is analogous toSF_NOUNLINK
, but instead of requiring superuser privileges when settingSF_NOUNLINK
, unprivileged users (in addition to root) can setUF_NOUNLINK
on compatible paths.This makes commands like
chflags uunlink <foo>
work on FreeBSD.This closes #16809.
How Has This Been Tested?
An equivalent patch was tested on FreeBSD 15.0-CURRENT using a clone of a FreeBSD source tree fork.
Types of changes
Checklist:
Signed-off-by
.