X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_config.c;h=a766d26f5a74762f9c3ff7102e6388bd661cc2a6;hb=b8c1894353b62eb52e59d4e0150fd3c25dcd86ba;hp=2e25df4caaa9a722bd129462d1b83057627239c3;hpb=7189b6206a9174ba3292cb53a16bb805a72b18d0;p=netatalk.git diff --git a/etc/afpd/afp_config.c b/etc/afpd/afp_config.c index 2e25df4c..a766d26f 100644 --- a/etc/afpd/afp_config.c +++ b/etc/afpd/afp_config.c @@ -1,5 +1,5 @@ /* - * $Id: afp_config.c,v 1.25 2009-01-20 04:31:10 didg Exp $ + * $Id: afp_config.c,v 1.28 2009-10-29 11:35:58 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -50,6 +50,9 @@ char *strchr (), *strrchr (); #ifdef USE_SRVLOC #include #endif /* USE_SRVLOC */ +#ifdef HAVE_NFSv4_ACLS +#include +#endif #include "globals.h" #include "afp_config.h" @@ -114,7 +117,7 @@ static char * srvloc_encode(const struct afp_options *options, const char *name) /* Convert name to maccharset */ if ((size_t)-1 ==(convert_string_allocate( options->unixcharset, options->maccharset, - name, strlen(name), &conv_name)) ) + name, -1, &conv_name)) ) return (char*)name; /* Escape characters */ @@ -538,6 +541,13 @@ AFPConfig *configinit(struct afp_options *cmdline) struct afp_options options; AFPConfig *config=NULL, *first = NULL; +#ifdef HAVE_NFSv4_ACLS + /* Parse ldap.conf first so we can set the uuid option */ + LOG(log_debug, logtype_afpd, "Start parsing ldap.conf"); + acl_ldap_readconfig(_PATH_ACL_LDAPCONF); + LOG(log_debug, logtype_afpd, "Finished parsing ldap.conf"); +#endif + status_reset(); /* if config file doesn't exist, load defaults */ if ((fp = fopen(cmdline->configfile, "r")) == NULL) @@ -574,6 +584,12 @@ AFPConfig *configinit(struct afp_options *cmdline) if (!afp_options_parseline(p, &options)) continue; +#ifdef HAVE_NFSv4_ACLS + /* Enable UUID support if LDAP config is complete */ + if (ldap_config_valid) + options.flags |= OPTION_UUID; +#endif + /* this should really get a head and a tail to simplify things. */ if (!first) { if ((first = AFPConfigInit(&options, cmdline))) @@ -587,7 +603,7 @@ AFPConfig *configinit(struct afp_options *cmdline) fclose(fp); if (!have_option) - return AFPConfigInit(cmdline, cmdline); + first = AFPConfigInit(cmdline, cmdline); return first; }