Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2013 03:36:05 GMT
From:      "Chad J. Milios" <cropcirclesystems@yahoo.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/175173: [PATCH] netatalk3 
Message-ID:  <201301100336.r0A3a51W035935@red.freebsd.org>
Resent-Message-ID: <201301100340.r0A3e17E011379@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         175173
>Category:       ports
>Synopsis:       [PATCH] netatalk3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 10 03:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Chad J. Milios
>Release:        9.1-RELEASE
>Organization:
Crop Circle Systems, Inc.
>Environment:
FreeBSD seed.ccsys.com 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r245163: Tue Jan  8 13:35:18 UTC 2013     root@seed.ccsys.com:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
To be clear, I have a 100% ZFS system, root /boot /home, everything ZFS, this may only affect ZFS, I don't know, I didn't try this on UFS or on Linux. I fixed it for myself and moved on. The fix was small and innocent-looking enough, I don't think it should adversely affect anyone. In my googling I found at least two other people having exactly the same problem, both on FreeBSD 9.0 and ZFS. I backported this small fix from the Netatalk 3.0.2 development repository with no modification, but by their comments, it doesn't seem like they know this patch fixes this problem, or are aware of this problem. Apparently it also fixes a memory leak, according to their changelog.

So, I built netatalk-3.0.1,1 from ports with default options, configured a [Homes] section to point to /home (a zfs dataset), logged in from a MacOS 10.8.2 machine and got this error:

"Something wrong with the volume's CNID DB, using temporary CNID DB instead. Check server messages for details! Switching to read-only mode."

/var/log/messages then contained the lines:

Jan  7 03:45:38 seed afpd[1734]: AFP3.3 Login by joe
Jan  7 03:45:38 seed afpd[1734]: Cannot find module named [] in registered module list!
Jan  7 03:45:38 seed afpd[1734]: Can't open volume "/home/joe" CNID backend ""
Jan  7 03:45:38 seed afpd[1734]: Reopen volume /home/joe using in memory temporary CNID DB.

>How-To-Repeat:
Install netatalk-3.0.1,1, configure and log in. May need FreeBSD 9.x, 9.1, or ZFS /home on 9.x to trigger the problem for all I know.
>Fix:
Put the attached patchfile into the files directory of the netatalk3 port. This is grabbed from https://github.com/franklahm/Netatalk/commit/1fa0166843eac60947d08f92c90a686fc8bcbff5

Patch attached with submission follows:

--- ./libatalk/util/netatalk_conf.c.orig	2013-01-07 12:21:30.309544508 +0000
+++ ./libatalk/util/netatalk_conf.c	2013-01-07 12:23:22.360529479 +0000
@@ -563,7 +563,7 @@
     EC_INIT;
     struct vol  *volume = NULL;
     int         i, suffixlen, vlen, tmpvlen, u8mvlen, macvlen;
-    char        *tmpname;
+    char        tmpname[AFPVOL_U8MNAMELEN+1];
     ucs2_t      u8mtmpname[(AFPVOL_U8MNAMELEN+1)*2], mactmpname[(AFPVOL_MACNAMELEN+1)*2];
     char        suffix[6]; /* max is #FFFF */
     uint16_t    flags;
@@ -643,7 +643,7 @@
     EC_NULL( volume->v_maccodepage = strdup(obj->options.maccodepage) );
 
     vlen = strlen(name);
-    tmpname = strdup(name);
+    strlcpy(tmpname, name, sizeof(tmpname));
     for(i = 0; i < vlen; i++)
         if(tmpname[i] == '/') tmpname[i] = ':';
 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301100336.r0A3a51W035935>