]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_config.c
Fix build
[netatalk.git] / etc / afpd / afp_config.c
index f859637942f5e7ce8ebee2c3afc1bcf3d51ee5fc..1fafee03a04641623c898de1a6af916260911ac7 100644 (file)
@@ -48,14 +48,13 @@ void configfree(AFPObj *obj, DSI *dsi)
 {
     DSI *p, *q;
 
-    afp_options_free(obj->options);
+    afp_options_free(&obj->options);
 
     for (p = obj->dsi; p; p = q) {
         q = p->next;
         if (p == dsi)
             continue;
         close(p->socket);
-        free(p->dsi);
         free(p);
     }
     if (dsi) {
@@ -76,20 +75,21 @@ int configinit(AFPObj *obj)
     char *p, *q = NULL;
 
     LOG(log_debug, logtype_afpd, "DSIConfigInit: hostname: %s, listen: %s, port: %s",
-        obj->options->hostname,
-        obj->options->listen ? obj->options->listen : "(default: hostname)",
-        obj->options->port);
+        obj->options.hostname,
+        obj->options.listen ? obj->options.listen : "(default: hostname)",
+        obj->options.port);
 
     /* obj->options->listen is of the from "IP[:port][,IP:[PORT], ...]" */
     /* obj->options->port is the default port to listen (548) */
 
-    EC_NULL( q = p = strdup(obj->options->listen) );
-    EC_NULL( p = strtok(p, ',') );
+    EC_NULL( q = p = strdup(obj->options.listen) );
+    EC_NULL( p = strtok(p, ",") );
 
     while (p) {
-        if ((dsi = dsi_init(obj, obj->options->hostname, p, obj->options->port)) == NULL)
+        if ((dsi = dsi_init(obj, obj->options.hostname, p, obj->options.port)) == NULL)
             break;
 
+        status_init(obj, dsi);
         *next = dsi;
         next = &dsi->next;
 
@@ -97,25 +97,24 @@ int configinit(AFPObj *obj)
             getip_string((struct sockaddr *)&dsi->server),
             getip_port((struct sockaddr *)&dsi->server));
 
-        p = strtok(NULL, ',');
+        p = strtok(NULL, ",");
     }
 
     if (obj->dsi == NULL)
         EC_FAIL;
 
-    auth_load(obj->options->uampath, obj->options->uamlist);
-    status_init(obj);
-    set_signature(obj->options);
+    auth_load(obj->options.uampath, obj->options.uamlist);
+    set_signature(&obj->options);
 
 #ifdef HAVE_LDAP
     /* Parse afp_ldap.conf */
-    acl_ldap_readconfig(AFPObj->iniconfig);
+    acl_ldap_readconfig(obj->iniconfig);
 #endif /* HAVE_LDAP */
 
     /* Now register with zeroconf, we also need the volumes for that */
-    if (! (AFPObj->options.flags & OPTION_NOZEROCONF)) {
-        load_volumes(AFPObj);
-        zeroconf_register(AFPObj);
+    if (! (obj->options.flags & OPTION_NOZEROCONF)) {
+        load_volumes(obj);
+        zeroconf_register(obj);
     }
 
 EC_CLEANUP: