NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
dougo
Jul 22, 2011Aspirant
Readynas beta for Lion (AFP fix) hoses Mac
Hi, First, thanks for your quick work addressing the Readynas Lion problems. For some reason, it's not working for me. I've got an NV+. I installed the Readynas beta for Lion to get afp workin...
kraney
Jul 24, 2011Aspirant
...and in fact, I think I see the bug. It's in the UUID lookup function.
If the UUID is not found in the cache, and is not a local UID or GID, and you do not have LDAP, then everything falls through and an uninitialized NULL name is added to the cache as the ID corresponding to the UUID, and then it tries to log it. It seems to me like that fall through should return an error.
in libatalk/acl/uuid.c
If the UUID is not found in the cache, and is not a local UID or GID, and you do not have LDAP, then everything falls through and an uninitialized NULL name is added to the cache as the ID corresponding to the UUID, and then it tries to log it. It seems to me like that fall through should return an error.
in libatalk/acl/uuid.c
217 int getnamefromuuid(const uuidp_t uuidp, char **name, uuidtype_t *type) {
218 int ret = 0;
219 uid_t uid;
220 gid_t gid;
221 struct passwd *pwd;
222 struct group *grp;
223
224 if (search_cachebyuuid(uuidp, name, type) == 0) {
225 /* found in cache */
226 LOG(log_debug, logtype_afpd,
227 "getnamefromuuid{cache}: UUID: %s -> name: %s, type%s: %s",
228 uuid_bin2string(uuidp),
229 *name,
230 (*type & UUID_ENOENT) == UUID_ENOENT ? "[negative]" : "",
231 uuidtype[(*type) & UUIDTYPESTR_MASK]);
232 if ((*type & UUID_ENOENT) == UUID_ENOENT)
233 return -1;
234 return 0;
235 }
236
237 /* not found in cache */
238
239 /* Check if UUID is a client local one */
240 if (memcmp(uuidp, local_user_uuid, 12) == 0) {
241 *type = UUID_USER;
242 uid = ntohl(*(uint32_t *)(uuidp + 12));
243 if ((pwd = getpwuid(uid)) == NULL) {
244 /* not found, add negative entry to cache */
245 add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
246 ret = -1;
247 } else {
248 *name = strdup(pwd->pw_name);
249 add_cachebyuuid(uuidp, *name, *type, 0);
250 ret = 0;
251 }
252 LOG(log_debug, logtype_afpd,
253 "getnamefromuuid{local}: UUID: %s -> name: %s, type:%s",
254 uuid_bin2string(uuidp), *name, uuidtype[(*type) & UUIDTYPESTR_MASK]);
255 return ret;
256 } else if (memcmp(uuidp, local_group_uuid, 12) == 0) {
257 *type = UUID_GROUP;
258 gid = ntohl(*(uint32_t *)(uuidp + 12));
259 if ((grp = getgrgid(gid)) == NULL) {
260 /* not found, add negative entry to cache */
261 add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
262 ret = -1;
263 } else {
264 *name = strdup(grp->gr_name);
265 add_cachebyuuid(uuidp, *name, *type, 0);
266 ret = 0;
267 }
268 return ret;
269 }
270
271 #ifdef HAVE_LDAP
272 ret = ldap_getnamefromuuid(uuid_bin2string(uuidp), name, type);
273 if (ret != 0) {
274 LOG(log_warning, logtype_afpd, "getnamefromuuid(%s): no result from ldap_getnamefromuuid",
275 uuid_bin2string(uuidp));
276 add_cachebyuuid(uuidp, "UUID_ENOENT", UUID_ENOENT, 0);
277 return -1;
278 }
279 #endif
280
281 add_cachebyuuid(uuidp, *name, *type, 0);
282
283 LOG(log_debug, logtype_afpd, "getnamefromuuid{LDAP}: UUID: %s -> name: %s, type:%s",
284 uuid_bin2string(uuidp), *name, uuidtype[(*type) & UUIDTYPESTR_MASK]);
285
286 return 0;
287 }
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!