/*
- * $Id: afp_options.c,v 1.30.2.1 2003-05-26 11:17:25 didg Exp $
+ * $Id: afp_options.c,v 1.30.2.2.2.8 2004-06-09 02:07:15 bfernhomberg Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
+/* FIXME CNID */
+char Cnid_srv[MAXHOSTNAMELEN + 1] = "localhost";
+int Cnid_port = 4700;
+
#define OPTIONS "dn:f:s:uc:g:P:ptDS:TL:F:U:Ivm:"
#define LENGTH 512
free(opt->uampath);
if (opt->uamlist && (opt->uamlist != save->uamlist))
free(opt->uamlist);
- if (opt->nlspath && (opt->nlspath != save->nlspath))
- free(opt->nlspath);
if (opt->passwdfile && (opt->passwdfile != save->passwdfile))
free(opt->passwdfile);
if (opt->signature && (opt->signature != save->signature))
free(opt->k5service);
if (opt->k5realm && (opt->k5realm != save->k5realm))
free(opt->k5realm);
+ if (opt->k5keytab && (opt->k5keytab != save->k5keytab))
+ free(opt->k5keytab);
+ if (opt->unixcodepage && (opt->unixcodepage != save->unixcodepage))
+ free(opt->unixcodepage);
+ if (opt->maccodepage && (opt->maccodepage != save->maccodepage))
+ free(opt->maccodepage);
}
/* initialize options */
options->defaultvol.name = _PATH_AFPDDEFVOL;
options->systemvol.name = _PATH_AFPDSYSVOL;
options->configfile = _PATH_AFPDCONF;
- options->nlspath = _PATH_AFPDNLSPATH;
options->uampath = _PATH_AFPDUAMPATH;
options->uamlist = "uams_clrtxt.so,uams_dhx.so";
options->guest = "nobody";
options->passwdfile = _PATH_AFPDPWFILE;
options->tickleval = 30;
options->timeout = 4;
+ options->sleep = 10* 120; /* 10 h in 30 seconds tick */
options->server_notif = 1;
options->authprintdir = NULL;
options->signature = "host";
#endif /* ADMIN_GRP */
options->k5service = NULL;
options->k5realm = NULL;
+ options->k5keytab = NULL;
+ options->unixcharset = CH_UNIX;
+ options->unixcodepage = "LOCALE";
+ options->maccharset = CH_MAC;
+ options->maccodepage = "MAC_ROMAN";
}
/* parse an afpd.conf line. i'm doing it this way because it's
options->flags &= ~OPTION_CUSTOMICON;
if (strstr(buf, " -icon"))
options->flags |= OPTION_CUSTOMICON;
+ if (strstr(buf, " -advertise_ssh"))
+ options->flags |= OPTION_ANNOUNCESSH;
/* passwd bits */
if (strstr(buf, " -nosavepassword"))
}
}
+ 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);
options->k5service = opt;
if ((c = getoption(buf, "-k5realm")) && (opt = strdup(c)))
options->k5realm = opt;
- if ((c = getoption(buf, "-k5keytab")))
- setenv( "KRB5_KTNAME", c, 1 );
+ if ((c = getoption(buf, "-k5keytab"))) {
+ if ( NULL == (options->k5keytab = (char *) malloc(sizeof(char)*(strlen(c)+14)) )) {
+ LOG(log_error, logtype_afpd, "malloc failed");
+ exit(-1);
+ }
+ snprintf(options->k5keytab, strlen(c)+14, "KRB5_KTNAME=%s", c);
+ putenv(options->k5keytab);
+ /* setenv( "KRB5_KTNAME", c, 1 ); */
+ }
if ((c = getoption(buf, "-authprintdir")) && (opt = strdup(c)))
options->authprintdir = opt;
if ((c = getoption(buf, "-uampath")) && (opt = strdup(c)))
options->uampath = opt;
if ((c = getoption(buf, "-uamlist")) && (opt = strdup(c)))
options->uamlist = opt;
- if ((c = getoption(buf, "-nlspath")) && (opt = strdup(c)))
- options->nlspath = opt;
if ((c = getoption(buf, "-ipaddr"))) {
struct in_addr inaddr;
if (inet_aton(c, &inaddr) && (opt = strdup(c))) {
if (!gethostbyaddr((const char *) &inaddr, sizeof(inaddr), AF_INET))
- LOG(log_info, logtype_afpd, "WARNING: can't find %s\n", opt);
+ LOG(log_info, logtype_afpd, "WARNING: can't find %s", opt);
options->ipaddr = opt;
}
}
+ /* FIXME CNID Cnid_srv is a server attribute */
+ if ((c = getoption(buf, "-cnidserver"))) {
+ char *p;
+ int len;
+ p = strchr(c, ':');
+ if (p != NULL && (len = p - c) <= MAXHOSTNAMELEN) {
+ memcpy(Cnid_srv, c, len);
+ Cnid_srv[len] = 0;
+ Cnid_port = atoi(p +1);
+ }
+ }
+
if ((c = getoption(buf, "-port")))
options->port = atoi(c);
if ((c = getoption(buf, "-ddpaddr")))
if ((opt = strdup(c)))
options->fqdn = opt;
}
+ else {
+ LOG(log_error, logtype_afpd, "error parsing -fqdn, gethostbyname failed for: %s", c);
+ }
+ }
+
+ if ((c = getoption(buf, "-unixcodepage"))) {
+ if ((charset_t)-1 == ( options->unixcharset = add_charset(c)) ) {
+ options->unixcharset = CH_UNIX;
+ LOG(log_warning, logtype_afpd, "setting Unix codepage to '%s' failed", c);
+ }
+ else {
+ if ((opt = strdup(c)))
+ options->unixcodepage = opt;
+ }
+ }
+
+ if ((c = getoption(buf, "-maccodepage"))) {
+ if ((charset_t)-1 == ( options->maccharset = add_charset(c)) ) {
+ options->maccharset = CH_MAC;
+ LOG(log_warning, logtype_afpd, "setting Mac codepage to '%s' failed", c);
+ }
+ else {
+ if ((opt = strdup(c)))
+ options->maccodepage = opt;
+ }
}
return 1;