- /* transports */
- if (strstr(buf, " -transall"))
- options->transports = AFPTRANS_ALL;
- if (strstr(buf, " -notransall"))
- options->transports = AFPTRANS_NONE;
- if (strstr(buf, " -tcp"))
- options->transports |= AFPTRANS_TCP;
- if (strstr(buf, " -notcp"))
- options->transports &= ~AFPTRANS_TCP;
- if (strstr(buf, " -ddp"))
- options->transports |= AFPTRANS_DDP;
- if (strstr(buf, " -noddp"))
- options->transports &= ~AFPTRANS_DDP;
- if (strstr(buf, "-client_polling"))
- options->server_notif = 0;
-
- /* figure out options w/ values. currently, this will ignore the setting
- * if memory is lacking. */
-
- if ((c = getoption(buf, "-hostname"))) {
- int len = strlen (c);
- if (len <= MAXHOSTNAMELEN) {
- memcpy(options->hostname, c, len);
- options->hostname[len] = 0;
- }
- else
- LOG(log_info, logtype_afpd, "WARNING: hostname %s is too long (%d)",c,len);
- }
-
- if ((c = getoption(buf, "-defaultvol")) && (opt = strdup(c)))
- options->defaultvol.name = opt;
- if ((c = getoption(buf, "-systemvol")) && (opt = strdup(c)))
- options->systemvol.name = opt;
- if ((c = getoption(buf, "-loginmesg")) && (opt = strdup(c))) {
- int i = 0, j = 0;
- while (c[i]) {
- if (c[i] != '\\') {
- opt[j++] = c[i];
- } else {
- i++;
- if (c[i] == 'n')
- opt[j++] = '\n';
- }
- i++;
- }
- opt[j] = 0;
- options->loginmesg = opt;
-
- }
- if ((c = getoption(buf, "-guestname")) && (opt = strdup(c)))
- options->guest = opt;
- if ((c = getoption(buf, "-passwdfile")) && (opt = strdup(c)))
- options->passwdfile = opt;
- if ((c = getoption(buf, "-passwdminlen")))
- options->passwdminlen = MIN(1, atoi(c));
- if ((c = getoption(buf, "-loginmaxfail")))
- options->loginmaxfail = atoi(c);
- if ((c = getoption(buf, "-tickleval"))) {
- options->tickleval = atoi(c);
- if (options->tickleval <= 0) {
- options->tickleval = 30;
- }
- }
- if ((c = getoption(buf, "-timeout"))) {
- options->timeout = atoi(c);
- if (options->timeout <= 0) {
- options->timeout = 4;
- }
- }
-
- if ((c = getoption(buf, "-sleep"))) {
- options->sleep = atoi(c) *120;
- if (options->sleep <= 4) {
- options->sleep = 4;
- }
- }
-
- if ((c = getoption(buf, "-server_quantum")))
- options->server_quantum = strtoul(c, NULL, 0);
-
- if ((c = getoption(buf, "-volnamelen"))) {
- options->volnamelen = atoi(c);
- if (options->volnamelen < 8) {
- options->volnamelen = 8; /* max mangled volname "???#FFFF" */
- }
- if (options->volnamelen > 255) {
- options->volnamelen = 255; /* AFP3 spec */
- }
+ /* figure out options w values */
+
+ options->loginmesg = iniparser_getstring(config, INISEC_AFP, "loginmesg", "");
+ options->guest = iniparser_getstring(config, INISEC_AFP, "guestname", "nobody");
+ options->passwdfile = iniparser_getstring(config, INISEC_AFP, "passwdfile", _PATH_AFPDPWFILE);
+ options->uampath = iniparser_getstring(config, INISEC_AFP, "uampath", _PATH_AFPDUAMPATH);
+ options->uamlist = iniparser_getstring(config, INISEC_AFP, "uamlist", "uams_dhx.so,uams_dhx2.so");
+ options->port = iniparser_getstring(config, INISEC_AFP, "port", "548");
+ options->signatureopt = iniparser_getstring(config, INISEC_AFP, "signature", "auto");
+
+ options->connections = iniparser_getint (config, INISEC_AFP, "maxcon", 200);
+ options->passwdminlen = iniparser_getint (config, INISEC_AFP, "passwdminlen", 0);
+ options->tickleval = iniparser_getint (config, INISEC_AFP, "tickleval", 30);
+ options->timeout = iniparser_getint (config, INISEC_AFP, "timeout", 4);
+ options->dsireadbuf = iniparser_getint (config, INISEC_AFP, "dsireadbuf", 12);
+ options->server_quantum = iniparser_getint (config, INISEC_AFP, "server_quantum", DSI_SERVQUANT_DEF);
+ options->volnamelen = iniparser_getint (config, INISEC_AFP, "volnamelen", 80);
+ options->dircachesize = iniparser_getint (config, INISEC_AFP, "dircachesize", DEFAULT_MAX_DIRCACHE_SIZE);
+ options->tcp_sndbuf = iniparser_getint (config, INISEC_AFP, "tcpsndbuf", 0);
+ options->tcp_rcvbuf = iniparser_getint (config, INISEC_AFP, "tcprcvbuf", 0);
+ options->fce_fmodwait = iniparser_getint (config, INISEC_AFP, "fceholdfmod", 60);
+ options->sleep = iniparser_getint (config, INISEC_AFP, "sleep", 10) * 60 * 2;
+ options->disconnect = iniparser_getint (config, INISEC_AFP, "disconnect" 24) * 60 * 2;
+
+ options->k5service = iniparser_getstringdup(config, INISEC_AFP, "k5service", NULL);
+ options->k5realm = iniparser_getstringdup(config, INISEC_AFP, "k5realm", NULL);
+ options->authprintdir = iniparser_getstringdup(config, INISEC_AFP, "authprintdir", NULL);
+ options->ipaddr = iniparser_getstringdup(config, INISEC_AFP, "ipaddr", NULL);
+ options->hostname = iniparser_getstringdup(config, INISEC_AFP, "hostname", NULL);
+ options->ntdomain = iniparser_getstringdup(config, INISEC_AFP, "ntdomain", NULL);
+ options->ntseparator = iniparser_getstringdup(config, INISEC_AFP, "ntseparator", NULL);
+ options->mimicmodel = iniparser_getstringdup(config, INISEC_AFP, "mimicmodel", NULL);
+ options->adminauthuser = iniparser_getstringdup(config, INISEC_AFP, "adminauthuser", NULL);
+
+ if ((p = iniparser_getstring(config, INISEC_AFP, "k5keytab", NULL))) {
+ EC_NULL_LOG( options->k5keytab = malloc(strlen(p) + 14) );
+ snprintf(options->k5keytab, strlen(p) + 14, "KRB5_KTNAME=%s", p);
+ putenv(options->k5keytab);