Lines Matching +full:- +full:- +full:valid +full:- +full:-
3 /*-
36 /*-
97 /* XXX Now, re-apply the renaming that we undid above. */
161 while (len--) { in st_hash()
173 * 0 if ok, -1 otherwise
182 return (-1); in uidtb_start()
185 return (-1); in uidtb_start()
194 * 0 if ok, -1 otherwise
203 return (-1); in gidtb_start()
206 return (-1); in gidtb_start()
215 * 0 if ok, -1 otherwise
224 return (-1); in usrtb_start()
227 return (-1); in usrtb_start()
236 * 0 if ok, -1 otherwise
245 return (-1); in grptb_start()
248 return (-1); in grptb_start()
256 * return the stored name (if valid or invalid match).
276 if ((ptr != NULL) && (ptr->valid > 0) && (ptr->uid == uid)) { in user_from_uid()
280 if (!noname || (ptr->valid == VALID)) in user_from_uid()
281 return (ptr->name); in user_from_uid()
304 ptr->uid = uid; in user_from_uid()
305 (void)snprintf(ptr->name, UNMLEN, "%lu", (long) uid); in user_from_uid()
306 ptr->valid = INVALID; in user_from_uid()
314 return (pw->pw_name); in user_from_uid()
315 ptr->uid = uid; in user_from_uid()
316 (void)strlcpy(ptr->name, pw->pw_name, UNMLEN); in user_from_uid()
317 ptr->valid = VALID; in user_from_uid()
319 return (ptr->name); in user_from_uid()
325 * return the stored name (if valid or invalid match).
345 if ((ptr != NULL) && (ptr->valid > 0) && (ptr->gid == gid)) { in group_from_gid()
349 if (!noname || (ptr->valid == VALID)) in group_from_gid()
350 return (ptr->name); in group_from_gid()
373 ptr->gid = gid; in group_from_gid()
374 (void)snprintf(ptr->name, GNMLEN, "%lu", (long) gid); in group_from_gid()
375 ptr->valid = INVALID; in group_from_gid()
383 return (gr->gr_name); in group_from_gid()
384 ptr->gid = gid; in group_from_gid()
385 (void)strlcpy(ptr->name, gr->gr_name, GNMLEN); in group_from_gid()
386 ptr->valid = VALID; in group_from_gid()
388 return (ptr->name); in group_from_gid()
395 * the uid (if any) for a user name, or a -1 if no match can be found
405 * return -1 for mangled names in uid_from_user()
408 return (-1); in uid_from_user()
410 return (-1); in uid_from_user()
413 * look up in hash table, if found and valid return the uid, in uid_from_user()
414 * if found and invalid, return a -1 in uid_from_user()
419 if ((ptr != NULL) && (ptr->valid > 0) && !strcmp(name, ptr->name)) { in uid_from_user()
420 if (ptr->valid == INVALID) in uid_from_user()
421 return (-1); in uid_from_user()
422 *uid = ptr->uid; in uid_from_user()
441 return (-1); in uid_from_user()
442 *uid = pw->pw_uid; in uid_from_user()
445 (void)strlcpy(ptr->name, name, UNMLEN); in uid_from_user()
447 ptr->valid = INVALID; in uid_from_user()
448 return (-1); in uid_from_user()
450 ptr->valid = VALID; in uid_from_user()
451 *uid = ptr->uid = pw->pw_uid; in uid_from_user()
459 * the gid (if any) for a group name, or a -1 if no match can be found
469 * return -1 for mangled names in gid_from_group()
472 return (-1); in gid_from_group()
474 return (-1); in gid_from_group()
477 * look up in hash table, if found and valid return the uid, in gid_from_group()
478 * if found and invalid, return a -1 in gid_from_group()
483 if ((ptr != NULL) && (ptr->valid > 0) && !strcmp(name, ptr->name)) { in gid_from_group()
484 if (ptr->valid == INVALID) in gid_from_group()
485 return (-1); in gid_from_group()
486 *gid = ptr->gid; in gid_from_group()
505 return (-1); in gid_from_group()
506 *gid = gr->gr_gid; in gid_from_group()
510 (void)strlcpy(ptr->name, name, GNMLEN); in gid_from_group()
512 ptr->valid = INVALID; in gid_from_group()
513 return (-1); in gid_from_group()
515 ptr->valid = VALID; in gid_from_group()
516 *gid = ptr->gid = gr->gr_gid; in gid_from_group()
542 return (-1); in pwcache_userdb()
568 return (-1); in pwcache_groupdb()
610 if (r == -1) in main()
627 u = -1; in main()
629 if (r == -1) in main()