[netatalk-admins] Work-around for the shared Trash problem


Subject: [netatalk-admins] Work-around for the shared Trash problem
From: bsmith@h-e.com
Date: Thu Mar 26 1998 - 22:21:23 EST


As I promised a while back (and prompted by Harry's post about his "shoot-out"
of Linux/netatalk vs. NT vs. etc.), here is the work-around I have been using to
allow the Trash to be shared on an afpd volume. This isn't going to work for
everyone, it's only manageable if you have a relatively small number of
potential Trash users on the volume. Also, the "real" problem that prevents the
client from creating Trash folders on its own is still lurking somewhere, the
work-around really shouldn't be necessary, but for now it does the trick.

First, apply the patch to afpd that is attached to this message and re-compile.
Two versions of the patch file are attached, one for base 1.4b2 and one for
1.4b2+asun2.0a18.2, be sure to get the correct one. This fixes what might be a
bug in afpd, or it might just be an otherwise non-existent problem that is being
created by doing funky things with the Trash folders (see a more detailed
explanation below, if you're curious).

Next, from the Unix side of things, create a set of "Trash Can #N" directories
starting at #2 (i.e. "Trash Can #2", "Trash Can #3", etc.) inside the "Network
Trash Folder" in the afpd volume root. Create one folder for each user who
needs to use the Trash on the volume. This is why this only works for a few
users; I have 12 users, and it works fine for that number, but if you had
hundreds of these things to create I'm not sure it would fly. Each of these
directories must be owned by one of the specific users needing the Trash, and
must have mode 700. If any one of the "Trash Can #N" folders is group or world
read or read/write, the whole thing won't work, so be sure to get the owners and
modes right. Finally, "chmod a-w" the "Network Trash Folder" itself, so the
"Trash Can #N" directories can't be removed by afpd.

Now shared Trash should work! Everyone who mounts the volume with a user
identity matching one of the "Trash Can #N" directories will be able to use the
Trash, and all those users can put things in the Trash at the same time. For
any user who doesn't have a "Trash Can #N" owned by them, they will simply get
the "can't be left in Trash, delete immediately?" bit.

If you're interested, here is further explanation of the afpd patch. The patch
fixes the afp_moveandrename function to keep it from failing on a move or rename
if an ".AppleDouble" directory doesn't already exist in the destination
directory (the patch causes it to create the directory when it isn't there).
The problem occurs because the Mac client attempts to completely delete it's
"Trash Can #N" when the volume is un-mounted. Although the directory itself
stays put because "Network Trash Folder" is write-protected, everything inside
the directory goes away, including the ".AppleDouble" directory. Later when
the volume is re-mounted, files are put in the Trash by afp_moveandrename calls,
and since the ".AppleDouble" directory isn't there, the moves fail; actually,
the files get "broken" - the data files move, but the header/resource files stay
where they were. The chances of this happening outside these pre-created Trash
folders is probably next to nil unless you deliberately tried to cause it, so
whether this would really be classified as a bug or not is open to debate. But
if you're going to try this work-around for the Trash you have to apply the
patch.

I've been running with this setup for about two weeks, with a dozen people
making moderate to heavy use of several shared volumes, and it continues to
function just fine. But I only have a single system to test this on and I have
no idea what problems might crop up in other environments, so I still have to
say "use at your own risk"!

Bob Smith
Hammett & Edison, Inc.
bsmith@h-e.com

P.S. - sorry this isn't MIME; got to get a new mail system someday.

begin 644 afpd1.4b2-movefix.diff
M*BHJ(&5T8R]A9G!D+V9I;&4N8RT)4V%T($UA<B`Q-"`Q-#HS-CHP-B`Q.3DX
M"BTM+2!E=&,O869P9"]F:6QE+F,)36]N($UA<B`Q-B`P,3HP-#HT,B`Q.3DX
M"BHJ*BHJ*BHJ*BHJ*BHJ*@HJ*BH@-#,V+#0T,B`J*BHJ"B`@>PH@("`@("!S
M=')U8W0@861O=6)L90EA9#L*("`@("`@<W1R=6-T('-T870)"7-T.PHA("`@
M("!C:&%R"0EA9'-R8UL@34%84$%42$Q%3B!=.PH@("`@("!I;G0)"0EL96XL
M(')C.PH@(`H@("`@("`O*@HM+2T@-#,V+#0T,B`M+2TM"B`@>PH@("`@("!S
M=')U8W0@861O=6)L90EA9#L*("`@("`@<W1R=6-T('-T870)"7-T.PHA("`@
M("!C:&%R"0EA9'-R8UL@34%84$%42$Q%3B!=+"`J861D<W0L("IS;&%S:#L*
M("`@("`@:6YT"0D);&5N+"!R8SL*("`*("`@("`@+RH**BHJ*BHJ*BHJ*BHJ
M*BHJ"BHJ*B`T-C@L-#<W("HJ*BH*("`@("`@?0H@(`H@("`@("!S=')C<'DH
M(&%D<W)C+"!A9%]P871H*"!S<F,L(#`@*2D["B$@("`@(&EF("@@<F5N86UE
M*"!A9'-R8RP@861?<&%T:"@@9'-T+"`P("DI(#P@,"`I('L*("`)<W=I=&-H

M("@@97)R;F\@*2!["B`@"6-A<V4@14Y/14Y4(#H*(2`)("`@(')E='5R;B@@
M04907T]+("D["B`@"6-A<V4@14%#0T53(#H*("`)("`@(')E='5R;B@@0490
M15)27T%#0T534R`I.PH@(`ED969A=6QT(#H*+2TM(#0V."PU,#$@+2TM+0H@
M("`@("!]"B`@"B`@("`@('-T<F-P>2@@861S<F,L(&%D7W!A=&@H('-R8RP@
M,"`I*3L*(2`@("`@861D<W0@/2!A9%]P871H*"!D<W0L(#`@*3L*(2`@("`@
M:68@*"!R96YA;64H(&%D<W)C+"!A9&1S="`I(#P@,"`I('L*("`)<W=I=&-H
M("@@97)R;F\@*2!["B`@"6-A<V4@14Y/14Y4(#H*(2`)("`@("\J($UA>2!B
M92!D=64@=&\@9&5S=&EN871I;VX@040@9&ER96-T;W)Y(&UI<W-I;F<N("!3
M=&%T('1H90HA(`D@("`@("`@<V]U<F-E('1O(&9I;F0@;W5T(&EF(&ET(&5X
M:7-T<RP@:68@:70@9&]E<RP@8W)E871E('1H92!!1`HA(`D@("`@("`@9&5S
M=&EN871I;VX@9&ER96-T;W)Y(&%N9"!T<GD@86=A:6XN"B$@"2`@("`@("`\
M8G-M:71H0&@M92YC;VT^("`Y.#`S,34@*B\*(2`)("`@(&EF("@@<W1A="@@
M861S<F,L("9S="`I*2!["B$@"2`@("`@(')E='5R;B@@04907T]+("D["B$@
M"2`@("!]"B$@"2`@("!I9B`H('-L87-H(#T@<W1R<F-H<B@@861D<W0L("<O
M)R`I*2!["B$@"2`@("`@("IS;&%S:"`]("=<,"<["B$@"2`@("`@(&EF("@@
M861?;6MD:7(H(&%D9'-T+"`P-S<W("D@/3T@,"`I('L*(2`)"2IS;&%S:"`]
M("<O)SL*(2`)"6EF("@@<F5N86UE*"!A9'-R8RP@861D<W0@*2`]/2`P("D@
M>PHA(`D)("!B<F5A:SL*(2`)"7T*(2`)("`@("`@?0HA(`D@("`@?0HA("`@
M("`@("`@("`@('-W:71C:"`H(&5R<FYO("D@>PHA(`D@("`@8V%S92!%3D]%
M3E0@.@HA(`D@("`@("!R971U<FXH($%&4$524E].3T]"2B`I.PHA(`D@("`@
M8V%S92!%04-#15,@.@HA(`D@("`@("!R971U<FXH($%&4$524E]!0T-%4U,@
M*3L*(2`)("`@(&1E9F%U;'0@.@HA(`D@("`@("!R971U<FXH($%&4$524E]0
M05)!32`I.PHA(`D@("`@?0H@(`EC87-E($5!0T-%4R`Z"B`@"2`@("!R971U
B<FXH($%&4$524E]!0T-%4U,@*3L*("`)9&5F875L="`Z"@``
`
end

begin 644 afpd1.4b2+asun-movefix.diff

M*BHJ(&5T8R]A9G!D+V9I;&4N8RT)5V5D($1E8R`S,2`Q,3HU,CHT,R`Q.3DW
M"BTM+2!E=&,O869P9"]F:6QE+F,)4W5N($UA<B`Q-2`Q.#HP-#HS-R`Q.3DX
M"BHJ*BHJ*BHJ*BHJ*BHJ*@HJ*BH@-30X+#4U-"`J*BHJ"B`@>PH@("`@("!S
M=')U8W0@861O=6)L90EA9#L*("`@("`@<W1R=6-T('-T870)"7-T.PHA("`@
M("!C:&%R"0EA9'-R8UL@34%84$%42$Q%3B`K(#%=.PH@("`@("!I;G0)"0EL
M96XL(')C.PH@(`H@("`@("`O*@HM+2T@-30X+#4U-"`M+2TM"B`@>PH@("`@
M("!S=')U8W0@861O=6)L90EA9#L*("`@("`@<W1R=6-T('-T870)"7-T.PHA
M("`@("!C:&%R"0EA9'-R8UL@34%84$%42$Q%3B`K(#%=+"`J861D<W0L("IS
M;&%S:#L*("`@("`@:6YT"0D);&5N+"!R8SL*("`*("`@("`@+RH**BHJ*BHJ
M*BHJ*BHJ*BHJ"BHJ*B`U.#`L-3@Y("HJ*BH*("`@("`@?0H@(`H@("`@("!S
M=')C<'DH(&%D<W)C+"!A9%]P871H*"!S<F,L(#`@*2D["B$@("`@(&EF("@@
M<F5N86UE*"!A9'-R8RP@861?<&%T:"@@9'-T+"`P("DI(#P@,"`I('L*("`)
M<W=I=&-H("@@97)R;F\@*2!["B`@"6-A<V4@14Y/14Y4(#H*(2`)("`@(')E
M='5R;B@@04907T]+("D["B`@"6-A<V4@14%#0T53(#H*("`)("`@(')E='5R
M;B@@049015)27T%#0T534R`I.PH@(`ED969A=6QT(#H*+2TM(#4X,"PV,3,@
M+2TM+0H@("`@("!]"B`@"B`@("`@('-T<F-P>2@@861S<F,L(&%D7W!A=&@H
M('-R8RP@,"`I*3L*(2`@("`@861D<W0@/2!A9%]P871H*"!D<W0L(#`@*3L*
M(2`@("`@:68@*"!R96YA;64H(&%D<W)C+"!A9&1S="`I(#P@,"`I('L*("`)
M<W=I=&-H("@@97)R;F\@*2!["B`@"6-A<V4@14Y/14Y4(#H*(2`)("`@("\J
M($UA>2!B92!D=64@=&\@9&5S=&EN871I;VX@040@9&ER96-T;W)Y(&UI<W-I
M;F<N("!3=&%T('1H90HA(`D@("`@("`@<V]U<F-E('1O(&9I;F0@;W5T(&EF
M(&ET(&5X:7-T<RP@:68@:70@9&]E<RP@8W)E871E('1H92!!1`HA(`D@("`@
M("`@9&5S=&EN871I;VX@9&ER96-T;W)Y(&%N9"!T<GD@86=A:6XN"B$@"2`@
M("`@("`\8G-M:71H0&@M92YC;VT^("`Y.#`S,34@*B\*(2`)("`@(&EF("@@
M<W1A="@@861S<F,L("9S="`I*2!["B$@"2`@("`@(')E='5R;B@@04907T]+

M("D["B$@"2`@("!]"B$@"2`@("!I9B`H('-L87-H(#T@<W1R<F-H<B@@861D
M<W0L("<O)R`I*2!["B$@"2`@("`@("IS;&%S:"`]("=<,"<["B$@"2`@("`@
M(&EF("@@861?;6MD:7(H(&%D9'-T+"`P-S<W("D@/3T@,"`I('L*(2`)"2IS
M;&%S:"`]("<O)SL*(2`)"6EF("@@<F5N86UE*"!A9'-R8RP@861D<W0@*2`]
M/2`P("D@>PHA(`D)("!B<F5A:SL*(2`)"7T*(2`)("`@("`@?0HA(`D@("`@
M?0HA("`@("`@("`@("`@('-W:71C:"`H(&5R<FYO("D@>PHA(`D@("`@8V%S
M92!%3D]%3E0@.@HA(`D@("`@("!R971U<FXH($%&4$524E].3T]"2B`I.PHA
M(`D@("`@8V%S92!%04-#15,@.@HA(`D@("`@("!R971U<FXH($%&4$524E]!
M0T-%4U,@*3L*(2`)("`@(&1E9F%U;'0@.@HA(`D@("`@("!R971U<FXH($%&
M4$524E]005)!32`I.PHA(`D@("`@?0H@(`EC87-E($5!0T-%4R`Z"B`@"2`@
H("!R971U<FXH($%&4$524E]!0T-%4U,@*3L*("`)9&5F875L="`Z"@``
`
end



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:31:59 EST