|
|
Subscribe / Log in / New account

trusted_for() bounces off the merge window

trusted_for() bounces off the merge window

Posted Apr 14, 2022 0:28 UTC (Thu) by clay.sweetser@gmail.com (guest, #155278)
In reply to: trusted_for() bounces off the merge window by simcop2387
Parent article: trusted_for() bounces off the merge window

Huh, I didn't know that. I had assumed that a file descriptor kept a snapshot of the file's permissions when it was initially created, and so would not be affected by future permission changes.


to post comments

trusted_for() bounces off the merge window

Posted Apr 14, 2022 2:10 UTC (Thu) by NYKevin (subscriber, #129325) [Link]

A file descriptor *does* do that, sort of. It's just that the permissions it keeps track of are O_RDONLY, O_WRONLY, etc., rather than S_IRUSR etc. (i.e. it keeps track of what you asked to do when you called open(2), not what stat(2) or access(2) would have told you). That's probably why the first version of this patch was attempting to add a flag to open(2).


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds