Lines Matching defs:gid
72 * next gid to stdout
124 gid_t gid = grp->gr_gid;
133 pw_log(cnf, mode, W_GROUP, "%s(%ld) removed", a_name->val, (long) gid);
342 gid_t gid = (gid_t) - 1;
346 * Check the given gid, if any
349 gid = (gid_t) atol(a_gid->val);
351 if ((grp = GETGRGID(gid)) != NULL && getarg(args, 'o') == NULL)
352 errx(EX_DATAERR, "gid `%ld' has already been allocated", (long) grp->gr_gid);
357 * We need to allocate the next available gid under one of
358 * two policies a) Grab the first unused gid b) Grab the
359 * highest possible unused gid
381 gid = (gid_t) (bm_firstunset(&bm) + cnf->min_gid);
383 gid = (gid_t) (bm_lastset(&bm) + 1);
384 if (!bm_isset(&bm, gid))
385 gid += cnf->min_gid;
387 gid = (gid_t) (bm_firstunset(&bm) + cnf->min_gid);
393 if (gid < cnf->min_gid || gid > cnf->max_gid)
394 errx(EX_SOFTWARE, "unable to allocate a new gid - range fully used");
397 return gid;