nfsv4_ace_flags |= ACE_IDENTIFIER_GROUP;
break;
default:
- darwin_aces++;
- continue;
+ LOG(log_error, logtype_afpd, "map_aces_darwin_to_solaris: unkown uuidtype");
+ EC_FAIL;
}
free(name);
name = NULL;
nfsv4_ace_rights |= darwin_to_nfsv4_rights[i].to;
}
- LOG(log_debug9, logtype_afpd, "map_aces_darwin_to_solaris: ACE flags: Darwin:%08x -> NFSv4:%04x", darwin_ace_flags, nfsv4_ace_flags);
- LOG(log_debug9, logtype_afpd, "map_aces_darwin_to_solaris: ACE rights: Darwin:%08x -> NFSv4:%08x", darwin_ace_rights, nfsv4_ace_rights);
+ LOG(log_debug9, logtype_afpd,
+ "map_aces_darwin_to_solaris: ACE flags: Darwin:%08x -> NFSv4:%04x",
+ darwin_ace_flags, nfsv4_ace_flags);
+ LOG(log_debug9, logtype_afpd,
+ "map_aces_darwin_to_solaris: ACE rights: Darwin:%08x -> NFSv4:%08x",
+ darwin_ace_rights, nfsv4_ace_rights);
nfsv4_aces->a_flags = nfsv4_ace_flags;
nfsv4_aces->a_access_mask = nfsv4_ace_rights;
uid = ntohl(*(uint32_t *)(uuidp + 12));
if ((pwd = getpwuid(uid)) == NULL) {
/* not found, add negative entry to cache */
- *type |= UUID_ENOENT;
- *name = "UUID_ENOENT";
+ add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
+ ret = -1;
+ } else {
+ *name = strdup(pwd->pw_name);
add_cachebyuuid(uuidp, *name, *type, 0);
- return -1;
+ ret = 0;
}
- *name = pwd->pw_name;
- add_cachebyuuid(uuidp, *name, *type, 0);
- return 0;
+ LOG(log_debug, logtype_afpd,
+ "getnamefromuuid{local}: UUID: %s -> name: %s, type:%s",
+ uuid_bin2string(uuidp), *name, uuidtype[(*type) & UUIDTYPESTR_MASK]);
+ return ret;
} else if (memcmp(uuidp, local_group_uuid, 12) == 0) {
*type = UUID_GROUP;
gid = ntohl(*(uint32_t *)(uuidp + 12));
if ((grp = getgrgid(gid)) == NULL) {
/* not found, add negative entry to cache */
- *type |= UUID_ENOENT;
- *name = "UUID_ENOENT";
+ add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
+ ret = -1;
+ } else {
+ *name = strdup(grp->gr_name);
add_cachebyuuid(uuidp, *name, *type, 0);
- return -1;
+ ret = 0;
}
- *name = grp->gr_name;
- add_cachebyuuid(uuidp, *name, *type, 0);
- return 0;
+ return ret;
}
#ifdef HAVE_LDAP
if (ret != 0) {
LOG(log_warning, logtype_afpd, "getnamefromuuid(%s): no result from ldap_getnamefromuuid",
uuid_bin2string(uuidp));
- *type |= UUID_ENOENT;
- *name = "UUID_ENOENT";
- add_cachebyuuid(uuidp, *name, *type, 0);
+ add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
return -1;
}
#endif