X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_options.c;h=d1e85bc51722a4b926da27946b938d0c5c33b671;hb=815d557e167e76015934397dffbfa869180dcdbc;hp=380f31b23d5103a29c18f6b14d6ae12b7a8ec251;hpb=ea0117aefed98540d63c9baacbc720023446c50c;p=netatalk.git diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index 380f31b2..d1e85bc5 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -1,5 +1,5 @@ /* - * $Id: afp_options.c,v 1.40 2009-03-26 18:21:40 franklahm 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. @@ -164,10 +164,10 @@ void afp_options_init(struct afp_options *options) 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; @@ -319,48 +319,19 @@ int afp_options_parseline(char *buf, struct afp_options *options) } /* -[no]setuplog []*/ - if ((c = getoption(buf, "-setuplog"))) { - char *ptr, *logtype, *loglevel, *filename; - ptr = c; - - /* logtype */ - logtype = ptr; - - /* get loglevel */ - ptr = strpbrk(ptr, " \t"); - if (ptr) { - *ptr++ = 0; - while (*ptr && isspace(*ptr)) - ptr++; - loglevel = ptr; - - /* get filename */ - ptr = strpbrk(ptr, " \t"); - if (ptr) { - *ptr++ = 0; - while (*ptr && isspace(*ptr)) - ptr++; - } - filename = ptr; - } - - /* finally call setuplog, filename can be NULL */ - 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; - - /* logtype */ - logtype = c; - - /* get filename, can be NULL */ - strtok(c, " \t"); - filename = strtok(NULL, " \t"); - - /* finally call setuplog, filename can be NULL */ - setuplog(logtype, NULL, filename); - } + if ((c = getoption(buf, "-unsetuplog"))) + unsetuplog(c); #ifdef ADMIN_GRP if ((c = getoption(buf, "-admingroup"))) { @@ -477,7 +448,7 @@ int afp_options_parseline(char *buf, struct afp_options *options) * 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 ); @@ -535,7 +506,7 @@ void show_version( ) * Show extended version information about afpd and Netatalk. * Used by "afp -V". */ -void show_version_extended( ) +void show_version_extended(void ) { show_version( );