X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=etc%2Fafpd%2Fafp_options.c;h=9bb48042fa1e98ffdb5033edf70173995c310740;hp=e20adc4096ebe1a33d57480cb7fc0d7a731ff5ca;hb=5116ed2346ea7ee6e5a9858dee94f3eacdc00d7e;hpb=6dd8290ee6ab7cc5898bc001cc8ee4fe9403643b diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index e20adc40..9bb48042 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -12,49 +12,34 @@ #include #include - -/* STDC check */ -#if STDC_HEADERS #include -#else /* STDC_HEADERS */ -#ifndef HAVE_STRCHR -#define strchr index -#define strrchr index -#endif /* HAVE_STRCHR */ -char *strchr (), *strrchr (); -#ifndef HAVE_MEMCPY -#define memcpy(d,s,n) bcopy ((s), (d), (n)) -#define memmove(d,s,n) bcopy ((s), (d), (n)) -#endif /* ! HAVE_MEMCPY */ -#endif /* STDC_HEADERS */ - #include -#ifdef HAVE_UNISTD_H #include -#endif /* HAVE_UNISTD_H */ #include #include #include #include #include + #ifdef HAVE_NETDB_H #include #endif /* HAVE_NETDB_H */ +#ifdef ADMIN_GRP +#include +#include +#endif /* ADMIN_GRP */ + #include #include +#include + #include "globals.h" #include "status.h" #include "auth.h" #include "dircache.h" - -#include - -#ifdef ADMIN_GRP -#include -#include -#endif /* ADMIN_GRP */ +#include "fce_api.h" #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -175,8 +160,9 @@ void afp_options_init(struct afp_options *options) options->transports = AFPTRANS_TCP; /* TCP only */ options->passwdfile = _PATH_AFPDPWFILE; options->tickleval = 30; - options->timeout = 4; - options->sleep = 10* 120; /* 10 h in 30 seconds tick */ + options->timeout = 4; /* 4 tickles = 2 minutes */ + options->sleep = 10 * 60 * 2; /* 10 h in 30 seconds tick */ + options->disconnected = 10 * 60 * 2; /* 10 h in 30 seconds tick */ options->server_notif = 1; options->authprintdir = NULL; options->signatureopt = "auto"; @@ -200,7 +186,10 @@ void afp_options_init(struct afp_options *options) #endif options->dircachesize = DEFAULT_MAX_DIRCACHE_SIZE; options->flags |= OPTION_ACL2MACCESS; - options->flags |= OPTION_UUID; /* gets disabled if LDAP isn't configured */ + options->flags |= OPTION_UUID; + 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; } /* parse an afpd.conf line. i'm doing it this way because it's @@ -248,8 +237,6 @@ 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, " -nouuid")) - options->flags &= ~OPTION_UUID; /* passwd bits */ if (strstr(buf, " -nosavepassword")) @@ -338,6 +325,12 @@ int afp_options_parseline(char *buf, struct afp_options *options) } } + if ((c = getoption(buf, "-dsireadbuf"))) { + options->dsireadbuf = atoi(c); + if (options->dsireadbuf < 6) + options->dsireadbuf = 6; + } + if ((c = getoption(buf, "-server_quantum"))) options->server_quantum = strtoul(c, NULL, 0); @@ -480,6 +473,21 @@ int afp_options_parseline(char *buf, struct afp_options *options) if ((c = getoption(buf, "-dircachesize"))) options->dircachesize = atoi(c); + if ((c = getoption(buf, "-tcpsndbuf"))) + options->tcp_sndbuf = atoi(c); + + if ((c = getoption(buf, "-tcprcvbuf"))) + options->tcp_rcvbuf = atoi(c); + + if ((c = getoption(buf, "-fcelistener"))) { + LOG(log_note, logtype_afpd, "Adding fce listener \"%s\"", c); + fce_add_udp_socket(c); + } + if ((c = getoption(buf, "-fcecoalesce"))) { + LOG(log_ote, logtype_afpd, "Fce coalesce: %s", c); + fce_set_coalesce(c); + } + return 1; } @@ -498,13 +506,7 @@ static void show_version( void ) puts( "afpd has been compiled with support for these features:\n" ); - printf( " AFP3.x support:\t" ); -#ifdef AFP3x - puts( "Yes" ); -#else - puts( "No" ); -#endif - + printf( " AFP3.x support:\tYes\n" ); printf( " TCP/IP Support:\t" ); puts( "Yes" ); @@ -614,6 +616,23 @@ static void show_version_extended(void ) #else puts( "No" ); #endif + + printf( " ACL support:\t" ); +#ifdef HAVE_ACLS + puts( "Yes" ); +#else + puts( "No" ); +#endif + + printf( " EA support:\t" ); + puts( EA_MODULES ); + + printf( " LDAP support:\t" ); +#ifdef HAVE_LDAP + puts( "Yes" ); +#else + puts( "No" ); +#endif } /* @@ -622,11 +641,18 @@ static void show_version_extended(void ) static void show_paths( void ) { printf( " afpd.conf:\t%s\n", _PATH_AFPDCONF ); - printf( " afp_signature.conf:\t%s\n", _PATH_AFPDSIGCONF ); printf( " AppleVolumes.system:\t%s\n", _PATH_AFPDSYSVOL ); printf( " AppleVolumes.default:\t%s\n", _PATH_AFPDDEFVOL ); + printf( " afp_signature.conf:\t%s\n", _PATH_AFPDSIGCONF ); + printf( " afp_voluuid.conf:\t%s\n", _PATH_AFPDUUIDCONF ); +#ifdef HAVE_LDAP + printf( " afp_ldap.conf:\t%s\n", _PATH_ACL_LDAPCONF ); +#else + printf( " afp_ldap.conf:\tnot supported\n"); +#endif printf( " UAM search path:\t%s\n", _PATH_AFPDUAMPATH ); - printf( " Server messages path:\t%s\n", SERVERTEXT); + printf( " Server messages path:\t%s\n", SERVERTEXT); + printf( " lockfile:\t%s\n", _PATH_AFPDLOCK); } /*