Re: Proposal: restrict link(2)

Dan Merillat (
Fri, 13 Dec 1996 12:31:13 -0500 (EST)

On Fri, 13 Dec 1996, Steve VanDevender wrote:

> "And therefore modify?" I get the impression that some of the people
> who are arguing about this don't at all understand the semantics of
> link().
> If you link /etc/shadow to /tmp/shadow, you have done none of the
> following:
> * changed the permissions of /tmp/shadow
> * changed the owner or group owner of /tmp/shadow
> Not only have you not changed those, you cannot change those. You have
> created another reference to the inode, and that's all.

Theodore Y. Ts' <tytso@MIT.EDU> Writes:

> Incorrect. Being able to link to a file does not mean you can change
> it.

Sheesh. I said link() modifies a file. And it _DOES_ It changes the file
location, which _MAY_ change permissions of that file! (think of a group-only
directory and someone in that group makes a link outside of it)

It changes the lifespan of the file.
It takes control of the file away from the owner, who can no longer delete
the file.
link() in a directory you own, mode 700. Now the owner _CANNOT_
touch the file after they remove it! So yes, link() DOES modify a file
and nobody can claim it does not!