Re: [PATCH] new syscall: flink

Miquel van Smoorenburg (miquels@cistron-office.nl)
Mon, 7 Apr 2003 07:29:35 +0000 (UTC)


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>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/