/*
- * $Id: afp_options.c,v 1.37 2008-05-16 04:19:41 didg Exp $
+ * $Id: afp_options.c,v 1.46 2009-10-13 22:55:36 didg Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
options->systemvol.name = _PATH_AFPDSYSVOL;
options->configfile = _PATH_AFPDCONF;
options->uampath = _PATH_AFPDUAMPATH;
- options->uamlist = "uams_clrtxt.so,uams_dhx.so";
+ options->uamlist = "uams_dhx.so,uams_dhx2.so";
options->guest = "nobody";
options->loginmesg = "";
- options->transports = AFPTRANS_ALL;
+ options->transports = AFPTRANS_TCP; /* TCP only */
options->passwdfile = _PATH_AFPDPWFILE;
options->tickleval = 30;
options->timeout = 4;
options->unixcodepage = "LOCALE";
options->maccharset = CH_MAC;
options->maccodepage = "MAC_ROMAN";
-
+ options->volnamelen = 80; /* spec: 255, 10.1: 73, 10.4/10.5: 80 */
options->ntdomain = NULL;
options->ntseparator = NULL;
}
if ((c = getoption(buf, "-server_quantum")))
options->server_quantum = strtoul(c, NULL, 0);
-#ifndef DISABLE_LOGGER
- /* -setuplogtype <syslog|filelog> <logtype> <loglevel> <filename>*/
- /* -[no]setuplog <logtype> <loglevel> [<filename>]*/
- if ((c = getoption(buf, "-setuplog")))
- {
- char *ptr, *logsource, *logtype, *loglevel, *filename;
-
- LOG(log_debug6, logtype_afpd, "setting up logtype, c is %s", c);
- ptr = c;
-
- /*
- logsource = ptr = c;
- if (ptr)
- {
- ptr = strpbrk(ptr, " \t");
- if (ptr)
- {
- *ptr++ = 0;
- while (*ptr && isspace(*ptr))
- ptr++;
- }
- }
- */
-
- logtype = ptr;
- if (ptr)
- {
- ptr = strpbrk(ptr, " \t");
- if (ptr)
- {
- *ptr++ = 0;
- while (*ptr && isspace(*ptr))
- ptr++;
- }
- }
-
- loglevel = ptr;
- if (ptr)
- {
- ptr = strpbrk(ptr, " \t");
- if (ptr)
- {
- *ptr++ = 0;
- while (*ptr && isspace(*ptr))
- ptr++;
+ if ((c = getoption(buf, "-volnamelen"))) {
+ options->volnamelen = atoi(c);
+ if (options->volnamelen < 8) {
+ options->volnamelen = 8; /* max mangled volname "???#FFFF" */
}
- }
-
- filename = ptr;
- if (ptr)
- {
- ptr = strpbrk(ptr, " \t");
- if (ptr)
- {
- *ptr++ = 0;
- while (*ptr && isspace(*ptr))
- ptr++;
+ if (options->volnamelen > 255) {
+ options->volnamelen = 255; /* AFP3 spec */
}
- }
-
- LOG(log_debug7, logtype_afpd, "calling setuplog %s %s %s",
- logtype, loglevel, filename);
+ }
- setuplog(logtype, loglevel, filename);
+ /* -[no]setuplog <logtype> <loglevel> [<filename>]*/
+ c = buf;
+ /* Now THIS is hokey! Multiple occurrences are not supported by our current code, */
+ /* so I have to loop myself. */
+ while (NULL != (c = strstr(c, "-setuplog"))) {
+ char *optstr;
+ if ((optstr = getoption(c, "-setuplog"))) {
+ setuplog(optstr);
+ c += sizeof("-setuplog");
+ }
}
if ((c = getoption(buf, "-unsetuplog")))
- {
- char *ptr, *logtype, *loglevel, *filename;
-
- LOG(log_debug6, logtype_afpd, "unsetting up logtype, c is %s", c);
-
- ptr = c;
- logtype = ptr;
- if (ptr)
- {
- ptr = strpbrk(ptr, " \t");
- if (ptr)
- {
- *ptr++ = 0;
- while (*ptr && isspace(*ptr))
- ptr++;
- }
- }
-
- loglevel = ptr;
- if (ptr)
- {
- ptr = strpbrk(ptr, " \t");
- if (ptr)
- {
- *ptr++ = 0;
- while (*ptr && isspace(*ptr))
- ptr++;
- }
- }
-
- filename = ptr;
- if (ptr)
- {
- ptr = strpbrk(ptr, " \t");
- if (ptr)
- {
- *ptr++ = 0;
- while (*ptr && isspace(*ptr))
- ptr++;
- }
- }
-
- LOG(log_debug7, logtype_afpd, "calling setuplog %s %s %s",
- logtype, NULL, filename);
+ unsetuplog(c);
- setuplog(logtype, NULL, filename);
- }
-#endif /* DISABLE_LOGGER */
#ifdef ADMIN_GRP
if ((c = getoption(buf, "-admingroup"))) {
struct group *gr = getgrnam(c);
* Show version information about afpd.
* Used by "afp -v".
*/
-void show_version( )
+void show_version( void )
{
printf( "afpd %s - Apple Filing Protocol (AFP) daemon of Netatalk\n\n", VERSION );
* Show extended version information about afpd and Netatalk.
* Used by "afp -V".
*/
-void show_version_extended( )
+void show_version_extended(void )
{
show_version( );
#ifdef ultrix
openlog( p, LOG_PID ); /* ultrix only */
-#else /* ultrix */
+#else
set_processname(p);
- syslog_setup(log_debug, logtype_default, logoption_ndelay|logoption_pid, logfacility_daemon);
#endif /* ultrix */
return 1;