Lines Matching defs:uid
55 * routines that control user, group, uid and gid caches (for the archive
63 static UIDC **uidtb = NULL; /* uid to name cache */
65 static UIDC **usrtb = NULL; /* user name to uid cache */
166 * caches the name (if any) for the uid. If frc set, we always return the
173 name_uid(uid_t uid, int frc)
182 * see if we have this uid cached
184 ptr = uidtb[uid % UID_SZ];
185 if ((ptr != NULL) && (ptr->valid > 0) && (ptr->uid == uid)) {
187 * have an entry for this uid
195 * No entry for this uid, we will add it
202 ptr = uidtb[uid % UID_SZ] = (UIDC *)malloc(sizeof(UIDC));
204 if ((pw = getpwuid(uid)) == NULL) {
206 * no match for this uid in the local password file
207 * a string that is the uid in numeric format
211 ptr->uid = uid;
214 (void)snprintf(ptr->name, sizeof(ptr->name), "%u", uid);
217 (unsigned long)uid);
223 * there is an entry for this uid in the password file
227 ptr->uid = uid;
308 * caches the uid for a given user name. We use a simple hash table.
310 * the uid (if any) for a user name, or a -1 if no match can be found
314 uid_name(char *name, uid_t *uid)
329 * look up in hash table, if found and valid return the uid,
336 *uid = ptr->uid;
351 * or store the matching uid
356 *uid = pw->pw_uid;
366 *uid = ptr->uid = pw->pw_uid;
393 * look up in hash table, if found and valid return the uid,