X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_options.c;h=256c91a56676a535c4e428ff9f16b23f117d3317;hb=30bdec7c3396de87144d5f6d45f11ffa6dad116b;hp=9bb48042fa1e98ffdb5033edf70173995c310740;hpb=5116ed2346ea7ee6e5a9858dee94f3eacdc00d7e;p=netatalk.git diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index 9bb48042..256c91a5 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -34,12 +34,12 @@ #include #include #include +#include +#include -#include "globals.h" #include "status.h" #include "auth.h" #include "dircache.h" -#include "fce_api.h" #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -140,6 +140,10 @@ void afp_options_free(struct afp_options *opt, free(opt->ntseparator); if (opt->logconfig && (opt->logconfig != save->logconfig)) free(opt->logconfig); + if (opt->mimicmodel && (opt->mimicmodel != save->mimicmodel)) + free(opt->mimicmodel); + if (opt->adminauthuser && (opt->adminauthuser != save->adminauthuser)) + free(opt->adminauthuser); } /* initialize options */ @@ -190,6 +194,9 @@ void afp_options_init(struct afp_options *options) options->tcp_sndbuf = 0; /* 0 means don't change OS default */ options->tcp_rcvbuf = 0; /* 0 means don't change OS default */ options->dsireadbuf = 12; + options->mimicmodel = NULL; + options->fce_fmodwait = 60; /* put fmod events 60 seconds on hold */ + options->adminauthuser = NULL; } /* parse an afpd.conf line. i'm doing it this way because it's @@ -237,6 +244,10 @@ int afp_options_parseline(char *buf, struct afp_options *options) options->flags |= OPTION_ANNOUNCESSH; if (strstr(buf, " -noacl2maccess")) options->flags &= ~OPTION_ACL2MACCESS; + if (strstr(buf, " -keepsessions")) { + default_options.flags |= OPTION_KEEPSESSIONS; + options->flags |= OPTION_KEEPSESSIONS; + } /* passwd bits */ if (strstr(buf, " -nosavepassword")) @@ -319,9 +330,9 @@ int afp_options_parseline(char *buf, struct afp_options *options) } if ((c = getoption(buf, "-sleep"))) { - options->sleep = atoi(c) *120; + options->disconnected = options->sleep = atoi(c) * 120; if (options->sleep <= 4) { - options->sleep = 4; + options->disconnected = options->sleep = 4; } } @@ -351,8 +362,11 @@ int afp_options_parseline(char *buf, struct afp_options *options) while (NULL != (c = strstr(c, "-setuplog"))) { char *optstr; if ((optstr = getoption(c, "-setuplog"))) { + /* hokey2: options->logconfig must be converted to store an array of logstrings */ + if (options->logconfig) + free(options->logconfig); + options->logconfig = strdup(optstr); setuplog(optstr); - options->logconfig = optstr; /* at least store the last (possibly only) one */ c += sizeof("-setuplog"); } } @@ -417,8 +431,6 @@ int afp_options_parseline(char *buf, struct afp_options *options) if ((c = getoption(buf, "-port"))) options->port = strdup(c); - if ((c = getoption(buf, "-ddpaddr"))) - atalk_aton(c, &options->ddpaddr); if ((c = getoption(buf, "-signature")) && (opt = strdup(c))) options->signatureopt = opt; @@ -484,9 +496,22 @@ int afp_options_parseline(char *buf, struct afp_options *options) fce_add_udp_socket(c); } if ((c = getoption(buf, "-fcecoalesce"))) { - LOG(log_ote, logtype_afpd, "Fce coalesce: %s", c); + LOG(log_note, logtype_afpd, "Fce coalesce: %s", c); fce_set_coalesce(c); } + if ((c = getoption(buf, "-fceevents"))) { + LOG(log_note, logtype_afpd, "Fce events: %s", c); + fce_set_events(c); + } + + if ((c = getoption(buf, "-fceholdfmod"))) + options->fce_fmodwait = atoi(c); + + if ((c = getoption(buf, "-mimicmodel")) && (opt = strdup(c))) + options->mimicmodel = opt; + + if ((c = getoption(buf, "-adminauthuser")) && (opt = strdup(c))) + options->adminauthuser = opt; return 1; } @@ -497,6 +522,8 @@ int afp_options_parseline(char *buf, struct afp_options *options) */ static void show_version( void ) { + int num, i; + printf( "afpd %s - Apple Filing Protocol (AFP) daemon of Netatalk\n\n", VERSION ); puts( "This program is free software; you can redistribute it and/or modify it under" ); @@ -506,16 +533,12 @@ static void show_version( void ) puts( "afpd has been compiled with support for these features:\n" ); - printf( " AFP3.x support:\tYes\n" ); - printf( " TCP/IP Support:\t" ); - puts( "Yes" ); - - printf( "DDP(AppleTalk) Support:\t" ); -#ifdef NO_DDP - puts( "No" ); -#else - puts( "Yes" ); -#endif + num = sizeof( afp_versions ) / sizeof( afp_versions[ 0 ] ); + printf( " AFP versions:\t" ); + for ( i = 0; i < num; i++ ) { + printf( "%d.%d ", afp_versions[ i ].av_number/10, afp_versions[ i ].av_number%10); + } + puts( "" ); printf( " CNID backends:\t" ); #ifdef CNID_BACKEND_CDB @@ -603,19 +626,8 @@ static void show_version_extended(void ) puts( "No" ); #endif - printf( " Dropbox kludge:\t" ); -#ifdef DROPKLUDGE - puts( "Yes" ); -#else - puts( "No" ); -#endif - - printf( " Force volume uid/gid:\t" ); -#ifdef FORCE_UIDGID - puts( "Yes" ); -#else - puts( "No" ); -#endif + printf( " EA support:\t" ); + puts( EA_MODULES ); printf( " ACL support:\t" ); #ifdef HAVE_ACLS @@ -624,9 +636,6 @@ static void show_version_extended(void ) puts( "No" ); #endif - printf( " EA support:\t" ); - puts( EA_MODULES ); - printf( " LDAP support:\t" ); #ifdef HAVE_LDAP puts( "Yes" ); @@ -683,11 +692,14 @@ int afp_options_parse(int ac, char **av, struct afp_options *options) *p = '\0'; } +#ifdef ultrix if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) { p = av[ 0 ]; } else { p++; } + openlog( p, LOG_PID ); /* ultrix only */ +#endif /* ultrix */ while (EOF != ( c = getopt( ac, av, OPTIONS )) ) { switch ( c ) { @@ -779,11 +791,5 @@ int afp_options_parse(int ac, char **av, struct afp_options *options) exit( 2 ); } -#ifdef ultrix - openlog( p, LOG_PID ); /* ultrix only */ -#else - set_processname(p); -#endif /* ultrix */ - return 1; }