Re: what's next for the linux kernel?

From: Marc Perkel
Date: Wed Oct 05 2005 - 15:06:02 EST




Lennart Sorensen wrote:

On Wed, Oct 05, 2005 at 12:44:25PM -0700, Marc Perkel wrote:


What you don't get is that if you don't have rights to write to a file then you shouldn't have the right to delete the file. Once you get past the "inside the box" Unix thinking you'll see the logic in this. So what if the process of deleting a file involves writing to it. That's not relevant.



When a system supports hardlinks, it IS relevant.

So if I decide I want a link to a file like say /etc/group in my home
dir (let us pretend they are on the same partition) so I make a hardlink
to it in my home dir and end up with a file still owned by root (since I
shouldn't be able to add me as owner to the file just by linking to it
after all). Should I now have to go bother the admin about deleting the
file from my home dir if I decide that wasn't really what I wanted? If
I didn't have write permissions to the dir I wouldn't have been able to
make the link in the first place, so since I made it I should be able to
delete it, and I can with the unix way of doing things. I still can't
edit it anymore than I could in the original place since it linked with
the new link to the file having the excact same permissions as the
original. Only someone like root can go chance the owner of a hardlink
to someone else and start setting up some interesting file permissions
using multiple hardlinks to one file.

I suspect you can't do that on netware, so you would have to add
explicit permissions for each user to a single copy of the file instead,
and you would probably want them all to have read/write access but in
fact NOT have delete permissions.

Len Sorensen


What you don't understand is that Netware's permissions mechanish is totally different that Linux. A hard link in Netware wouldn't inherit rights the way Linux does. So the user would have rights to their hard link to delete that link without having rights to unlink the file.

This is an important concept so pay attention. Linux stores all the permission to a file with that file entry. Netware doesn't. Netware calculates effective rights from the parent directories and it is all inherited unless files or directoies are explicitly set differently. So if files are added to other people folders then those people get rights to it automatically without having to go to the second step of changing the file's permissions.


--
Marc Perkel - marc@xxxxxxxxxx

Spam Filter: http://www.junkemailfilter.com
My Blog: http://marc.perkel.com

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