* Fill in a struct xucred based on a struct ucred. */
| 2133 | * Fill in a struct xucred based on a struct ucred. |
| 2134 | */ |
| 2135 | void |
| 2136 | cru2x(struct ucred *cr, struct xucred *xcr) |
| 2137 | { |
| 2138 | int ngroups; |
| 2139 | |
| 2140 | bzero(xcr, sizeof(*xcr)); |
| 2141 | xcr->cr_version = XUCRED_VERSION; |
| 2142 | xcr->cr_uid = cr->cr_uid; |
| 2143 | |
| 2144 | ngroups = MIN(cr->cr_ngroups, XU_NGROUPS); |
| 2145 | xcr->cr_ngroups = ngroups; |
| 2146 | bcopy(cr->cr_groups, xcr->cr_groups, |
| 2147 | ngroups * sizeof(*cr->cr_groups)); |
| 2148 | } |
| 2149 | |
| 2150 | void |
| 2151 | cru2xt(struct thread *td, struct xucred *xcr) |
no test coverage detected