Messages in this thread | | | Date | Tue, 23 Mar 1999 09:00:44 -0800 | From | Casey Schaufler <> | Subject | Re: [RFC] Rights for hardlinks |
| |
Arvind Sankar wrote: > > On Tue, Mar 23, 1999 at 10:11:08AM -0500, Alexander Viro wrote: > > > > Access != write permissions. > > I think he has a point, though. You can hardlink even to a file with 0 perms.
Yes. The link operation writes data to the directory containing the new link, but only to the attributes (link count) of the file. The access policy on the attributes is different from that of the data. If it were not, you couldn't stat a file with 000 perms, nor could you chmod it. Consider that the directory entry contains nothing but a mapping from a name component to file and that files can exist with any number (including zero) such directory entries and it doesn't matter to the file. The permissions on the file remain under the control of the owner at all times.
One might consider a policy which required that you be the owner of a file to link to it. This would be consistant with the general restriction that only the owner can update a file's security attributes (e.g. chmod) if you decided that the link count is a security attribute.
--
Casey Schaufler voice: (650) 933-1634 casey@sgi.com fax: (650) 933-0513
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |