/freebsd/crypto/openssh/ |
H A D | groupaccess.c | 42 static int ngroups; variable 56 if (ngroups > 0) in ga_init() 59 ngroups = NGROUPS_MAX; in ga_init() 61 ngroups = MAX(NGROUPS_MAX, sysconf(_SC_NGROUPS_MAX)); in ga_init() 64 groups_bygid = xcalloc(ngroups, sizeof(*groups_bygid)); in ga_init() 65 while (getgrouplist(user, base, groups_bygid, &ngroups) == -1) { in ga_init() 68 groups_bygid = xreallocarray(groups_bygid, ngroups, in ga_init() 71 groups_byname = xcalloc(ngroups, sizeof(*groups_byname)); in ga_init() 73 for (i = 0, j = 0; i < ngroups; i++) in ga_init() 77 return (ngroups = j); in ga_init() [all …]
|
/freebsd/contrib/openbsm/bin/auditdistd/ |
H A D | sandbox.c | 81 int ngroups, ret; in sandbox() local 109 ngroups = sysconf(_SC_NGROUPS_MAX); in sandbox() 110 if (ngroups == -1) { in sandbox() 113 ngroups = NGROUPS_MAX; in sandbox() 115 ngroups++; /* For base gid. */ in sandbox() 116 groups = malloc(sizeof(groups[0]) * ngroups); in sandbox() 119 ngroups); in sandbox() 122 if (getgrouplist(user, pw->pw_gid, groups, &ngroups) == -1) { in sandbox() 161 if (setgroups(ngroups, groups) == -1) { in sandbox() 209 PJDLOG_VERIFY(getgroups(0, NULL) == ngroups); in sandbox() [all …]
|
/freebsd/crypto/openssh/openbsd-compat/ |
H A D | getgrouplist.c | 49 int i, ngroups; in getgrouplist() local 54 ngroups = 0; in getgrouplist() 60 if (ngroups >= maxgroups) { in getgrouplist() 61 *grpcnt = ngroups; in getgrouplist() 64 groups[ngroups++] = agroup; in getgrouplist() 73 for (bail = 0, i = 0; bail == 0 && i < ngroups; i++) in getgrouplist() 80 if (ngroups >= maxgroups) { in getgrouplist() 84 groups[ngroups++] = grp->gr_gid; in getgrouplist() 91 *grpcnt = ngroups; in getgrouplist()
|
H A D | port-aix.c | 447 int ret = 0, ngroups = 0, maxgroups; in getgrouplist() local 462 groups[ngroups++] = pgid; in getgrouplist() 467 if (ngroups >= maxgroups || ll < 0 || ll > UID_MAX) { in getgrouplist() 474 groups[ngroups++] = gid; in getgrouplist() 478 *grpcnt = ngroups; in getgrouplist()
|
/freebsd/sys/rpc/ |
H A D | authunix_prot.c | 63 uint32_t ngroups, i; in xdr_authunix_parms() local 100 ngroups = cred->cr_ngroups - 1; in xdr_authunix_parms() 101 if (ngroups > NGRPS) in xdr_authunix_parms() 102 ngroups = NGRPS; in xdr_authunix_parms() 105 if (!xdr_uint32_t(xdrs, &ngroups)) in xdr_authunix_parms() 107 for (i = 0; i < ngroups; i++) { in xdr_authunix_parms() 118 if (ngroups + 1 > ngroups_max + 1) in xdr_authunix_parms() 121 cred->cr_ngroups = ngroups + 1; in xdr_authunix_parms()
|
/freebsd/contrib/netbsd-tests/usr.bin/id/ |
H A D | pwgr.c | 105 getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroups) in getgrouplist() argument 110 if (*ngroups >= 1) { in getgrouplist() 115 ret = (*ngroups >= cnt) ? 0 : -1; in getgrouplist() 116 *ngroups = cnt; in getgrouplist() 118 if (*ngroups >= 1) { in getgrouplist() 123 if (*ngroups >= 2) { in getgrouplist() 128 ret = (*ngroups >= cnt) ? 0 : -1; in getgrouplist() 129 *ngroups = cnt; in getgrouplist()
|
/freebsd/contrib/atf/atf-c/detail/ |
H A D | user.c | 49 static int ngroups = -1; in atf_user_is_member_of_group() local 53 if (ngroups == -1) { in atf_user_is_member_of_group() 54 ngroups = getgroups(NGROUPS_MAX, groups); in atf_user_is_member_of_group() 55 INV(ngroups >= 0); in atf_user_is_member_of_group() 59 for (i = 0; !found && i < ngroups; i++) in atf_user_is_member_of_group()
|
/freebsd/contrib/kyua/utils/text/ |
H A D | regex.cpp | 109 const std::size_t ngroups) : in impl() 111 _nmatches(ngroups + 1), in impl() 219 impl(const std::string& regex_, const std::size_t ngroups, in impl() 221 _ngroups(ngroups) in impl() 264 text::regex::compile(const std::string& regex_, const std::size_t ngroups, in compile() argument 267 return regex(std::shared_ptr< impl >(new impl(regex_, ngroups, in compile() 299 const std::size_t ngroups, const bool ignore_case) in match_regex() argument 301 return regex::compile(regex_, ngroups, ignore_case).match(str); in match_regex()
|
/freebsd/lib/libc/gen/ |
H A D | initgroups.c | 45 int ngroups, ret; in initgroups() local 57 ngroups = (int)ngroups_max; in initgroups() 58 getgrouplist(uname, agroup, groups, &ngroups); in initgroups() 59 ret = setgroups(ngroups, groups); in initgroups()
|
/freebsd/usr.bin/id/ |
H A D | id.c | 262 int cnt, ngroups; in id_print() local 281 ngroups = ngroups_max; in id_print() 282 getgrouplist(pw->pw_name, gid, groups, &ngroups); in id_print() 285 ngroups = getgroups(ngroups_max, groups); in id_print() 306 for (lastgid = -1, cnt = 0; cnt < ngroups; ++cnt) { in id_print() 371 int cnt, id, lastid, ngroups; in group() local 381 ngroups = ngroups_max; in group() 382 (void) getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); in group() 384 ngroups = getgroups(ngroups_max, groups); in group() 387 for (lastid = -1, cnt = 0; cnt < ngroups; ++cnt) { in group()
|
/freebsd/usr.bin/procstat/ |
H A D | procstat_cred.c | 48 unsigned int i, ngroups; in procstat_cred() local 76 groups = procstat_getgroups(procstat, kipp, &ngroups); in procstat_cred() 78 ngroups = kipp->ki_ngroups; in procstat_cred() 82 for (i = 0; i < ngroups; i++) in procstat_cred()
|
/freebsd/usr.sbin/chown/ |
H A D | chown.c | 250 static int ngroups = -1; in chownerr() local 262 if (gid != (gid_t)-1 && ngroups == -1 && in chownerr() 267 ngroups = getgroups(ngroups_max, groups); in chownerr() 268 while (--ngroups >= 0 && gid != groups[ngroups]); in chownerr() 270 if (ngroups < 0) { in chownerr()
|
/freebsd/lib/libc/rpc/ |
H A D | netnamer.c | 146 gid_t ngroups = 0; in _getgroups() local 156 if (ngroups == NGRPS) { in _getgroups() 165 for (j = 0; j < ngroups; j++) in _getgroups() 171 groups[ngroups++] = grp->gr_gid; in _getgroups() 176 return (ngroups); in _getgroups()
|
/freebsd/usr.bin/mdo/ |
H A D | mdo.c | 78 int ngroups = ngroups_alloc; in main() local 83 getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); in main() 87 wcred.sc_supp_groups_nb = ngroups - 1; in main()
|
/freebsd/contrib/tcpdump/ |
H A D | print-igmp.c | 132 u_int group, nsrcs, ngroups; in print_igmpv3_report() local 140 ngroups = GET_BE_U_2(bp + 6); in print_igmpv3_report() 141 ND_PRINT(", %u group record(s)", ngroups); in print_igmpv3_report() 145 for (i=0; i<ngroups; i++) { in print_igmpv3_report()
|
/freebsd/contrib/jemalloc/src/ |
H A D | bitmap.c | 90 binfo->ngroups = BITMAP_BITS2GROUPS(nbits); in bitmap_info_init() 96 return binfo->ngroups; in bitmap_info_ngroups() 112 bitmap[binfo->ngroups - 1] >>= extra; in bitmap_init()
|
/freebsd/lib/libpam/modules/pam_login_access/ |
H A D | login_access.c | 181 int i, ret, ngroups = NGROUPS; in group_match() local 193 if ((grouplist = calloc(ngroups, sizeof(gid_t))) == NULL) { in group_match() 198 if (getgrouplist(username, passwd->pw_gid, grouplist, &ngroups) != 0) in group_match() 200 for (i = 0; i < ngroups; i++) in group_match()
|
/freebsd/usr.sbin/lpr/lpc/ |
H A D | lpc.c | 342 static int ngroups = 0; in ingroup() local 356 ngroups = getgroups(ngroups_max, groups); in ingroup() 357 if (ngroups < 0) in ingroup() 361 for (i = 0; i < ngroups; i++) in ingroup()
|
/freebsd/contrib/bsddialog/lib/ |
H A D | menubox.c | 90 enum menumode mode, unsigned int ngroups, in build_privatemenu() argument 101 CHECK_ARRAY(ngroups, groups); in build_privatemenu() 103 for (i = 0; i < (int)ngroups; i++) { in build_privatemenu() 114 for (i = 0; i < (int)ngroups; i++) { in build_privatemenu() 221 getfirst_with_default(int npritems, struct privateitem *pritems, int ngroups, in getfirst_with_default() argument 231 if (*focusgroup < 0 || *focusgroup >= ngroups) in getfirst_with_default() 503 unsigned int menurows, enum menumode mode, unsigned int ngroups, in do_mixedlist() argument 518 if (build_privatemenu(conf, &m, mode, ngroups, groups) != 0) in do_mixedlist() 529 m.sel = getfirst_with_default(m.nitems, m.pritems, ngroups, groups, in do_mixedlist() 697 int cols, unsigned int menurows, unsigned int ngroups, in bsddialog_mixedlist() 692 bsddialog_mixedlist(struct bsddialog_conf * conf,const char * text,int rows,int cols,unsigned int menurows,unsigned int ngroups,struct bsddialog_menugroup * groups,int * focuslist,int * focusitem) bsddialog_mixedlist() argument [all...] |
/freebsd/sys/dev/nctgpio/ |
H A D | nctgpio.c | 148 int ngroups; member 154 .ngroups = 5, 221 .ngroups = 2, 252 .ngroups = 2, 283 .ngroups = 2, 315 .ngroups = 10, 444 .ngroups = 6, 523 .ngroups = 9, 638 .ngroups = 9, 1185 for (g = 0, gp = sc->nctdevp->groups; g < sc->nctdevp->ngroups; g++, gp++) { in nct_attach() [all …]
|
/freebsd/sys/contrib/openzfs/module/os/linux/spl/ |
H A D | spl-cred.c | 38 right = group_info->ngroups; in cr_groups_search() 76 rc = gi->ngroups; in crgetngroups()
|
/freebsd/sys/security/mac/ |
H A D | mac_cred.c | 315 mac_cred_check_setgroups(struct ucred *cred, int ngroups, gid_t *gidset) in mac_cred_check_setgroups() argument 319 MAC_POLICY_CHECK_NOSLEEP(cred_check_setgroups, cred, ngroups, gidset); in mac_cred_check_setgroups() 320 MAC_CHECK_PROBE3(cred_check_setgroups, error, cred, ngroups, gidset); in mac_cred_check_setgroups()
|
/freebsd/usr.sbin/rpc.lockd/ |
H A D | kern.c | 234 int ngroups; in set_auth() local 236 ngroups = xucred->cr_ngroups - 1; in set_auth() 237 if (ngroups > NGRPS) in set_auth() 238 ngroups = NGRPS; in set_auth() 244 ngroups, in set_auth()
|
/freebsd/sys/dev/p2sb/ |
H A D | lewisburg_gpiocm.c | 73 int ngroups; member 107 for (i = 0; i < sc->community->ngroups; ++i) in lbggpiocm_get_group() 320 sc->community->ngroups = i; in lbggpiocm_attach()
|
/freebsd/contrib/openpam/lib/libpam/ |
H A D | openpam_cred.h | 47 int ngroups; member
|