Subject: [netatalk-admins] AppleDouble funnies

From: [email-masked]
Date: Thu, 28 Oct 1999 19:42:23 +0100

I recently upgraded a server running Linux 2.0.36 with
netatalk-1.4b2+asun2.0a18.2 to Linux 2.2.13 and netatalk-1.4b2+asun2.1.3.
There are about 30000 images on this server which have been put on using
various versions of netatalk over the years. We are now seeing a peculiar
behaviour which is that some files show up on the Mac with the well known
bull/demon head, even though they have resource forks (these are all
Photoshop files). Further investigation reveals that when a Mac opens one
of these folders now that 2.1.3 is running, the resource fork files in the
.AppleDouble directory are modified - their modified time changes to now
and the content changes too (verified by comparing sum against another copy
of the files on a machine which is not running the newer netatalk).

What gives here ? I am presuming that there is some automagic change of
AppleDouble format taking place but I can't find any documentation about
it. One change seems to be that the numbers in the AppleDouble header e.g.
the magic number are now being stored in big-endian format - I noticed that
in some of my earlier files that they were stored in little-endian format.
The curious thing is that when I open a folder with some early files only
some of them are converted to the new format - others are left alone and it
is these untouched ones which display the head icon.

 I thought that this might have been something to do with V2 AppleDouble
but the version I have seems to have been built with AppleDouble version 1
- at least when I run adv1tov2 I get the message

adv1tov2 not built for v2 AppleDouble files

and also the modified files still have a version byte of 1 and 589 bytes of
 header.

I looked at the source for adv1tov2 and it would seem that without changing
the source, you
will always get that message as the  if  .. else around the code is
commented but I presume this was changed in the RPM I got as I tried
running adv1tov2  on a directory with 1000 files and it returned
immediately, and I somehow don't think it modified 1000 files in zero time,
esp. on the miserable 166 MHz Pentium it's running on :-)

So, in short, what's happening, why's it going wrong, and how do I fix it
and make sure it doesn't go wrong again.