* 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
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) {
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 */
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] = ':';
/* 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");
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)