]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_config.c
Merge master
[netatalk.git] / etc / afpd / afp_config.c
index cdc9e4f0100ff50f8cf297cec0815d97d748d4f4..ed8067048da2e483bec545c8f61ba4580f5f9dd8 100644 (file)
@@ -50,6 +50,9 @@ void configfree(AFPObj *obj, DSI *dsi)
 {
     DSI *p, *q;
 
+    /* the master loaded the volumes for zeroconf, get rid of that */
+    unload_volumes(obj);
+
     for (p = obj->dsi; p; p = q) {
         q = p->next;
         if (p == dsi)
@@ -64,8 +67,6 @@ void configfree(AFPObj *obj, DSI *dsi)
         afp_options_free(&obj->options);
     }
 
-    /* the master loaded the volumes for zeroconf, get rid of that */
-    unload_volumes();
 }
 
 /*!
@@ -75,7 +76,7 @@ int configinit(AFPObj *obj)
 {
     EC_INIT;
     DSI *dsi, **next = &obj->dsi;
-    char *p = NULL, *q = NULL;
+    char *p = NULL, *q = NULL, *savep;
     const char *r;
 
     auth_load(obj->options.uampath, obj->options.uamlist);
@@ -91,7 +92,7 @@ int configinit(AFPObj *obj)
 
     if (obj->options.listen) {
         EC_NULL( q = p = strdup(obj->options.listen) );
-        EC_NULL( p = strtok(p, ", ") );
+        EC_NULL( p = strtok_r(p, ", ", &savep) );
     }
 
     while (1) {
@@ -108,7 +109,7 @@ int configinit(AFPObj *obj)
 
         if (p)
             /* p is NULL if ! obj->options.listen */
-            p = strtok(NULL, ", ");
+            p = strtok_r(NULL, ", ", &savep);
         if (!p)
             break;
     }
@@ -117,7 +118,7 @@ int configinit(AFPObj *obj)
         EC_FAIL;
 
 #ifdef HAVE_LDAP
-    /* Parse afp_ldap.conf */
+    /* Parse afp.conf */
     acl_ldap_readconfig(obj->iniconfig);
 #endif /* HAVE_LDAP */
 
@@ -127,15 +128,15 @@ int configinit(AFPObj *obj)
         zeroconf_register(obj);
     }
 
-    if ((r = iniparser_getstring(obj->iniconfig, INISEC_AFP, "fcelistener", NULL))) {
+    if ((r = iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "fce listener", NULL))) {
                LOG(log_note, logtype_afpd, "Adding FCE listener: %s", r);
                fce_add_udp_socket(r);
     }
-    if ((r = iniparser_getstring(obj->iniconfig, INISEC_AFP, "fcecoalesce", NULL))) {
+    if ((r = iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "fce coalesce", NULL))) {
                LOG(log_note, logtype_afpd, "Fce coalesce: %s", r);
                fce_set_coalesce(r);
     }
-    if ((r = iniparser_getstring(obj->iniconfig, INISEC_AFP, "fceevents", NULL))) {
+    if ((r = iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "fce events", NULL))) {
                LOG(log_note, logtype_afpd, "Fce events: %s", r);
                fce_set_events(r);
     }