[aklug] Re: Linux/BSD: Why do directories need to be empty?

From: Christopher Howard <christopher.howard@frigidcode.com>
Date: Sat May 14 2011 - 19:46:12 AKDT

On 05/14/2011 03:56 PM, Jeremy Austin wrote:
> On Sat, May 14, 2011 at 3:51 PM, Christopher Howard <
> christopher.howard@frigidcode.com> wrote:
>
>>
>> This was kind of problematic for me the other day because I had a script
>> that was supposed to "rm -rf" a certain backup directory, but it
>> actually wasn't doing it completely because there were some
>> subdirectories that didn't have their write permission bits set.
>
>
> Maybe this is exactly the reason.
>
> If I am the owner of a directory, and you the owner of a subdirectory, you
> might be quite put out if I deleted your files by deleting the parent
> directory.
>
> jermudgeon
>
>
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>

But by your logic, you shouldn't be able to delete my files either.

owner,type,name,perms

|Your directory "a" rwxr-xr-x
|
\__My file "b" rw-r--r--
|
\__My directory "c" rwxr-xr--x
   |
   \__My file "d" rw-r--r--

Under this scenario you can delete "b", but you can't delete "c" (Error:
Directory is not empty) because you can't delete "d" (Error: Permission
denied). However, if there was no "d", then you would be able to delete
both "b" and "c".

So my files are totally and irrevocably mine, but only if they happen to
be in one of my subdirectories? That doesn't make much sense.

-- 
frigidcode.com
theologia.indicium.us
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat May 14 19:45:56 2011

This archive was generated by hypermail 2.1.8 : Sat May 14 2011 - 19:45:56 AKDT