Subject: [netatalk-admins] Fwd: Bug#36140: Cannot keep files in the Mac trash

From: Joel Klecker <[email-masked]>
Date: Fri, 16 Apr 1999 11:49:20 -0700

[ This is forwarded from the Debian Bug Tracking System, please keep 
[email-masked] in the cc list so any replies are 
recorded ]

Can anyone explain why this problem occurs, and what the solution is?

--- begin forwarded text

Subject: Bug#36140: Cannot keep files in the Mac trash
Reply-To: Francesco Potorti` <[email-masked]>, [email-masked]
Date: Thu, 15 Apr 1999 15:55:10 +0200 (CEST)
From: Francesco Potorti` <[email-masked]>
To: Debian Linux bug list <[email-masked]>
Organization: CNUCE-CNR, Via S.Maria 36, Pisa - Italy +39-050-593211

Package: netatalk
Version: 1.4b2+asun2.1.3-1
Severity: normal

Since upgrading to the latest version, I am forced to delete files that I
put in the trash, as a dialog box appears on the Mac teling that it cannot
keep files there, and it must delete them immediately.

--- end forwarded text

-- 
Joel Klecker (aka Espy)                    Debian GNU/Linux Developer
<URL:mailto:[email-masked]>                 <URL:mailto:[email-masked]>
<URL:http://web.espy.org/>               <URL:http://www.debian.org/>

---

From: thomas <[email-masked]>
Date: Sat, 17 Apr 1999 11:59:03 +0200 (CEST)

i guess that Your Network Trash Folder has not the right permissions for
the user You are logged in as when You get that behaviour
in our net we force that by creating a net.tr.folder with no write
permissions (or different owner/group) so removing on a shared volume
means REAL removing (and that should, i presume).

thomas

---

From: Francesco Potorti` <[email-masked]>
Date: Mon, 19 Apr 1999 18:43:19 +0200 (CEST)

Thanks for the pointer, but it seems that is not the case.  This is my
trash folder:

  /home/cng/data/Network Trash Folder:
  total 68
  drwx--Srwx  17 cng      share        4096 Mar 31 13:17 .
  drwxrwsr-x   9 cng      share        4096 Apr 19 18:38 ..
  drwx--Srwx   2 cng      share        4096 Jan 30  1998 .AppleDouble
  drwx--S---   3 cng      share        4096 Feb  9 17:18 Trash Can #10
  drwx--S---   3 cng      share        4096 Feb 18 13:37 Trash Can #11
  drwx--S---   3 cng      share        4096 Feb 23 16:31 Trash Can #12
  drwx--S---   4 cng      share        4096 Mar 22 15:10 Trash Can #13
  drwx--S---   4 cng      share        4096 Mar 31 13:17 Trash Can #14
  drwx--S---   3 cng      share        4096 Apr  6 13:05 Trash Can #15
  drwx--S---   3 cng      share        4096 Apr  1  1998 Trash Can #2
  drwx--S---   3 cng      share        4096 Apr 30  1998 Trash Can #3
  drwx--S---   4 cng      share        4096 Dec 14 14:27 Trash Can #4
  drwx--S---   3 cng      share        4096 Jan 12 17:56 Trash Can #5
  drwx--S---   3 cng      share        4096 Jan 14 16:23 Trash Can #6
  drwx--S---   3 cng      share        4096 Jan 15 12:36 Trash Can #7
  drwx--S---   3 cng      share        4096 Jan 22 17:05 Trash Can #8
  drwx--S---   4 cng      share        4096 Feb  8 13:47 Trash Can #9
  -rw----rw-   1 cng      share           0 Jan 30  1998 Trash Can Usage Map

As you  see rwx permissions for  the group are  missing I tried to  turn on
them all, but nothing changes.  On  the other hand, cng is the user logging
from the Mac, and it has all the permissions.

The fact is, before  it worked like it should: one could  put things in the
trash,  but would lose  them once  the disk  was unmounted.   Now, instead,
nothing can be put in the trash, everything is immediately deleted.

Thanks you

-- 
Francesco Potortì (researcher)         Voice:    +39-050-593 203 (op. 211)
Computer Networks Group                Fax:      +39-050-904052
CNUCE-CNR, Via Santa Maria 36          Email:    [email-masked]
56126 Pisa - Italy                     Web:	 http://fly.cnuce.cnr.it/

---

From: Patrik Schindler <[email-masked]>
Date: Mon, 19 Apr 1999 22:05:43 +0200

>nothing can be put in the trash, everything is immediately deleted.

Unmount all Volumes, delete the Network Trash Folder and try again.
I had Problems in this way, too. I tried to fix it with g+s, but this won't work. Too bad that I haven't still found out where and how the directory is created within afpd.

:wq! PoC

---

From: Francesco Potorti` <[email-masked]>
Date: Thu, 22 Apr 1999 11:52:37 +0200 (CEST)

I had the problem of not being  able to put things in a netatalk folder.  I
solved it  by simply  deleting the Network  trash Folder directory  and its
contents.  I really renamed it, and this  is a try to an explanation of the
problem, with  the help of those  who were so  kind to answer.  What  I say
will be necessarily  incomplete or partially wrong, as  I don't know enough
of how the Network trash  Folder and its ownerships/permissions are managed
by netatalk.

I have a setup where there is only one user, called cng, so everyone mounts
the voulume as user cng, and everything is visible by anyone.  This is the
trash after the only one user has just mounted the volume (status 1):

  /home/cng/data/Network Trash Folder:
  total 12
  drwx--Srwx   3 cng      share        4096 Apr 22 11:07 .
  drwxrwsr-x  10 cng      share        4096 Apr 22 11:08 ..
  drwx--Srwx   2 cng      share        4096 Apr 21 20:12 .AppleDouble
  -rw----rw-   1 cng      share           0 Apr 21 20:12 Trash Can Usage Map

and this  is after a file  has been deleted,  put in the trash  and removed
from the trash, so an empty trash folder again (status 2):

  /home/cng/data/Network Trash Folder:
  total 16
  drwx--Srwx   4 cng      share        4096 Apr 22 11:26 .
  drwxrwsr-x  10 cng      share        4096 Apr 22 11:26 ..
  drwx--Srwx   2 cng      share        4096 Apr 21 20:12 .AppleDouble
  drwx--S---   3 cng      share        4096 Apr 22 11:26 Trash Can #2
  -rw----rw-   1 cng      share           0 Apr 21 20:12 Trash Can Usage Map

when the  volume is unmounted, the users  are asked if they  really want to
unmount the volume, and emty the trash.  If the say so, the trash goes back
to the status 1.

My interpretation of these facts is that a numbered trash (#2 in this case)
is created  every time  a user puts  something in  the trash.  Even  if two
people (but  same user) use  the trash, only  one numbered trash  folder is
created, and it is emptied as soon as one person unmounts the volume.  More
precisely, if person A (user cng) puts something in the folder, then person
B (same user) does the same, then  user A umount the volume and answers yes
to emptying  the trash, a message  appears saying "some items  could not be
deleted, do  you want  to put away  them and  umount the volume?".   If you
answer yes,  the items are apparently  deleted, and the trash  goes back to
status  1.   I  suppose  that  the  numbered trash  are  used,  as  someone
suggested, when many  users are present in the system.   What is the reason
why netatalk starts from #2 instead of #1 (or #0) I have no idea.

Now, my  old and  broken trash folder,  which did  not allow anyone  to put
things in the trash, was done like this (status 0):

  /home/cng/data/Old and broken Trash:
  total 72
  drwx--Srwx  17 cng      share        4096 Apr 22 11:42 .
  drwxrwsr-x  10 cng      share        4096 Apr 22 11:35 ..
  -rw-r--r--   1 root     share        1707 Mar 30 19:58 afpd.conf

As you  see, there  are many  numbered trashes, all  belonging to  the same
user.

My  interpretation of the  facts is  that a  numbered trash  remains there,
undeleted, if the  Mac crashes without unmounting the volume,  or if I shut
down  netatalk while  poeple  have the  volume  mounted.  The  next time  a
numbered trash is needed, a new one is created.  The maximum number is #15,
so after  that netatalk  refuses to build  another numbered trash,  and you
cannot delete files.

Sorry for the  length of this message.  Comments welcome.   I do not follow
the list, so please CC answers to me.

Note to the  debian maintainer: I suppose this rules out  any bug in debian
or netatalk.  If you agree, the bug should be closed.