X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Futil%2Fnetatalk_conf.c;h=067ed45436781e08d38b23bd24518d1b96c12f55;hb=c7683d5aae3d154250df531a5d34e4a464b5ced2;hp=2e861a06aba2b94304dbe351fc400775c4da6a6e;hpb=83c9131bbca30fe8834e681420e12cc5c7db8c5a;p=netatalk.git diff --git a/libatalk/util/netatalk_conf.c b/libatalk/util/netatalk_conf.c index 2e861a06..067ed454 100644 --- a/libatalk/util/netatalk_conf.c +++ b/libatalk/util/netatalk_conf.c @@ -402,7 +402,7 @@ static char *volxlate(const AFPObj *obj, * check access list * * this function wants something of the following form: - * "@group,name,name2,@group2,name3" or "@group name name2 @group2 name3" + * "@group,name,name2,@group2,name3". * A NULL argument allows everybody to have access. * We return three things: * -1: no list @@ -418,7 +418,7 @@ static int accessvol(const AFPObj *obj, const char *args, const char *name) return -1; strlcpy(buf, args, sizeof(buf)); - if ((p = strtok(buf, ", ")) == NULL) /* nothing, return okay */ + if ((p = strtok(buf, ",")) == NULL) /* nothing, return okay */ return -1; while (p) { @@ -564,7 +564,7 @@ static struct vol *creatvol(AFPObj *obj, struct vol *volume = NULL; size_t current_pathlen, another_pathlen; int i, suffixlen, vlen, tmpvlen, u8mvlen, macvlen; - char *tmpname; + char tmpname[AFPVOL_U8MNAMELEN+1]; char path[MAXPATHLEN + 1]; ucs2_t u8mtmpname[(AFPVOL_U8MNAMELEN+1)*2], mactmpname[(AFPVOL_MACNAMELEN+1)*2]; char suffix[6]; /* max is #FFFF */ @@ -670,7 +670,7 @@ static struct vol *creatvol(AFPObj *obj, EC_NULL( volume->v_maccodepage = strdup(obj->options.maccodepage) ); vlen = strlen(name); - tmpname = strdup(name); + strlcpy(tmpname, name, sizeof(tmpname)); for(i = 0; i < vlen; i++) if(tmpname[i] == '/') tmpname[i] = ':'; @@ -1648,7 +1648,7 @@ int afp_config_parse(AFPObj *AFPObj, char *processname) /* figure out options w values */ options->loginmesg = iniparser_getstrdup(config, INISEC_GLOBAL, "login message", NULL); options->guest = iniparser_getstrdup(config, INISEC_GLOBAL, "guest account", "nobody"); - options->extmapfile = iniparser_getstrdup(config, INISEC_GLOBAL, "extmap file", _PATH_CONFDIR "afp_extmap.conf"); + options->extmapfile = iniparser_getstrdup(config, INISEC_GLOBAL, "extmap file", _PATH_CONFDIR "extmap.conf"); options->passwdfile = iniparser_getstrdup(config, INISEC_GLOBAL, "passwd file", _PATH_AFPDPWFILE); options->uampath = iniparser_getstrdup(config, INISEC_GLOBAL, "uam path", _PATH_AFPDUAMPATH); options->uamlist = iniparser_getstrdup(config, INISEC_GLOBAL, "uam list", "uams_dhx.so uams_dhx2.so"); @@ -1780,7 +1780,10 @@ int afp_config_parse(AFPObj *AFPObj, char *processname) options->maccharset = CH_MAC; LOG(log_debug, logtype_afpd, "Global mac charset is %s", options->maccodepage); - EC_ZERO_LOG( readextmap(options->extmapfile) ); + if (readextmap(options->extmapfile) != 0) { + LOG(log_error, logtype_afpd, "Couldn't load extension -> type/creator mappings file \"%s\"", + options->extmapfile); + } /* Check for sane values */ if (options->tickleval <= 0)