#589071 netatalk: Fails to serve root volume.

Package:
netatalk
Source:
netatalk
Description:
Apple Filing Protocol service
Submitter:
Alan Snelgrove
Date:
2022-02-25 08:00:04 UTC
Severity:
normal
Tags:
#589071#5
Date:
2010-07-14 18:00:42 UTC
From:
To:
I have just upgrade to the 2.1.2-2 and I can no longer access my root
directory beyond the first level.

My AppleVolumes.default contains 2 volumes
~/	"Home"
/	"Slug"

There is no problem with the Home volume, or any other volume attached
to a mount point.
When the Slug volume is served I can see the top level libraries but I
am not able to see the contents of any directory.
The client is a Mac OSX 10.5.8

The debug log shows:

Jul 14 18:03:15 localhost afpd[21801]: cnid_dbd_resolve: resolved did:
2, name: 'bin'
Jul 14 18:03:15 localhost afpd[21801]: cnid_dbd_add: CNID: 2, name:
'bin', inode: 0x3f001, type: 1 (0=file, 1=dir)
Jul 14 18:03:15 localhost afpd[21801]: transmit: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: dbd_rpc: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: send_packet: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: write_vec: request to write 43
bytes
Jul 14 18:03:15 localhost afpd[21801]: write_vec: wrote 43 bytes
Jul 14 18:03:15 localhost afpd[21801]: send_packet: OK
Jul 14 18:03:15 localhost afpd[21801]: dbd_rpc: END
Jul 14 18:03:15 localhost afpd[21801]: transmit: END OK
Jul 14 18:03:15 localhost afpd[21801]: cnid_dbd_add: got CNID: 37
Jul 14 18:03:15 localhost afpd[21801]: adddir: insert bin
Jul 14 18:03:15 localhost afpd[21801]: movecwd('bin/'): ret:1, 2/No
such file or directory
Jul 14 18:03:15 localhost afpd[21801]: movecwd('bin/'): ret:1, 2/No
such file or directory
Jul 14 18:03:15 localhost afpd[21801]: ==> Finished AFP command:
AFP_GETFLDRPARAM -> AFPERR_BADTYPE
Jul 14 18:03:15 localhost afpd[21801]: <== Start AFP command:
AFP_RESOLVEID
Jul 14 18:03:15 localhost afpd[21801]: cnid_dbd_resolve: resolving
CNID: 37
Jul 14 18:03:15 localhost afpd[21801]: transmit: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: dbd_rpc: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: send_packet: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: send_packet: OK
Jul 14 18:03:15 localhost afpd[21801]: dbd_rpc: END
Jul 14 18:03:15 localhost afpd[21801]: transmit: END OK
Jul 14 18:03:15 localhost afpd[21801]: cnid_dbd_resolve: resolved did:
2, name: 'bin'
Jul 14 18:03:15 localhost afpd[21801]: ==> Finished AFP command:
AFP_RESOLVEID -> AFPERR_NOID
Jul 14 18:03:15 localhost afpd[21801]: <== Start AFP command:
AFP_GETFLDRPARAM
Jul 14 18:03:15 localhost afpd[21801]: cnid_dbd_resolve: resolving
CNID: 32
Jul 14 18:03:15 localhost afpd[21801]: transmit: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: dbd_rpc: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: send_packet: BEGIN
Jul 14 18:03:15 localhost afpd[21801]: send_packet: OK
Jul 14 18:03:15 localhost afpd[21801]: dbd_rpc: END
Jul 14 18:03:15 localhost afpd[21801]: transmit: END OK

#589071#10
Date:
2011-06-22 07:15:56 UTC
From:
To:
I have this problem too, and have had it for a couple years. I think it is probably a basic bug in netatalk, and not configuration dependent, because it occurs with a default install using only the default settings.

I've been hoping to use netatalk to manage a Ubuntu Linux server, and using the superior development tools available for the Mac to edit all the various various root-owned files (by adding '-admingroup admin' to afpd.conf).

Unfortunately, it doesn't work unless you make separate shares for every directory on the machine: /etc, /var, etc.

I can confirm this bug exists in netatalk (2.1.4-1) that is the default on Ubuntu 11.04. It also existed on a fresh install of Ubuntu 10.4 (don't know what version that was).

Steps to reproduce:

1.) Add a line like "/  Root" to AppleVolumes.default

2.) Connect to the Mac via AFP over TCP/IP.

Initially it looks like it works, but:

- if you navigate into a subfolder, the Finder on the client Mac shows it as empty

- if you copy a folder to the root directory using Finder on the client, the Finder throws all manner of weird errors (copying a file works, however)


If you do take the time to make AFP volumes out of every folder on the root volume of the netatalk host, everything works as expected.

So this problem seems to pertain only to the root volume. For use cases like mine (perhaps not so common) it means that netatalk is not a viable option (although I keep checking every year to see if it's been fixed...).

#589071#15
Date:
2011-07-05 19:06:31 UTC
From:
To:
I found a work around for this Bug, which works for me.

in source package netatalk/etc/afpd/directory.c
there are the lines
    if ((ret = lchdir(cfrombstr(dir->d_fullpath))) != 0 ) {
        LOG(log_debug, logtype_afpd, "movecwd('%s'): ret: %u, %s",
            cfrombstr(dir->d_fullpath), ret, strerror(errno));

The fix is to replace lchdir with chdir.

There is only one occurrence of  lchdir  in the source file.

#589071#20
Date:
2011-08-17 12:42:06 UTC
From:
To:
2011/7/5 Alan Snelgrove <alansnelgrove@mac.com>:

Bah! This breaks certain semantics.
Also can't reproduce with git master HEAD which means it should work
in 2.2.1, it's probably already working in 2.2.0.

#589071#25
Date:
2011-08-31 08:33:40 UTC
From:
To:
This is still broken for me in 2.2.0. (Haven't had time to try with git HEAD yet.
#589071#30
Date:
2011-09-20 01:24:52 UTC
From:
To:
I have now had a chance to test this against netatalk 2.2.1, and it is still broken. (Fresh netatalk install in a fresh Ubuntu 11.4 VM.)

I would be interested to hear what exactly Alan's workaround (earlier in this bug's thread) breaks, because we'd like to try it.

#589071#35
Date:
2011-11-19 17:59:37 UTC
From:
To:
The problem still exists for me.

Using libraries:
    LIBS = -lpthread -ldl  -L$(top_srcdir)/libatalk
    CFLAGS = -I$(top_srcdir)/include -D_U_="__attribute__((unused))" -mcpu=xscale -I$(top_srcdir)/sys
    SSL:
        LIBS   =  -lcrypto
        CFLAGS =  -I/usr/include/openssl
    LIBGCRYPT:
        LIBS   = -L/lib/arm-linux-gnueabi -lgcrypt
        CFLAGS =
    PAM:
        LIBS   =  -lpam
        CFLAGS =
    WRAP:
        LIBS   = -lwrap
        CFLAGS =
    BDB:
        LIBS   =  -ldb-5.1
        CFLAGS =
    CUPS:
        LIBS   = -lcups -L/usr/lib/arm-linux-gnueabi -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabi/dbus-1.0/include -DDBUS_API_SUBJECT_TO_CHANGE -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lgnutls -L/lib/arm-linux-gnueabi -lgcrypt -lz -lpthread -lm -lcrypt
        CFLAGS =
Configure summary:
    Install style:
         debian
    AFP:
         Large file support (>2GB) for AFP3: yes
         Extended Attributes: ad | sys
    CNID:
         backends:  dbd last tdb
    UAMS:
         DHX     (PAM SHADOW)
         DHX2    (PAM SHADOW)
         RANDNUM
         clrtxt  (PAM SHADOW)
         guest
    Options:
         DDP (AppleTalk) support: no
         SLP support:             no
         Zeroconf support:        yes
         tcp wrapper support:     yes
         quota support:           yes
         admin group support:     yes
         valid shell check:       yes
         cracklib support:        no
         dropbox kludge:          no
         force volume uid/gid:    no
         ACL support:             yes
         LDAP support:            yes

/       "$h"
~/      "$h.$u"

=======================================
List contents via Finder of /run/
---------------------------------------
Log with lchdir
---------------------------------------
Nov 19 18:09:51.237220 afpd[26659] {dsi_stream.c:150} (D5:DSI): from_buf(read: 0, unread:0 , space left: 3646080): returning 0
Nov 19 18:09:51.239937 afpd[26659] {dsi_stream.c:150} (D5:DSI): from_buf(read: 16, unread:19 , space left: 3646045): returning 16
Nov 19 18:09:51.242219 afpd[26659] {dsi_stream.c:150} (D5:DSI): from_buf(read: 0, unread:0 , space left: 3646080): returning 19
Nov 19 18:09:51.244483 afpd[26659] {afp_dsi.c:595} (D5:AFPDaemon): DSI request ID: 151
Nov 19 18:09:51.246815 afpd[26659] {afp_dsi.c:610} (D5:AFPDaemon): <== Start AFP command: AFP_GETFLDRPARAM
Nov 19 18:09:51.249077 afpd[26659] {directory.c:555} (D5:AFPDaemon): dirlookup(did: 4775): START
Nov 19 18:09:51.251410 afpd[26659] {dircache.c:342} (D5:AFPDaemon): dircache(cnid:4775): {cached: path:"//run"}
Nov 19 18:09:51.252711 afpd[26659] {directory.c:701} (D5:AFPDaemon): dirlookup(did: 4775): RESULT: pdid: 2, path: "//run"
Nov 19 18:09:51.254686 afpd[26659] {directory.c:1378} (D5:AFPDaemon): movecwd(to: did: 4775, "//run")
Nov 19 18:09:51.257217 afpd[26659] {directory.c:1382} (D5:AFPDaemon): movecwd("//run"): Resource temporarily unavailable
Nov 19 18:09:51.258505 afpd[26659] {directory.c:1192} (D5:AFPDaemon): cname(did:4775): failed to chdir to '//run'
Nov 19 18:09:51.260487 afpd[26659] {afp_dsi.c:617} (D5:AFPDaemon): ==> Finished AFP command: AFP_GETFLDRPARAM -> AFPERR_BADTYPE
Nov 19 18:09:51.263180 afpd[26659] {dsi_stream.c:150} (D5:DSI): from_buf(read: 0, unread:0 , space left: 3646080): returning 0
Nov 19 18:09:51.266158 afpd[26659] {dsi_stream.c:150} (D5:DSI): from_buf(read: 16, unread:10 , space left: 3646054): returning 16
Nov 19 18:09:51.268357 afpd[26659] {dsi_stream.c:150} (D5:DSI): from_buf(read: 0, unread:0 , space left: 3646080): returning 10
Nov 19 18:09:51.270487 afpd[26659] {afp_dsi.c:595} (D5:AFPDaemon): DSI request ID: 152
Nov 19 18:09:51.271803 afpd[26659] {afp_dsi.c:610} (D5:AFPDaemon): <== Start AFP command: AFP_RESOLVEID
Nov 19 18:09:51.273814 afpd[26659] {cnid_dbd.c:672} (D5:CNID): cnid_dbd_resolve: resolving CNID: 4775
Nov 19 18:09:51.277875 afpd[26659] {cnid_dbd.c:697} (D5:CNID): cnid_dbd_resolve: resolved did: 2, name: 'run'
Nov 19 18:09:51.279155 afpd[26659] {directory.c:555} (D5:AFPDaemon): dirlookup(did: 2): START
Nov 19 18:09:51.281339 afpd[26659] {directory.c:701} (D5:AFPDaemon): dirlookup(did: 2): RESULT: pdid: 1, path: "/"
Nov 19 18:09:51.283587 afpd[26659] {directory.c:1378} (D5:AFPDaemon): movecwd(to: did: 2, "/")
Nov 19 18:09:51.286125 afpd[26659] {afp_dsi.c:617} (D5:AFPDaemon): ==> Finished AFP command: AFP_RESOLVEID -> AFPERR_NOID
---------------------------------------
Log with chdir which locates the .pid files
---------------------------------------
Nov 19 18:19:47.582691 afpd[27525] {dsi_stream.c:150} (D5:DSI): from_buf(read: 0, unread:0 , space left: 3646080): returning 0
Nov 19 18:19:47.585858 afpd[27525] {dsi_stream.c:150} (D5:DSI): from_buf(read: 16, unread:29 , space left: 3646035): returning 16
Nov 19 18:19:47.588119 afpd[27525] {dsi_stream.c:150} (D5:DSI): from_buf(read: 0, unread:0 , space left: 3646080): returning 29
Nov 19 18:19:47.590399 afpd[27525] {afp_dsi.c:595} (D5:AFPDaemon): DSI request ID: 126
Nov 19 18:19:47.592634 afpd[27525] {afp_dsi.c:610} (D5:AFPDaemon): <== Start AFP command: AFP_ENUMERATE_EXT2
Nov 19 18:19:47.595275 afpd[27525] {directory.c:555} (D5:AFPDaemon): dirlookup(did: 2): START
Nov 19 18:19:47.597519 afpd[27525] {directory.c:701} (D5:AFPDaemon): dirlookup(did: 2): RESULT: pdid: 1, path: "/"
Nov 19 18:19:47.598874 afpd[27525] {directory.c:1378} (D5:AFPDaemon): movecwd(to: did: 2, "/")
Nov 19 18:19:47.600902 afpd[27525] {directory.c:1349} (D5:AFPDaemon): came('/') {end: curdir:'/', path:'.'}
Nov 19 18:19:47.603226 afpd[27525] {enumerate.c:273} (D5:AFPDaemon): enumerate("//.", f/d:e92f/a12f, rc:17, i:24, max:5280)
Nov 19 18:19:47.605603 afpd[27525] {afp_dsi.c:617} (D5:AFPDaemon): ==> Finished AFP command: AFP_ENUMERATE_EXT2 -> AFPERR_NOOBJ
Nov 19 18:19:47.607293 afpd[27525] {dsi_stream.c:150} (D5:DSI): from_buf(read: 0, unread:0 , space left: 3646080): returning 0
Nov 19 18:19:47.609995 afpd[27525] {dsi_stream.c:150} (D5:DSI): from_buf(read: 16, unread:29 , space left: 3646035): returning 16
Nov 19 18:19:47.611004 afpd[27525] {dsi_stream.c:150} (D5:DSI): from_buf(read: 0, unread:0 , space left: 3646080): returning 29
Nov 19 18:19:47.613188 afpd[27525] {afp_dsi.c:595} (D5:AFPDaemon): DSI request ID: 127
Nov 19 18:19:47.614520 afpd[27525] {afp_dsi.c:610} (D5:AFPDaemon): <== Start AFP command: AFP_ENUMERATE_EXT2
Nov 19 18:19:47.616681 afpd[27525] {directory.c:555} (D5:AFPDaemon): dirlookup(did: 4775): START
Nov 19 18:19:47.618997 afpd[27525] {dircache.c:342} (D5:AFPDaemon): dircache(cnid:4775): {cached: path:"//run"}
Nov 19 18:19:47.621285 afpd[27525] {directory.c:701} (D5:AFPDaemon): dirlookup(did: 4775): RESULT: pdid: 2, path: "//run"
Nov 19 18:19:47.622584 afpd[27525] {directory.c:1378} (D5:AFPDaemon): movecwd(to: did: 4775, "//run")
Nov 19 18:19:47.624635 afpd[27525] {directory.c:1349} (D5:AFPDaemon): came('//run') {end: curdir:'//run', path:'.'}
Nov 19 18:19:47.626123 afpd[27525] {enumerate.c:273} (D5:AFPDaemon): enumerate("/run/.", f/d:e92f/a12f, rc:20, i:1, max:5280)
Nov 19 18:19:47.628435 afpd[27525] {file.c:628} (D5:AFPDaemon): getfilparams("ntpd.pid")
Nov 19 18:19:47.630815 afpd[27525] {file.c:320} (D5:AFPDaemon): getmetadata("ntpd.pid")
Nov 19 18:19:47.633051 afpd[27525] {dircache.c:385} (D5:AFPDaemon): dircache_search_by_name(did:4775, "ntpd.pid")
Nov 19 18:19:47.635527 afpd[27525] {dircache.c:414} (D5:AFPDaemon): dircache(did:4775,"ntpd.pid"): {found in cache}
Nov 19 18:19:47.637799 afpd[27525] {file.c:408} (D5:AFPDaemon): metadata('ntpd.pid'): AFP Attributes: 0000
Nov 19 18:19:47.639103 afpd[27525] {file.c:415} (D5:AFPDaemon): metadata('ntpd.pid'):     Parent DID: 4775
Nov 19 18:19:47.641116 afpd[27525] {file.c:463} (D5:AFPDaemon): metadata('ntpd.pid'):           CNID: 10451
Nov 19 18:19:47.643462 afpd[27525] {file.c:628} (D5:AFPDaemon): getfilparams("sshd.pid")
Nov 19 18:19:47.644554 afpd[27525] {file.c:320} (D5:AFPDaemon): getmetadata("sshd.pid")
Nov 19 18:19:47.648525 afpd[27525] {dircache.c:385} (D5:AFPDaemon): dircache_search_by_name(did:4775, "sshd.pid")

#589071#40
Date:
2022-01-27 05:58:01 UTC
From:
To:
-- 
Hello Dear,
how are you today?hope you are fine
My name is Dr Ava Smith ,Am an English and French nationalities.
I will give you pictures and more details about me as soon as i hear from you
Thanks
Ava

#589071#45
Date:
2022-02-25 07:57:42 UTC
From:
To:
-- 
Greetings from Mr.Hary Kunda

How are you and your family?
There is a business deal I would like to introduce to you. There is no
risk involved.
The deal is worth $10.5 million. We split it in half - 50% each.
Revert to me asap if you are interested.
Regards,

Mr. Hary Kunda