-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fsinfo: include access bits for cockpit-files #21596
Comments
This would be opt-in like everything else, in the So this seems fine to me. |
I think this makes sense, subject to:
|
One more: please make sure to use |
It doesn't look like Python passes |
Just checked the Python bug tracker and there is no issue yet for supporting passing |
For cockpit-files it is useful to know if the current watched directory or for example a text file is editable for the current user. Doing this based on the existing file permissions doesn't take ACL's into account. The `access` syscall only handles one access check (read/write/execute) per call making it rather inefficient to check for multiple scenario's, so that's why there are separate attrs depending on what the user want so in worst case we only add 1 extra syscall. As Python does not support AT_EMPTY_PATH there is a workaround to read the file from /proc/self this is only required for reading the access bits of the current watched directory. Closes: cockpit-project#21596
Honestly, this is not the worst:
Also note that |
For cockpit-files it is useful to know if the current watched directory or for example a text file is editable for the current user. Doing this based on the existing file permissions doesn't take ACL's into account. The `access` syscall only handles one access check (read/write/execute) per call making it rather inefficient to check for multiple scenario's, so that's why there are separate attrs depending on what the user want so in worst case we only add 1 extra syscall. As Python does not support AT_EMPTY_PATH there is a workaround to read the file from /proc/self this is only required for reading the access bits of the current watched directory. Closes: cockpit-project#21596
In cockpit-files in some places we now check for file read/write or directory read/write with
test -w
, however this is something fsinfo could provide!When watching a directory
fsinfo
already reacts on changes to files and the directory itself when permissions change except for ACL's. (Callingsetfacl
on a file gives no change event).It seems we do watch for ATTRIB changes but they aren't send as updates.
We could provide if a file is readable / writeable and also for
cwdInfo
(the watched directory) with:Sadly
os.access
returns a boolean and not a bitmask so we would need 2 extra syscalls per file, unless I am missing something. I have tested ACL's andos.access
takes those into account.ACL Demo
As the access man page mentions something about ACL's not working on older glib'cs I tested on rhel-8-10 and there ACL's are accounted for.
The text was updated successfully, but these errors were encountered: