[lkml]   [1998]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Idea: flink() and anon_open()
Albert D. Cahalan wrote:
> How is that worse than fchmod() on the file descriptor?
> If you own the inode, you can change the permission AFAIK.
> If you don't own the inode, getting a filename won't help you.

That's not the issue. If you open a file O_RDONLY and pass the fd off
to someone else (say, a subprocess running with the same credentials),
all they can do is read the file. If the file also exists in the
namespace, they can reopen it O_RDWR and modify the file. If flink()
exists, they can create their own name and open it with whatever mode
they like. This would break code which assumes that if it passes off a
RO file descriptor, that it will always be RO.

Naturally you can still fchmod the file, but if you're talking about the
case of an anonymous temp file, it doesn't matter what the permissions
are once its open and has no name.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to

 \ /
  Last update: 2005-03-22 13:41    [W:0.054 / U:6.496 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site