Re: [PATCH] new syscall: flink

Miquel van Smoorenburg
2003-04-07T07:18:02Z

In article <b6qruf$elf$1@cesium.transmeta.com>,
H. Peter Anvin <hpa@zytor.com> wrote:
>Followup to:
><Pine.BSO.4.44.0304062250250.9407-100000@kwalitee.nolab.conman.org>
>By author: Mark Grosberg <mark@nolab.conman.org>
>> As far as I understand it, isn't the protection information stored in the
>> inode? The flink call is just linking an inode into a directory that the
>> caller has write access to. The permissions and ownership of the file
>> shouldn't change.
>
>The problem is when you get passed a file descriptor from another
>process (via exec or file-descriptor passing) and you don't have
>permissions to access the *directory*.

Can't you just check those permissions, i.e. behave like link() ?
If you cant't access the path to the file, don't permit flink() ?

Mike.
--
Linux isnt at war. War involves large numbers of people making losing decisions
that harm each other in a vain attempt to lose last. Linux is about winning.
-- Alan Cox, linux-kernel, <E1276kG-00019y-00@the-village.bc.nu>