Subject: [netatalk-admins] Re: Hack for FreeBSD nbprgstr Was: Trouble with nbprgstr...

From: Peter Hjelt <[email-masked]>
Date: Fri, 13 Mar 1998 14:14:13 +0200

>With the UAR router we did specify a separate zone, "MyZone". It seems
>as though Netatalk needs this zone to complete an nbprgstr. I don't 
>understand why it fails to complete the registration process in the 
>netatalk.sh script when the default zone "*" is the target.

Ah, got your message about nbprgstr problems about at the same time I posted
my message titled "Odd nbprgstr problems with 1.4b2/FreeBSD 2.2.5" earlier 
today; we both seem to suffer from nbprgstr 1.4b2 not being able to register 
names on the default zone under FreeBSD.

Here is what I came up with to fake it (note: this is a mere hack, not the 
solution .. it will, however, work until someone else on the list can explain 
to us what's actually going wrong and what the real fix is supposed to be).

Apply this patch in /usr/ports/net/netatalk/work/netatalk-1.4b2/libatalk/nbp/ 
and recompile/install ../../etc/afpd/afpd and ../../bin/nbp/nbprgstr

--- nbp_rgstr.c	Fri Mar 13 12:57:39 1998
+++ nbp_rgstr.c	Fri Mar 13 13:09:02 1998
@@ -109,9 +109,13 @@
     if (( cc = select( s + 1, &readfd, 0, 0, &timeout )) < 0 ) {
 	return( -1 );
     }
+    /*
+     * FreeBSD 2.2.5 nozone hack by MXV of EFnet ([email-masked])
+     * fake successful NBPOP on timeout .. definitely dirty
+     */
     if ( cc == 0 ) {
-	errno = ETIMEDOUT;
-	return( -1 );
+	close( s );
+	return( 0 );
     }
 
     namelen = sizeof( struct sockaddr_at );

This leaves some odd side-effects when unregistering the names, but for
regular server use it's doing it's job, letting the server register itself 
even as there are no routers/zones chattering on the network.

Hint: you might want to copy the VAX-icon over the default globe one in 
afpd/icon.h before recompiling afpd .. will get you a cute BSD'ish devil on 
your desktops keeping our flag high =)

// enjoy - MXV

---

From: Typeline Webmaster <[email-masked]>
Date: Fri, 13 Mar 1998 13:55:45 -0500

Peter,

I thanked God for you and your response to this problem. When I came in
this
morning and got this message I was totally blown away. The odds of both
of us
running into the same problem at almost the same time are incredible!
Maybe I
should go an buy a lottery ticket!

Anyway, I applied your patch and the server comes up by itself without
relying
on any of the other routers. What I recommend for anyone else needing
this
is to do clean install *after* applying the patch. Since the patch is
applied
to a library module which is part of libatalk.a, the install will link
afpd, nbprgstr, papd, and whatever else is affected.

Just got the following thread from Julian Elischer:

Peter Hjelt wrote:
> 
> Got a itchy problem with netatalk 1.4b2 straight out of the ports collection
> of FreeBSD 2.2.5, using the stock appletalk drivers from the 2.2.5 kernel.

without applying the patch pointed to in the 2.2.2 ERRATA.TXT
that is found on the ftp site..

I looked but can't find the file he's referring to.