Re: rm files owned by root?

2005-01-03 Thread Florian Weimer
* Thomas Bushnell: Only if it's empty. You could rename it to /tmp on most installations, where it would be deleted after the next reboot. Both wrong. Removing a directory requires write permission on the directory itself, because you have to delete the . and .. links inside the

Re: rm files owned by root?

2005-01-02 Thread Ulrich Fürst
Bernd Eckenfels [EMAIL PROTECTED] wrote: This is a Unix FAQ. You can delete any file if you have write access to the directory. Actually you dont delete the file, you remove the link to the So if my /home/ is 775 and root.users and I'm in the group users I can delete everybody's home

Re: rm files owned by root?

2005-01-02 Thread Florian Weimer
* Ulrich Fürst: Bernd Eckenfels [EMAIL PROTECTED] wrote: This is a Unix FAQ. You can delete any file if you have write access to the directory. Actually you dont delete the file, you remove the link to the So if my /home/ is 775 and root.users and I'm in the group users I can delete

Re: rm files owned by root?

2005-01-02 Thread Bernd Eckenfels
In article [EMAIL PROTECTED] you wrote: So if my /home/ is 775 and root.users and I'm in the group users I can delete everybody's home directory? You need write access to the /home dir, then you can delete other uses homes. But to delete a directory, it must be empty. And you cant empty it if

Re: rm files owned by root?

2005-01-02 Thread David Mandelberg
Bernd Eckenfels wrote: But to delete a directory, it must be empty. That's not completely true. You can unlink() (delete) a directory without it being empty. rmdir won't do it, but it's possible. Note: don't do this unless absolutely necessary, and always remount the volume ro and fsck it after

Re: rm files owned by root?

2005-01-02 Thread Michael Stone
On Sun, Jan 02, 2005 at 10:33:00AM -0500, David Mandelberg wrote: Bernd Eckenfels wrote: But to delete a directory, it must be empty. That's not completely true. You can unlink() (delete) a directory without it being empty. rmdir won't do it, but it's possible. Not on linux. Mike Stone -- To

Re: rm files owned by root?

2005-01-02 Thread Bernd Eckenfels
In article [EMAIL PROTECTED] you wrote: Not on linux. Well, he can of course remove the directory entry with a fs debug tool or disk editor. But thats not possible with user rights w/o raw access richts to the device. However I think sys_unlink wont do it. I was looking for the source but this

Re: rm files owned by root?

2005-01-02 Thread Thomas Bushnell BSG
Florian Weimer [EMAIL PROTECTED] writes: * Ulrich Frst: Bernd Eckenfels [EMAIL PROTECTED] wrote: This is a Unix FAQ. You can delete any file if you have write access to the directory. Actually you dont delete the file, you remove the link to the So if my /home/ is 775 and

Re: rm files owned by root?

2005-01-02 Thread Bernd Eckenfels
In article [EMAIL PROTECTED] you wrote: Removing a directory requires write permission on the directory itself, because you have to delete the . and .. links inside the directory. no: [EMAIL PROTECTED]:~# mkdir /home/test [EMAIL PROTECTED]:~# chmod 0 /home/test [EMAIL PROTECTED]:~# ls -ld

Re: rm files owned by root?

2005-01-02 Thread Luis M
if you are in group adm and the /home allows adm group to write to it, you will be able to remove the directory test? inside /home/ to be right you will need to do this: as root: chmod 0700 /home mkdir /home/test chmod 0 /home/test ls -ld /home/test should show root:root owner of /home/test and

Re: rm files owned by root?

2005-01-02 Thread Stephen Gran
This one time, at band camp, Luis M said: if you are in group adm and the /home allows adm group to write to it, you will be able to remove the directory test? inside /home/ to be right you will need to do this: as root: chmod 0700 /home mkdir /home/test chmod 0 /home/test ls -ld

Re: rm files owned by root?

2005-01-02 Thread Bernd Eckenfels
In article [EMAIL PROTECTED] you wrote: if you are in group adm and the /home allows adm group to write to it, you will be able to remove the directory test? inside /home/ Yes, thats what this thread is about. I can remove an *empty* dir, even if i dont have permissions inside the dir. All I

rm files owned by root?

2004-12-29 Thread dekkker
Hi all, I'm seriously troubled by behaviour of my system I just encountered: If i do (as root): touch /home/user/a Then (as user); rm /home/user/a It asks if I want to remove this file, since it's write protected. If I say y, then the file gets deleted. But it shouldn't be! Should it?

Re: rm files owned by root?

2004-12-29 Thread Bartosz Fenski aka fEnIo
On Wed, Dec 29, 2004 at 08:22:08PM +0100, dekkker wrote: I'm seriously troubled by behaviour of my system I just encountered: If i do (as root): touch /home/user/a Then (as user); rm /home/user/a It asks if I want to remove this file, since it's write protected. If I say y, then the

Re: rm files owned by root?

2004-12-29 Thread Robert Vangel
afaik, its because the owner of the folder the file is located is has w permission. I could be wrong, but I was thinking about this myself a few days ago. dekkker wrote: Hi all, I'm seriously troubled by behaviour of my system I just encountered: If i do (as root): touch /home/user/a Then (as

Re: rm files owned by root?

2004-12-29 Thread Bernd Eckenfels
In article [EMAIL PROTECTED] you wrote: It asks if I want to remove this file, since it's write protected. If I say y, then the file gets deleted. But it shouldn't be! Should it? This is a Unix FAQ. You can delete any file if you have write access to the directory. Actually you dont delete the

Re: rm files owned by root?

2004-12-29 Thread Richard Atterer
On Wed, Dec 29, 2004 at 08:22:08PM +0100, dekkker wrote: It asks if I want to remove this file, since it's write protected. If I say y, then the file gets deleted. But it shouldn't be! Should it? As the others have said, this behaviour is to be expected. If your filesystem is ext2 or ext3,