* Copy groups in to a credential after expanding it if required. * Truncate the list to (ngroups_max + 1) if it is too large. */
| 2315 | * Truncate the list to (ngroups_max + 1) if it is too large. |
| 2316 | */ |
| 2317 | void |
| 2318 | crsetgroups(struct ucred *cr, int ngrp, gid_t *groups) |
| 2319 | { |
| 2320 | |
| 2321 | if (ngrp > ngroups_max + 1) |
| 2322 | ngrp = ngroups_max + 1; |
| 2323 | |
| 2324 | crextend(cr, ngrp); |
| 2325 | crsetgroups_locked(cr, ngrp, groups); |
| 2326 | } |
| 2327 | |
| 2328 | /* |
| 2329 | * Get login name, if available. |
no test coverage detected