SF.net SVN: gar:[22402] csw/mgar/pkg/netatalk/trunk

slowfranklin at users.sourceforge.net slowfranklin at users.sourceforge.net
Tue Nov 5 12:34:52 CET 2013


Revision: 22402
          http://gar.svn.sourceforge.net/gar/?rev=22402&view=rev
Author:   slowfranklin
Date:     2013-11-05 11:34:52 +0000 (Tue, 05 Nov 2013)
Log Message:
-----------
netatalk/trunk: Add patch for UAM loading problem

Modified Paths:
--------------
    csw/mgar/pkg/netatalk/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/netatalk/trunk/files/uam.patch

Modified: csw/mgar/pkg/netatalk/trunk/Makefile
===================================================================
--- csw/mgar/pkg/netatalk/trunk/Makefile	2013-11-05 11:33:37 UTC (rev 22401)
+++ csw/mgar/pkg/netatalk/trunk/Makefile	2013-11-05 11:34:52 UTC (rev 22402)
@@ -43,6 +43,8 @@
 RUNTIME_DEP_PKGS += CSWlibgio2-0-0
 
 PATCHFILES += 0003-Disable-noinst-binary-fails-to-link-on-SPARC.patch
+# will be in 3.1.1
+PATCHFILES += uam.patch
 
 # Don't know yet why but this dependency is only picked under sparc
 RUNTIME_DEP_PKGS_sparc = CSWlibgpg-error0

Added: csw/mgar/pkg/netatalk/trunk/files/uam.patch
===================================================================
--- csw/mgar/pkg/netatalk/trunk/files/uam.patch	                        (rev 0)
+++ csw/mgar/pkg/netatalk/trunk/files/uam.patch	2013-11-05 11:34:52 UTC (rev 22402)
@@ -0,0 +1,48 @@
+From 9f3fb96df7232b8652d92ce7969acc039dbef126 Mon Sep 17 00:00:00 2001
+From: Ralph Boehme <sloowfranklin at gmail.com>
+Date: Tue, 5 Nov 2013 10:57:17 +0100
+Subject: [PATCH] Fix a bug where only the first configured UAM was loaded
+
+Caused by strtok() not being async signal safe, use strtok_r() instead.
+Fixes bug #537.
+---
+ etc/afpd/auth.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c
+index f04404e..b4adf55 100644
+--- a/etc/afpd/auth.c
++++ b/etc/afpd/auth.c
+@@ -1020,7 +1020,7 @@ int auth_register(const int type, struct uam_obj *uam)
+ /* load all of the modules */
+ int auth_load(AFPObj *obj, const char *path, const char *list)
+ {
+-    char name[MAXPATHLEN + 1], buf[MAXPATHLEN + 1], *p;
++    char name[MAXPATHLEN + 1], buf[MAXPATHLEN + 1], *p, *last;
+     struct uam_mod *mod;
+     struct stat st;
+     size_t len;
+@@ -1028,8 +1028,10 @@ int auth_load(AFPObj *obj, const char *path, const char *list)
+     if (!path || !*path || !list || (len = strlen(path)) > sizeof(name) - 2)
+         return -1;
+ 
++    LOG(log_debug, logtype_afpd, "auth_load: %s, %s", path, list);
++
+     strlcpy(buf, list, sizeof(buf));
+-    if ((p = strtok(buf, ", ")) == NULL)
++    if ((p = strtok_r(buf, ", ", &last)) == NULL)
+         return -1;
+ 
+     strcpy(name, path);
+@@ -1054,7 +1056,7 @@ int auth_load(AFPObj *obj, const char *path, const char *list)
+         } else {
+             LOG(log_info, logtype_afpd, "uam: uam not found (status=%d)", stat(name, &st));
+         }
+-        p = strtok(NULL, ", ");
++        p = strtok_r(NULL, ", ", &last);
+     }
+ 
+     return 0;
+-- 
+1.8.4
+

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list