Lines Matching defs:pcp

1319 pc_free(permcheck_t *pcp)
1324 for (i = 0; i < pcp->pc_bnum; ++i) {
1325 for (ep = pcp->pc_buckets[i]; ep != NULL; ep = next) {
1331 free(pcp->pc_buckets);
1332 free(pcp);
1357 pc_exists(permcheck_t *pcp, const char *auth)
1363 for (ep = pcp->pc_buckets[h & (pcp->pc_bnum - 1)];
1367 pcp->pc_auth_string = ep->pce_auth;
1376 pc_match(permcheck_t *pcp, const char *pattern)
1381 for (i = 0; i < pcp->pc_bnum; ++i) {
1382 for (ep = pcp->pc_buckets[i]; ep != NULL; ep = ep->pce_next) {
1384 pcp->pc_auth_string = ep->pce_auth;
1394 pc_grow(permcheck_t *pcp)
1400 new_bnum = pcp->pc_bnum * 2;
1401 if (new_bnum < pcp->pc_bnum)
1409 for (i = 0; i < pcp->pc_bnum; ++i) {
1410 for (ep = pcp->pc_buckets[i]; ep != NULL; ep = next) {
1418 uu_free(pcp->pc_buckets);
1419 pcp->pc_buckets = new_buckets;
1420 pcp->pc_bnum = new_bnum;
1426 pc_add(permcheck_t *pcp, const char *auth, pc_auth_type_t auth_type)
1436 if (pcp->pc_enum * 4 > 3 * pcp->pc_bnum)
1438 (void) pc_grow(pcp);
1442 i = pc_hash(auth) & (pcp->pc_bnum - 1);
1443 ep->pce_next = pcp->pc_buckets[i];
1444 pcp->pc_buckets[i] = ep;
1446 if (auth_type > pcp->pc_specific_type) {
1447 pcp->pc_specific_type = auth_type;
1448 pcp->pc_specific = ep;
1451 ++pcp->pc_enum;
1480 perm_add_enabling_type(permcheck_t *pcp, const char *auth,
1483 return (pc_add(pcp, auth, auth_type) == 0 ? REP_PROTOCOL_SUCCESS :
1492 perm_add_enabling(permcheck_t *pcp, const char *auth)
1494 return (perm_add_enabling_type(pcp, auth, PC_AUTH_SMF));
1501 * the enabling authorizations in pcp, PERM_DENIED if it doesn't, PERM_GONE if
1511 permcheck_t *pcp = ctxt;
1515 *pret = pc_exists(pcp, auth);
1517 *pret = pc_match(pcp, auth);
1525 assert(pcp->pc_specific != NULL);
1526 pcp->pc_auth_string = pcp->pc_specific->pce_auth;
1532 perm_granted(permcheck_t *pcp)
1573 if (_enum_auths(pw.pw_name, auth_cb, pcp, &ret) < 0)
1580 map_granted_status(perm_status_t status, permcheck_t *pcp,
1588 *match_auth = strdup(pcp->pc_auth_string);
1595 *match_auth = strdup(pcp->pc_auth_string);
2542 * values as authorizations to pcp. pg must not be locked on entry, and it is
2550 perm_add_pg_prop_values(permcheck_t *pcp, rc_node_t *pg, const char *propname)
2591 result = perm_add_enabling_type(pcp, cp,
2608 * its values as authorizations to pcp. If pgtype is NULL, it is not checked.
2616 perm_add_ent_prop_values(permcheck_t *pcp, rc_node_t *ent, const char *pgname,
2645 r = perm_add_pg_prop_values(pcp, pg, propname);
2668 * authorizations to pcp. If pg has no such property, and its parent is an
2676 perm_add_enabling_values(permcheck_t *pcp, rc_node_t *pg, const char *propname)
2683 r = perm_add_pg_prop_values(pcp, pg, propname);
2709 r = perm_add_ent_prop_values(pcp, svc, pgname, NULL, propname);
2727 perm_add_inst_action_auth(permcheck_t *pcp, rc_node_t *inst)
2734 r = perm_add_ent_prop_values(pcp, inst, AUTH_PG_GENERAL,
2746 r = perm_add_ent_prop_values(pcp, svc, AUTH_PG_GENERAL,
3346 permcheck_t *pcp;
3359 pcp = pc_create();
3360 if (pcp != NULL) {
3361 rc = perm_add_enabling(pcp, AUTH_MODIFY);
3364 granted = perm_granted(pcp);
3370 * string before freeing pcp.
3373 strdup(pcp->pc_auth_string);
3381 pc_free(pcp);
4002 permcheck_t *pcp;
4055 pcp = pc_create();
4056 if (pcp != NULL) {
4057 rc = perm_add_enabling(pcp, AUTH_MODIFY);
4064 rc = perm_add_enabling(pcp, auth);
4078 rc = perm_add_enabling(pcp, AUTH_MANAGE);
4081 rc = perm_add_inst_action_auth(pcp, np);
4085 granted = perm_granted(pcp);
4087 rc = map_granted_status(granted, pcp,
4091 pc_free(pcp);
4097 pc_free(pcp);
4704 permcheck_t *pcp;
4878 pcp = pc_create();
4879 if (pcp != NULL) {
4880 rc = perm_add_enabling(pcp, AUTH_MODIFY);
4889 rc = perm_add_enabling(pcp, auth);
4893 granted = perm_granted(pcp);
4895 rc = map_granted_status(granted, pcp,
4899 pc_free(pcp);
4908 pc_free(pcp);
5793 permcheck_t *pcp;
5823 pcp = pc_create();
5825 if (pcp == NULL) {
5830 ret = perm_add_enabling(pcp, AUTH_MODIFY);
5837 ret = perm_add_enabling(pcp, auth);
5849 ret = perm_add_enabling_values(pcp, pgp,
5854 ret = perm_add_enabling_values(pcp, pgp,
5858 ret = perm_add_enabling_values(pcp, pgp,
5864 granted = perm_granted(pcp);
5892 audit_data.ed_auth = pcp->pc_auth_string;
5898 pc_free(pcp);
6651 permcheck_t *pcp;
6685 pcp = pc_create();
6686 if (pcp == NULL) {
6699 ret = perm_add_enabling(pcp, AUTH_MODIFY);
6701 pc_free(pcp);
6707 ret = perm_add_enabling(pcp, AUTH_MANAGE);
6710 pc_free(pcp);
6720 pc_free(pcp);
6726 ret = perm_add_inst_action_auth(pcp, instn);
6735 pc_free(pcp);
6745 ret = perm_add_enabling(pcp, AUTH_MODIFY);
6754 ret = perm_add_enabling(pcp, auth);
6760 perm_add_enabling_values(pcp, np, AUTH_PROP_VALUE);
6764 perm_add_enabling_values(pcp, np, AUTH_PROP_MODIFY);
6770 ret = perm_add_enabling(pcp, AUTH_MANAGE);
6773 pc_free(pcp);
6779 granted = perm_granted(pcp);
6780 ret = map_granted_status(granted, pcp, &auth_string);
6781 pc_free(pcp);
6980 permcheck_t *pcp;
7008 pcp = pc_create();
7009 if (pcp == NULL)
7021 pc_free(pcp);
7030 rc = perm_add_enabling(pcp, AUTH_MODIFY);
7033 rc = perm_add_enabling(pcp,
7047 pc_free(pcp);
7055 pc_free(pcp);
7062 rc = perm_add_inst_action_auth(pcp, instn);
7070 pc_free(pcp);
7083 rc = perm_add_enabling(pcp, AUTH_MODIFY);
7091 rc = perm_add_enabling(pcp, auth);
7096 rc = perm_add_enabling_values(pcp, np,
7105 rc = perm_add_enabling_values(pcp, np,
7111 granted = perm_granted(pcp);
7112 rc = map_granted_status(granted, pcp, &auth_string);
7123 pc_free(pcp);