Subject: Re: [netatalk-admins] NFS/SMB/Appleshare on the same file system

From: "Michael Rothwell" <[email-masked]>
Date: Sun, 13 Jul 1997 20:47:09 -0400

> The unix host won't delete a non-empty directory, even if it looks
> empty because the files in it are hidden.

# rm -r *

--- Kills 'em dead.

---

From: [email-masked] (Paul M. Lambert)
Date: Sun, 13 Jul 1997 18:10:07 -0700 (PDT)

> > empty because the files in it are hidden.

Yep, if you have access to a command line.

Typically, the problem is this:  the user does not.  They only have access
through samba/netatalk/whatever.

In this case, their local machine does not see any files in the folder/dir
and so tells the host to delete it.

The host attempts to do so, and it cannot, because there are files in it.

This will, in almost every case, result in a very confused user.  ;-)

It would be possible, as someone mentioned, to patch netatalk and samba
to allow recursive deletion of directories which only contain "invisible"
files.

This would take a small amount of work, however.

The alternative would be to always trust the client, and delete all dirs
recursively when the client asks for the directory to be deleted.  However,
I don't know if the "can't do that, there are files" error typically comes
from the application level, or filesystem level...

--Paul

---

From: Michael Stone <[email-masked]>
Date: Sun, 13 Jul 1997 21:28:56 -0400

Quoting Michael Rothwell ([email-masked]):
[I said that even if the .AppleDouble directories are hidden,
they can still cause problems]
> # rm -r *

Argh. Ok, scenario 1: User 1 creates directory foo (perm 775)
, but doesn't use netatalk. User 2 goes into user1's directory 
with netatalk, umask 022. User 1 decides to get rid of foo. 
Uh, oh, he can't delete user 2's files from .AppleDouble, so
the system won't let him remove the directory.

scenario 2: user1 is a unix newbie, but knows how to create a 
directory. So, he creates a directory 'bar' from a shell and
later enters it using netatalk. He gets tired of that directory
and decides to get rid of it. He does 'cd bar; rm *; cd ..;
rmdir bar'. user1 then calls for help because the machine 
won't let him get rid of his directory. It keeps telling
him the directory is empty, even though 'ls' doesn't show
any files.

scenario 3: user1 has gotten into the habit of always using
'rm -r', because that's the way to get rid of .AppleDouble.
So now when he tries to get rid of directory foobar, he does
'cd ..; rm -r *'. Oops. user1 then calls for help because all 
his files are gone.

I admit these are a bit contrived (though I have seen similar
situations) but the point is, why create potential problems
if they can at all be avoided? No, you can't protect users
(or sysadmins) from everything, but you do the best you can.

-- 
Michael Stone, Sysadmin, ITRI
[email-masked] 
PGP: finger, or email with "Subject: get pgp key"

---

From: Scott Schatzer <[email-masked]>
Date: Sun, 13 Jul 1997 23:45:26 -0400 (EDT)

On Sun, 13 Jul 1997, Michael Stone wrote:

> Date: Sun, 13 Jul 1997 21:28:56 -0400
> From: Michael Stone <[email-masked]>
> To: Michael Rothwell <[email-masked]>
> Cc: [email-masked]
> Subject: Re: [netatalk-admins] NFS/SMB/Appleshare on the same file system
> 
Sounds like creative use of the "s" bit could overcome some of these 
problems.  As well, Sysadmins may want to try aliasing rm to "rm -i" for 
newbie users so they are prompted before trashing dirs......

--Scott S.

---------------------------------------------------------------------
Scott Schatzer                   | CIESIN
Systems Administrator            | The Consortium for International
[email-masked]        | Earth Science Information Network
Phone: 517-797-2679              | 2250 Pierce Rd.
Fax:   517-797-2622              | University Center, MI  48710
http://www.ciesin.org            |                               
=====================================================================