Subject: Re: [netatalk-admins] Afpd dies...

From: Xavier Reigner <[email-masked]>
Date: Tue, 30 Nov 1999 17:34:10 +0100

I'm also seeking for a solution on that disconnetion, and I found this
solution
at www.searchlinux.com...
He give his own patch wich make certainly something interesting but also
change
the adouble.h with :

> -#define AD_DATASZ1      589
> +#define AD_DATASZ1      1024 /* was 589, linux kernels > 2.2.9 seem
to
> +                                have unilaterally changed this WRT
> +                                hfs... */
>

and finally the files which are already on my linuxbox couldn't be
recognize with
their type and application maker...

hope it's help you, and will be greatfull to find a solution...

yours

xav

> FIX: netatalk/afpd under linux>2.2.10/HFS
>
>
>     Question | No Replies >
>
>
> Return to Search
>     Author: Ole Craig ([email-masked])
>     Date: 1999-10-27
>     Sources: comp.os.linux.networking
>
>             I've seen a couple of folks report problems with netatalk
>     disconnecting Mac clients when they try to mount an HFS format
device
>     under newer (> 2.2.9?) versions of linux. I managed to fix this
under
>     RedHat 6.1 (2.2.12) by applying a workaround posted to
>     linux.debian.bugs.dist by Hideyuki Otokawa
>     <[email-masked]>; for the original post see
>     news://[email-masked] -- dejanews
may be
>     of help.
>
>             The symptoms were that you could mount normal netatalk
volumes
>     fine, but if you tried to mount an HFS-format partition (using
Paul
>     Hargrove's HFS implementation included in 2.2.x distributions) and

>     then read it via netatalk, you'd get "Connection to server was
>     unexpectedly broken").
>
>             I built an RPM from my fix, which also incorporated a few
>     other changes in order to build under RH6.1 -- I added -lnsl to
the
>     RPC libs list, and kludged a workaraund for the fact that RedHat
has
>     decided to put PAM libs and header files into /lib/security and
>     /usr/include/security, respectively.
>
>             If anyone wants'em, feel free to dl:
>
www.cs.umass.edu/~olc/pub/netatalk-1.4b2+asun2.1.3-olc_rh61.i386.rpm
www.cs.umass.edu/~olc/pub/netatalk-1.4b2+asun2.1.3-olc_rh61.src.rpm
www.cs.umass.edu/~olc/pub/netatalk-devel-1.4b2+asun2.1.3-olc_rh61.i386.rpm

>
>             Naturally, these are provided without any warranty of
>     useability-or-fitness-for-a-particular-purpose whatsoever... but
they
>     worked for me.
>
>             poingg,
>                     Ole
>
>     ps. I'm not on the netatalk devel list, so if someone who is wants
to
>     forward this post feel free to do so.
>     --
>     Ole Craig * [email-masked] * UNIX; postmaster, news, web; SGI
martyr *
>     CS Computing Facility, UMass * <www.cs.umass.edu/~olc/> for public
key
>             The postmaster misses. The postmaster hits!  --more--
>                             You have new mail.
>
>

---

From: a sun <[email-masked]>
Date: Tue, 30 Nov 1999 12:55:25 -0800

argh. okay, here's the deal with the linux hfs module and netatalk:
      1) netatalk doesn't quite do the correct thing if sendfile
         exists but doesn't work for a particular filesystem. that
	 should be fixed in my latest snapshot.

      2) try mounting the hfs volume with -o afpd,version=1. it looks
         like the auto-backward compatibility may not have worked as
         expected. i'll look into that.

note: the hfs module never changed its expectation of how big the
appledouble header file was. 

-a

---

From: a sun <[email-masked]>
Date: Tue, 30 Nov 1999 23:30:11 -0800

for those interested in running netatalk with the linux hfs module,
there are two fixes that are appropriate:
      1) things should work better with my pre-asun2.1.4 stuff as i
         already use 1024 byte buffers. that's my bad for changing it
	 simultaneously in both the hfs and the netatalk source so
	 that i never saw a problem.

      2) apply the following patch to the linux kernel and re-compile:

--- linux/fs/hfs/file_hdr.c.save	Tue Nov 30 23:03:02 1999
+++ linux/fs/hfs/file_hdr.c	Tue Nov 30 23:01:34 1999
@@ -164,10 +164,10 @@
 	__constant_htonl(HFS_HDR_VERSION_1),	/* version */
 	5,					/* entries */
 	{					/* descr[] */
-		{HFS_HDR_FNAME, offsetof(struct hfs_dbl_hdr, real_name),   ~0},
-		{HFS_HDR_COMNT, offsetof(struct hfs_dbl_hdr, comment),      0},
-		{HFS_HDR_OLDI,  offsetof(struct hfs_dbl_hdr, create_time), 16},
-		{HFS_HDR_FINFO, offsetof(struct hfs_dbl_hdr, finderinfo),  32},
+		{HFS_HDR_FNAME, offsetof(struct hfs_nat_hdr, real_name),   ~0},
+		{HFS_HDR_COMNT, offsetof(struct hfs_nat_hdr, comment),      0},
+		{HFS_HDR_OLDI,  offsetof(struct hfs_nat_hdr, old_info),    16},
+		{HFS_HDR_FINFO, offsetof(struct hfs_nat_hdr, finderinfo),  32},
 		{HFS_HDR_RSRC,  HFS_NAT_HDR_LEN,                           ~0},
 	},
 	{					/* order[] */
--- linux/include/linux/hfs_fs.h.save	Tue Nov 30 22:31:52 1999
+++ linux/include/linux/hfs_fs.h	Tue Nov 30 22:55:31 1999
@@ -140,6 +140,19 @@
 			*order[HFS_HDR_MAX];	/* 'descr' ordered by offset */
 };
 
+/* header layout for netatalk's v1 appledouble file format */
+struct hfs_nat_hdr {
+	hfs_lword_t	magic;
+	hfs_lword_t	version;
+	hfs_byte_t	homefs[16];
+	hfs_word_t	entries;
+	hfs_byte_t	descrs[12*5];
+	hfs_byte_t	real_name[255];	/* id=3 */
+	hfs_byte_t	comment[200];	/* id=4 XXX: not yet implemented */
+	hfs_byte_t	old_info[16];	/* id=7 */
+	hfs_u8		finderinfo[32]; /* id=9 */
+};
+
 /* 
  * Default header layout for Netatalk and AppleDouble
  */
@@ -161,7 +174,6 @@
 	hfs_u8          short_name[12]; /* id=13 */
 	hfs_u8          prodosi[8];     /* id=11 */
 };
-
 
 /* finder metadata for CAP */
 struct hfs_cap_info {