hi list, today i found something which i never had recognized before...;-) situation 1: if i touch a file as user "root" in /home/daniel and the "/home/daniel"-dir is 755, the user "wwwrun" (after "su - wwwrun") CANNOT remove the created file (mode 700, owned by root). situation 2: if i now "chmod 777 /home/daniel" the created file (still mode 700, owned by root) CAN be removed by the user "wwwrun"...very strange to me! does the worldwriteability of the dir have a higher priority than the permission-mode of the file itself (the file was mode 700 and owned by root!!)?! best regards, daniel -- Aufgepasst - jetzt viele 1&1 New WebHosting Pakete ohne Einrichtungsgebuehr + 1 Monat Grundgebuehrbefreiung! http://puretec.de/index.html?ac=OM.PU.PU003K00736T0492a
does the worldwriteability of the dir have a higher priority than the permission-mode of the file itself (the file was mode 700 and owned by root!!)?! yes, i root puts something in a directory, where another user has write permission, the other user can remove the file (but not modify!)
Markus -- _____________________________ /"\ Markus Gaugusch ICQ 11374583 \ / ASCII Ribbon Campaign markus@gaugusch.dhs.org X Against HTML Mail / \
On Wed, Aug 08, 2001 at 04:41:37PM +0200, Daniel Quappe wrote:
today i found something which i never had recognized before...;-)
situation 1: if i touch a file as user "root" in /home/daniel and the "/home/daniel"-dir is 755, the user "wwwrun" (after "su - wwwrun") CANNOT remove the created file (mode 700, owned by root).
situation 2: if i now "chmod 777 /home/daniel" the created file (still mode 700, owned by root) CAN be removed by the user "wwwrun"...very strange to me!
does the worldwriteability of the dir have a higher priority than the permission-mode of the file itself (the file was mode 700 and owned by root!!)?!
Yes. Deleting a file means to remove the link to it from the directory. If you can write to the directory, you can remove the link and hence delete the file. Best regards, Lutz -- Lutz Jaenicke Lutz.Jaenicke@aet.TU-Cottbus.DE BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/ Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129 Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
Daniel Quappe wrote:
hi list,
today i found something which i never had recognized before...;-)
situation 1: if i touch a file as user "root" in /home/daniel and the "/home/daniel"-dir is 755, the user "wwwrun" (after "su - wwwrun") CANNOT remove the created file (mode 700, owned by root).
situation 2: if i now "chmod 777 /home/daniel" the created file (still mode 700, owned by root) CAN be removed by the user "wwwrun"...very strange to me!
does the worldwriteability of the dir have a higher priority than the permission-mode of the file itself (the file was mode 700 and owned by root!!)?!
best regards,
daniel
Look at it this way: in situation 2, if wwwrun deletes the file this only affects the contents of the _directory_. The contents of the _file_ is neither read nor changed! I agree completely that this may be _unexpected_ behavior to many people but it is systematic according to the simple rules. Directories are like Textfiles with a lot of lines in it saying: name abc is a shortcut for inode 4711. If you have write-access to a directory, you may change the content of the directory (this "file"). And every single line may me changed (or even deleted) by everyone having write-access! Access-rights for a directory mean nothing to the _contents_ of the files... regards Roland
participants (4)
-
Daniel Quappe
-
Lutz Jaenicke
-
Markus Gaugusch
-
Roland Hilkenbach