Lines Matching defs:ci
2268 get_uid(const char *str, struct method_context *ci, uid_t *uidp)
2294 if (ci->pwbuf == NULL) {
2295 ci->pwbufsz = sysconf(_SC_GETPW_R_SIZE_MAX);
2296 ci->pwbuf = malloc(ci->pwbufsz);
2297 if (ci->pwbuf == NULL)
2304 getpwnam_r(str, &ci->pwd, ci->pwbuf, ci->pwbufsz);
2308 *uidp = ci->pwd.pw_uid;
2311 free(ci->pwbuf);
2312 ci->pwbuf = NULL;
2482 * Parse the supp_groups property value and populate ci->groups. Returns
2487 get_groups(char *str, struct method_context *ci)
2496 ci->ngroups = 0;
2516 if ((ci->groups[i] = get_gid(cp)) == (gid_t)-1) {
2517 ci->ngroups = 0;
2523 ci->ngroups = 0;
2530 ci->ngroups = i;
2547 struct method_context *ci, mc_error_t *merr)
2549 char *buf = ci->vbuf;
2550 ssize_t buf_sz = ci->vbuf_sz;
2587 /* Get the euid first so we don't override ci->pwd for the uid. */
2589 if ((r = get_uid(value, ci, &ci->euid)) != 0) {
2590 ci->euid = (uid_t)-1;
2600 if ((r = get_uid(value, ci, &ci->uid)) != 0) {
2601 ci->euid = ci->uid = (uid_t)-1;
2608 ci->euid = ci->uid;
2612 ci->egid = ci->gid = get_gid(value);
2613 if (ci->gid == (gid_t)-1) {
2622 ci->egid = get_gid(value);
2623 if (ci->egid == (gid_t)-1) {
2632 ci->lpriv_set = priv_str_to_set(value, ",", NULL);
2633 if (ci->lpriv_set == NULL) {
2648 ci->priv_set = NULL;
2649 ci->xpctxt = NULL;
2650 if (xpol_parse_ruleset(value, &ci->xpctxt, &ci->priv_set) < 0) {
2665 if (ci->priv_set != NULL) {
2677 priv_union(iset, ci->priv_set);
2699 scf_property_t *prop, scf_value_t *val, struct method_context *ci,
2702 char *vbuf = ci->vbuf;
2703 ssize_t vbuf_sz = ci->vbuf_sz;
2722 if ((r = get_uid(vbuf, ci, &ci->uid)) != 0) {
2723 ci->uid = (uid_t)-1;
2742 ci->gid = get_gid(vbuf);
2743 if (ci->gid == (gid_t)-1) {
2749 switch (r = lookup_pwd(ci)) {
2751 ci->gid = ci->pwd.pw_gid;
2755 ci->gid = (gid_t)-1;
2757 "No passwd entry for uid \"%d\".", ci->uid));
2787 switch (r = get_groups(vbuf, ci)) {
2806 ci->ngroups = -1;
2826 ci->priv_set = NULL;
2827 ci->xpctxt = NULL;
2828 if (xpol_parse_ruleset(vbuf, &ci->xpctxt, &ci->priv_set) < 0) {
2861 ci->lpriv_set = priv_str_to_set(vbuf, ",", NULL);
2862 if (ci->lpriv_set == NULL) {