Lines Matching defs:cc
31 static int kcm_cc_destructor(struct kcm_ccache *cc)
33 if (cc == NULL) {
37 krb5_free_principal(NULL, cc->client);
48 struct kcm_ccache *cc = NULL;
52 cc = talloc_zero(mem_ctx, struct kcm_ccache);
53 if (cc == NULL) {
63 cc->name = talloc_strdup(cc, name);
64 if (cc->name == NULL) {
69 uuid_generate(cc->uuid);
71 kret = krb5_copy_principal(k5c, princ, &cc->client);
81 cc->owner.uid = cli_creds_get_uid(owner);
82 cc->owner.gid = cli_creds_get_gid(owner);
83 cc->kdc_offset = INT32_MAX;
85 talloc_set_destructor(cc, kcm_cc_destructor);
86 *_cc = cc;
90 talloc_free(cc);
95 const char *kcm_cc_get_name(struct kcm_ccache *cc)
97 return cc ? cc->name : NULL;
100 errno_t kcm_cc_get_uuid(struct kcm_ccache *cc, uuid_t _uuid)
102 if (cc == NULL) {
105 uuid_copy(_uuid, cc->uuid);
109 krb5_principal kcm_cc_get_client_principal(struct kcm_ccache *cc)
111 return cc ? cc->client : NULL;
114 bool kcm_cc_access(struct kcm_ccache *cc,
121 if (cc == NULL) {
130 ok = ((cc->owner.uid == uid) && (cc->owner.gid == gid));
136 cc->name);
141 int32_t kcm_cc_get_offset(struct kcm_ccache *cc)
143 return cc ? cc->kdc_offset : INT32_MAX;
146 errno_t kcm_cc_store_cred_blob(struct kcm_ccache *cc,
153 if (cc == NULL || cred_blob == NULL) {
158 kcreds = kcm_cred_new(cc, uuid, cred_blob);
163 ret = kcm_cc_store_creds(cc, kcreds);
171 struct kcm_cred *kcm_cc_get_cred(struct kcm_ccache *cc)
173 if (cc == NULL) {
177 return cc->creds;
206 errno_t kcm_cc_store_creds(struct kcm_ccache *cc,
209 DLIST_ADD(cc->creds, crd);
210 talloc_steal(cc, crd);
597 struct kcm_ccache *cc;
599 ret = state->db->ops->getbyuuid_recv(subreq, state, &cc);
609 if (cc == NULL) {
615 ok = kcm_cc_access(cc, state->client);
664 struct kcm_ccache *cc;
715 ret = state->db->ops->getbyname_recv(subreq, state, &state->cc);
725 if (state->cc == NULL) {
731 ok = kcm_cc_access(state->cc, state->client);
747 *_cc = talloc_steal(mem_ctx, state->cc);
755 struct kcm_ccache *cc;
806 ret = state->db->ops->getbyuuid_recv(subreq, state, &state->cc);
816 if (state->cc == NULL) {
822 ok = kcm_cc_access(state->cc, state->client);
838 *_cc = talloc_steal(mem_ctx, state->cc);
1012 struct kcm_ccache *cc)
1026 if (ev == NULL || db == NULL || client == NULL || cc == NULL) {
1031 ok = kcm_cc_access(cc, client);
1041 cc);
1091 void kcm_mod_cc(struct kcm_ccache *cc, struct kcm_mod_ctx *mod_ctx)
1093 if (cc == NULL || mod_ctx == NULL) {
1098 cc->kdc_offset = mod_ctx->kdc_offset;