Thread (1 message) 1 message, 1 author, 2015-08-28

Re: [RFC v6 03/40] vfs: Add MAY_DELETE_SELF and MAY_DELETE_CHILD permission flags

From: J. Bruce Fields <hidden>
Date: 2015-08-28 21:57:58
Also in: linux-cifs, linux-fsdevel, linux-nfs, lkml

On Fri, Aug 28, 2015 at 02:36:15PM -0700, Andy Lutomirski wrote:
On Tue, Aug 4, 2015 at 4:53 AM, Andreas Gruenbacher
[off-list ref] wrote:
quoted
Normally, deleting a file requires write and execute access to the parent
directory.  With Richacls, a process with MAY_DELETE_SELF access to a file
may delete the file even without write access to the parent directory.

To support that, pass the MAY_DELETE_CHILD mask flag to inode_permission()
when checking for delete access inside a directory, and MAY_DELETE_SELF
when checking for delete access to a file itelf.

The MAY_DELETE_SELF permission does not override the sticky directory
check.  It probably should.
Silly question from the peanut gallery: is there any such thing as
opening an fd pointing at a file such that the "open file description"
(i.e. the struct file) captures the right to delete the file?

IOW do we need FMODE_DELETE_SELF?
I guess FMODE_READ and _WRITE make sense because we pass file
descriptors to read() and write().  But we don't have a way to pass a
file descriptor to an operation that deletes a file.

(I think Windows may be different in both respects, it might be
interesting to compare, but I really don't understand how it works...).

--b.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help