Subject: Re: Working over TCP

From: Peter Gutowski <[email-masked]>
Date: 02 Jan 2001 10:57:04 -0500

The problem is probably not afpd but rather, your nameserver. The name as it appears in the chooser must resolve to an IP address on the local network. But it's still a bit more complicated than that, and I believe that the hostname or domain name of the linux box has some influence here. (You can also use the "Server IP address..." button to enter either the hostname or I23.456.789.012)

Netatalk builds file permissions from the directory as it is published. So (pre-) adjust those directories to your needs. Netatalk created files pickup the owner/group from the person logging in, so I guess if you need things to be different from what /etc/passwd says, then you should think of making the changes there. 

-- 
Peter Gutowski <[email-masked]> // tel.: (413) 587-3957 

"When in company, put not your hands to any part of the body not usually discovered."  --George Washington, _Rules for Civility and Decent Behavior_

On Tuesday, January 2, 2001, Miguel Beccari <[email-masked]> wrote:
>I have appletalk builded-in in my 2.2.18.
>I downloaded asun+netatalk, des.h and libdes.a.
>I compiled all with DES and PAM.
>No errors while compiling.
>I run /etc/rc.d script and voilà...
>
>netatalk is working fine......
>
>but not over tcp!
>
>with ps ax I can see afpd running,
>I edited my afpd.conf in several ways.... but never with
>success :(
>
>Second question:
>
>Is it possible to force a user to a UID/GID ???
>
>In samba I use force user = myUID
>                       force group = myGID
>                       umask = 0755

---

From: Duncan Sinclair <[email-masked]>
Date: Fri, 05 Jan 2001 15:18:43 +0000

>The problem is probably not afpd but rather, your nameserver. The name
>as it appears in the chooser must resolve to an IP address on the local
>network. But it's still a bit more complicated than that, and I believe
>that the hostname or domain name of the linux box has some influence
>here. (You can also use the "Server IP address..." button to enter
>either the hostname or I23.456.789.012)

This seems to be a new urban myth.  My Sun appears as "Department Server"
in my Chooser.  I don't even think it would be possible to put this name
in the DNS.  But TCP connections work OK for me.

I believe the Mac gets the IP number from the server either in the original
NBP (Chooser) information, or through an initial appletalk-based meeting of
minds.  I think it's the second one...

There may well be factors concerning what IP number your server thinks
it has, compared with what the client thinks it is.  For example, if
you have more than one IP number, perhaps if the server uses the wrong
one, the client will not be able to initialise a TCP connection and
fall back to AppleTalk.  (As afp over tcp always worked for me, I not
an expert on the possible ways it can fail.)

Cheers,

Duncan Sinclair.

PS> Anyone know how the latest netatalk-1.5 pre-release is on Solaris?
    Does it compile yet?

---

From: Sak Wathanasin <[email-masked]>
Date: Fri, 5 Jan 2001 15:37:54 +0000

In reply to Duncan Sinclair's message of the 05/01/2001 at 15:18 +0000,

>an expert on the possible ways it can fail.)

When you click on the server in the Chooser, the Mac sends an 
FPGetSrvrInfo request to the server. In the reply, the server sends 
its hostname, the versions of AFP that it supports, the UAMs that it 
supports, etc etc and right at the end, it sends the addresses it can 
be contacted on.

You can get the details from .../etc/afpd/status.c; the routine 
status_netaddress has the following comment:

     /* format:
        Address count (byte)
        len (byte = sizeof(length + address type + address)
        address type (byte, ip address = 0x01, ip + port = 0x02,
                            ddp address = 0x03, fqdn = 0x04)
        address (up to 254 bytes, ip = 4, ip + port = 6, ddp = 4)
        */

I.e., it sends a count of the different ways it can be contacted, and 
for each of them it sends the type (AppleTalk, IP addr or name) and 
then the respective address or name. It's up to the client what it 
does with this info: AppleShare tries the TCP connection(s?) first, 
then the AppleTalk ones.

If the client is given an incorrect IP addr, the attempt to talk to 
ASIP will fail. netatalk obtains this addr using the std 
gethostbyname() call, and this will use DNS, NIS or /etc/hosts 
depending on your nsswitch.conf settings. It uses not the server name 
(which can be changed in the afpd.conf file) but the hostname of the 
server (as returned by the "hostname" or "uname -n" cmd) to obtain 
its IP addr.

-- 
Sak Wathanasin
Network Analysis Limited
178 Wainbody Ave South, Coventry CV3 6BX, UK

Internet: [email-masked]
Phone: (+44) 24 76 41 99 96        Mobile: (+44) 79 70 75 19 12 
Fax: (+44) 24 76 69 06 90

---

From: "yardley" <[email-masked]>
Date: Fri, 5 Jan 2001 20:39:13 -0800

Actually, to get netatalk to connect over ip the netatalk machine has to be
in the same domain as the mac.  That is all I did and it worked fine.  I
then changed the domain and it would no longer mount over IP through the
chooser.  I don't know the technical reason why.  All I know is that it
worked.

TimY