Lines Matching +full:0 +full:m
69 krb5_mcache *m, *m_c; in mcc_alloc() local
70 int ret = 0; in mcc_alloc()
72 ALLOC(m, 1); in mcc_alloc()
73 if(m == NULL) in mcc_alloc()
76 ret = asprintf(&m->name, "%p", m); in mcc_alloc()
78 m->name = strdup(name); in mcc_alloc()
79 if(ret < 0 || m->name == NULL) { in mcc_alloc()
80 free(m); in mcc_alloc()
86 if (strcmp(m->name, m_c->name) == 0) in mcc_alloc()
89 free(m->name); in mcc_alloc()
90 free(m); in mcc_alloc()
95 m->dead = 0; in mcc_alloc()
96 m->refcnt = 1; in mcc_alloc()
97 m->primary_principal = NULL; in mcc_alloc()
98 m->creds = NULL; in mcc_alloc()
99 m->mtime = time(NULL); in mcc_alloc()
100 m->kdc_offset = 0; in mcc_alloc()
101 m->next = mcc_head; in mcc_alloc()
102 mcc_head = m; in mcc_alloc()
104 return m; in mcc_alloc()
110 krb5_mcache *m; in mcc_resolve() local
113 for (m = mcc_head; m != NULL; m = m->next) in mcc_resolve()
114 if (strcmp(m->name, res) == 0) in mcc_resolve()
118 if (m != NULL) { in mcc_resolve()
119 m->refcnt++; in mcc_resolve()
120 (*id)->data.data = m; in mcc_resolve()
121 (*id)->data.length = sizeof(*m); in mcc_resolve()
122 return 0; in mcc_resolve()
125 m = mcc_alloc(res); in mcc_resolve()
126 if (m == NULL) { in mcc_resolve()
132 (*id)->data.data = m; in mcc_resolve()
133 (*id)->data.length = sizeof(*m); in mcc_resolve()
135 return 0; in mcc_resolve()
142 krb5_mcache *m; in mcc_gen_new() local
144 m = mcc_alloc(NULL); in mcc_gen_new()
146 if (m == NULL) { in mcc_gen_new()
152 (*id)->data.data = m; in mcc_gen_new()
153 (*id)->data.length = sizeof(*m); in mcc_gen_new()
155 return 0; in mcc_gen_new()
163 krb5_mcache *m = MCACHE(id); in mcc_initialize() local
164 m->dead = 0; in mcc_initialize()
165 m->mtime = time(NULL); in mcc_initialize()
168 &m->primary_principal); in mcc_initialize()
172 mcc_close_internal(krb5_mcache *m) in mcc_close_internal() argument
174 if (--m->refcnt != 0) in mcc_close_internal()
175 return 0; in mcc_close_internal()
177 if (MISDEAD(m)) { in mcc_close_internal()
178 free (m->name); in mcc_close_internal()
181 return 0; in mcc_close_internal()
190 return 0; in mcc_close()
197 krb5_mcache **n, *m = MCACHE(id); in mcc_destroy() local
200 if (m->refcnt == 0) in mcc_destroy()
201 krb5_abortx(context, "mcc_destroy: refcnt already 0"); in mcc_destroy()
203 if (!MISDEAD(m)) { in mcc_destroy()
208 if(m == *n) { in mcc_destroy()
209 *n = m->next; in mcc_destroy()
214 if (m->primary_principal != NULL) { in mcc_destroy()
215 krb5_free_principal (context, m->primary_principal); in mcc_destroy()
216 m->primary_principal = NULL; in mcc_destroy()
218 m->dead = 1; in mcc_destroy()
220 l = m->creds; in mcc_destroy()
229 m->creds = NULL; in mcc_destroy()
231 return 0; in mcc_destroy()
239 krb5_mcache *m = MCACHE(id); in mcc_store_cred() local
243 if (MISDEAD(m)) in mcc_store_cred()
252 l->next = m->creds; in mcc_store_cred()
253 m->creds = l; in mcc_store_cred()
254 memset (&l->cred, 0, sizeof(l->cred)); in mcc_store_cred()
257 m->creds = l->next; in mcc_store_cred()
261 m->mtime = time(NULL); in mcc_store_cred()
262 return 0; in mcc_store_cred()
270 krb5_mcache *m = MCACHE(id); in mcc_get_principal() local
272 if (MISDEAD(m) || m->primary_principal == NULL) in mcc_get_principal()
275 m->primary_principal, in mcc_get_principal()
284 krb5_mcache *m = MCACHE(id); in mcc_get_first() local
286 if (MISDEAD(m)) in mcc_get_first()
289 *cursor = m->creds; in mcc_get_first()
290 return 0; in mcc_get_first()
299 krb5_mcache *m = MCACHE(id); in mcc_get_next() local
302 if (MISDEAD(m)) in mcc_get_next()
320 return 0; in mcc_end_get()
329 krb5_mcache *m = MCACHE(id); in mcc_remove_cred() local
331 for(q = &m->creds, p = *q; p; p = *q) { in mcc_remove_cred()
336 m->mtime = time(NULL); in mcc_remove_cred()
340 return 0; in mcc_remove_cred()
348 return 0; /* XXX */ in mcc_set_flags()
374 return 0; in mcc_get_cache_first()
382 krb5_mcache *m; in mcc_get_cache_next() local
388 m = iter->cache; in mcc_get_cache_next()
389 if (m->next) in mcc_get_cache_next()
390 m->next->refcnt++; in mcc_get_cache_next()
391 iter->cache = m->next; in mcc_get_cache_next()
398 (*id)->data.data = m; in mcc_get_cache_next()
399 (*id)->data.length = sizeof(*m); in mcc_get_cache_next()
401 return 0; in mcc_get_cache_next()
413 return 0; in mcc_end_cache_get()
448 return 0; in mcc_move()
460 return 0; in mcc_default_name()
467 return 0; in mcc_lastchange()
473 krb5_mcache *m = MCACHE(id); in mcc_set_kdc_offset() local
474 m->kdc_offset = kdc_offset; in mcc_set_kdc_offset()
475 return 0; in mcc_set_kdc_offset()
481 krb5_mcache *m = MCACHE(id); in mcc_get_kdc_offset() local
482 *kdc_offset = m->kdc_offset; in mcc_get_kdc_offset()
483 return 0; in mcc_get_kdc_offset()