X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_options.c;h=3ad83fe26d19d1b872ef05b7bf78413ed82aa02b;hb=4054f4b3c85ecab060dafd46c0d3632cadbb5803;hp=0761724f292760d73b7c14e1a785af8e869e32c9;hpb=2c28f365cd2c4f4ac3f8c309a452c6d150dc0271;p=netatalk.git diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index 0761724f..3ad83fe2 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -1,6 +1,4 @@ /* - * $Id: afp_options.c,v 1.54 2010/04/02 16:17:22 hat001 Exp $ - * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -14,50 +12,35 @@ #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 + #include "globals.h" #include "status.h" #include "auth.h" #include "dircache.h" -#include - -#ifdef ADMIN_GRP -#include -#include -#endif /* ADMIN_GRP */ - #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif /* MIN */ @@ -138,8 +121,8 @@ void afp_options_free(struct afp_options *opt, free(opt->uamlist); if (opt->passwdfile && (opt->passwdfile != save->passwdfile)) free(opt->passwdfile); - if (opt->signature && (opt->signature != save->signature)) - free(opt->signature); + if (opt->signatureopt && (opt->signatureopt != save->signatureopt)) + free(opt->signatureopt); if (opt->k5service && (opt->k5service != save->k5service)) free(opt->k5service); if (opt->k5realm && (opt->k5realm != save->k5realm)) @@ -155,6 +138,10 @@ void afp_options_free(struct afp_options *opt, free(opt->ntdomain); if (opt->ntseparator && (opt->ntseparator != save->ntseparator)) free(opt->ntseparator); + if (opt->logconfig && (opt->logconfig != save->logconfig)) + free(opt->logconfig); + if (opt->mimicmodel && (opt->mimicmodel != save->mimicmodel)) + free(opt->mimicmodel); } /* initialize options */ @@ -167,6 +154,7 @@ void afp_options_init(struct afp_options *options) options->systemvol.name = _PATH_AFPDSYSVOL; options->configfile = _PATH_AFPDCONF; options->sigconffile = _PATH_AFPDSIGCONF; + options->uuidconf = _PATH_AFPDUUIDCONF; options->uampath = _PATH_AFPDUAMPATH; options->uamlist = "uams_dhx.so,uams_dhx2.so"; options->guest = "nobody"; @@ -174,10 +162,12 @@ 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"; options->umask = 0; #ifdef ADMIN_GRP options->admingid = 0; @@ -197,6 +187,12 @@ void afp_options_init(struct afp_options *options) options->flags |= OPTION_NOSLP; #endif options->dircachesize = DEFAULT_MAX_DIRCACHE_SIZE; + options->flags |= OPTION_ACL2MACCESS; + 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; + options->mimicmodel = NULL; } /* parse an afpd.conf line. i'm doing it this way because it's @@ -222,7 +218,10 @@ int afp_options_parseline(char *buf, struct afp_options *options) if (strstr(buf, " -slp")) options->flags &= ~OPTION_NOSLP; #endif - +#ifdef USE_ZEROCONF + if (strstr(buf, " -nozeroconf")) + options->flags |= OPTION_NOZEROCONF; +#endif if (strstr(buf, " -nouservolfirst")) options->flags &= ~OPTION_USERVOLFIRST; if (strstr(buf, " -uservolfirst")) @@ -239,6 +238,8 @@ int afp_options_parseline(char *buf, struct afp_options *options) options->flags |= OPTION_CUSTOMICON; if (strstr(buf, " -advertise_ssh")) options->flags |= OPTION_ANNOUNCESSH; + if (strstr(buf, " -noacl2maccess")) + options->flags &= ~OPTION_ACL2MACCESS; /* passwd bits */ if (strstr(buf, " -nosavepassword")) @@ -283,8 +284,22 @@ int afp_options_parseline(char *buf, struct afp_options *options) options->defaultvol.name = opt; if ((c = getoption(buf, "-systemvol")) && (opt = strdup(c))) options->systemvol.name = opt; - if ((c = getoption(buf, "-loginmesg")) && (opt = strdup(c))) + if ((c = getoption(buf, "-loginmesg")) && (opt = strdup(c))) { + int i = 0, j = 0; + while (c[i]) { + if (c[i] != '\\') { + opt[j++] = c[i]; + } else { + i++; + if (c[i] == 'n') + opt[j++] = '\n'; + } + i++; + } + opt[j] = 0; options->loginmesg = opt; + + } if ((c = getoption(buf, "-guestname")) && (opt = strdup(c))) options->guest = opt; if ((c = getoption(buf, "-passwdfile")) && (opt = strdup(c))) @@ -313,6 +328,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); @@ -334,6 +355,7 @@ int afp_options_parseline(char *buf, struct afp_options *options) char *optstr; if ((optstr = getoption(c, "-setuplog"))) { setuplog(optstr); + options->logconfig = optstr; /* at least store the last (possibly only) one */ c += sizeof("-setuplog"); } } @@ -400,6 +422,8 @@ int afp_options_parseline(char *buf, struct afp_options *options) 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; /* do a little checking for the domain name. */ if ((c = getoption(buf, "-fqdn"))) { @@ -452,12 +476,27 @@ int afp_options_parseline(char *buf, struct afp_options *options) if ((c = getoption(buf, "-dircachesize"))) options->dircachesize = atoi(c); - if ((c = getoption(buf, "-signature")) && (opt = strdup(c))) { - set_signature(opt, options); - } - else { - set_signature("auto", options); - } + 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_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, "-mimicmodel")) && (opt = strdup(c))) + options->mimicmodel = opt; return 1; } @@ -477,18 +516,15 @@ 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" ); - printf( " Transport layers:\t" ); + printf( "DDP(AppleTalk) Support:\t" ); #ifdef NO_DDP - puts( "TCP/IP" ); + puts( "No" ); #else - puts( "TCP/IP DDP" ); + puts( "Yes" ); #endif printf( " CNID backends:\t" ); @@ -535,6 +571,13 @@ static void show_version_extended(void ) puts( "No" ); #endif + printf( " Zeroconf support:\t" ); +#ifdef USE_ZEROCONF + puts( "Yes" ); +#else + puts( "No" ); +#endif + printf( " TCP wrappers support:\t" ); #ifdef TCPWRAP puts( "Yes" ); @@ -583,6 +626,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 } /* @@ -591,11 +651,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); } /*