Lines Matching defs:gid
54 * routines that control user, group, uid and gid caches (for the archive
63 static GIDC **gidtb = NULL; /* gid to name cache */
65 static GIDC **grptb = NULL; /* group name to gid cache */
236 * caches the name (if any) for the gid. If frc set, we always return the
243 name_gid(gid_t gid, int frc)
252 * see if we have this gid cached
254 ptr = gidtb[gid % GID_SZ];
255 if ((ptr != NULL) && (ptr->valid > 0) && (ptr->gid == gid)) {
257 * have an entry for this gid
265 * No entry for this gid, we will add it
272 ptr = gidtb[gid % GID_SZ] = (GIDC *)malloc(sizeof(GIDC));
274 if ((gr = getgrgid(gid)) == NULL) {
276 * no match for this gid in the local group file, put in
277 * a string that is the gid in numeric format
281 ptr->gid = gid;
284 (void)snprintf(ptr->name, sizeof(ptr->name), "%u", gid);
287 (unsigned long)gid);
297 ptr->gid = gid;
371 * caches the gid for a given group name. We use a simple hash table.
373 * the gid (if any) for a group name, or a -1 if no match can be found
377 gid_name(char *name, gid_t *gid)
399 *gid = ptr->gid;
413 * or store the matching gid
418 *gid = gr->gr_gid;
429 *gid = ptr->gid = gr->gr_gid;