X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=etc%2Fafpd%2Fafp_config.c;h=121c2124c04cd93b7c4b5d28ff28215c53cbf521;hp=9e1ef0ddd55508d96d426da8c7aa230a2b686884;hb=9ebba6f4ae4965d0d63e4015fa5345fcd5eef9e0;hpb=03ba0b0ab9f1007f4a869c866f17a3fbdc1f134e diff --git a/etc/afpd/afp_config.c b/etc/afpd/afp_config.c index 9e1ef0dd..121c2124 100644 --- a/etc/afpd/afp_config.c +++ b/etc/afpd/afp_config.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #ifdef HAVE_LDAP #include @@ -42,14 +44,12 @@ * Free and cleanup all linked DSI objects from config * * Preserve object pointed to by "dsi". - * "dsi" can be NULL in which case all DSI objects are freed + * "dsi" can be NULL in which case all DSI objects _and_ the options object are freed */ void configfree(AFPObj *obj, DSI *dsi) { DSI *p, *q; - afp_options_free(&obj->options); - for (p = obj->dsi; p; p = q) { q = p->next; if (p == dsi) @@ -60,7 +60,10 @@ void configfree(AFPObj *obj, DSI *dsi) if (dsi) { dsi->next = NULL; obj->dsi = dsi; + } else { + afp_options_free(&obj->options); } + /* the master loaded the volumes for zeroconf, get rid of that */ unload_volumes(); } @@ -73,6 +76,10 @@ int configinit(AFPObj *obj) EC_INIT; DSI *dsi, **next = &obj->dsi; char *p = NULL, *q = NULL; + const char *r; + + auth_load(obj->options.uampath, obj->options.uamlist); + set_signature(&obj->options); LOG(log_debug, logtype_afpd, "DSIConfigInit: hostname: %s, listen: %s, port: %s", obj->options.hostname, @@ -84,7 +91,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(p, ", ") ); } while (1) { @@ -101,7 +108,7 @@ int configinit(AFPObj *obj) if (p) /* p is NULL if ! obj->options.listen */ - p = strtok(NULL, ","); + p = strtok(NULL, ", "); if (!p) break; } @@ -109,20 +116,31 @@ int configinit(AFPObj *obj) if (obj->dsi == NULL) EC_FAIL; - auth_load(obj->options.uampath, obj->options.uamlist); - set_signature(&obj->options); - #ifdef HAVE_LDAP - /* Parse afp_ldap.conf */ + /* Parse afp.conf */ acl_ldap_readconfig(obj->iniconfig); #endif /* HAVE_LDAP */ /* Now register with zeroconf, we also need the volumes for that */ if (! (obj->options.flags & OPTION_NOZEROCONF)) { - load_volumes(obj); + load_volumes(obj, NULL); zeroconf_register(obj); } + if ((r = iniparser_getstring(obj->iniconfig, INISEC_AFP, "fcelistener", 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))) { + LOG(log_note, logtype_afpd, "Fce coalesce: %s", r); + fce_set_coalesce(r); + } + if ((r = iniparser_getstring(obj->iniconfig, INISEC_AFP, "fceevents", NULL))) { + LOG(log_note, logtype_afpd, "Fce events: %s", r); + fce_set_events(r); + } + + EC_CLEANUP: if (q) free(q);