pwd = getpwnam(name);
if (!pwd) {
LOG(log_error, logtype_afpd, "map_aces_darwin_to_solaris: getpwnam: %s", strerror(errno));
+ free(name);
return -1;
}
nfsv4_aces->a_who = pwd->pw_uid;
grp = getgrnam(name);
if (!grp) {
LOG(log_error, logtype_afpd, "map_aces_darwin_to_solaris: getgrnam: %s", strerror(errno));
+ free(name);
return -1;
}
nfsv4_aces->a_who = (uid_t)(grp->gr_gid);
static int check_acl_access(const char *path, const uuidp_t uuid, uint32_t requested_darwin_rights)
{
int ret, i, ace_count, dir, checkgroup;
- char *username; /* might be group too */
+ char *username = NULL; /* might be group too */
uuidtype_t uuidtype;
uid_t uid;
gid_t pgid;
ret = AFPERR_MISC;
goto exit;
}
+ if (ace_count == 0) {
+ LOG(log_debug, logtype_afpd, "check_access: 0 ACEs from get_nfsv4_acl");
+ ret = AFPERR_MISC;
+ goto exit;
+ }
+
/* Now check requested rights */
ret = AFPERR_ACCESS;
i = 0;