Lines Matching refs:au

130 	struct audata *au, *tau;  in authunix_create()  local
156 TAILQ_FOREACH(au, &auth_unix_cache[h], au_link) { in authunix_create()
157 if (!memcmp(&xcr, &au->au_xcred, sizeof(xcr))) { in authunix_create()
158 refcount_acquire(&au->au_refs); in authunix_create()
163 TAILQ_REMOVE(&auth_unix_all, au, au_alllink); in authunix_create()
164 TAILQ_INSERT_TAIL(&auth_unix_all, au, in authunix_create()
170 return (au->au_auth); in authunix_create()
179 au = NULL; in authunix_create()
181 au = mem_alloc(sizeof(*au)); in authunix_create()
183 auth->ah_private = (caddr_t)au; in authunix_create()
184 auth->ah_verf = au->au_shcred = _null_auth; in authunix_create()
185 refcount_init(&au->au_refs, 1); in authunix_create()
186 au->au_xcred = xcr; in authunix_create()
187 au->au_shfaults = 0; in authunix_create()
188 au->au_origcred.oa_base = NULL; in authunix_create()
189 au->au_auth = auth; in authunix_create()
201 au->au_origcred.oa_length = len = XDR_GETPOS(&xdrs); in authunix_create()
202 au->au_origcred.oa_flavor = AUTH_UNIX; in authunix_create()
203 au->au_origcred.oa_base = mem_alloc((u_int) len); in authunix_create()
204 memcpy(au->au_origcred.oa_base, mymem, (size_t)len); in authunix_create()
209 auth->ah_cred = au->au_origcred; in authunix_create()
226 TAILQ_INSERT_TAIL(&auth_unix_cache[h], au, au_link); in authunix_create()
227 TAILQ_INSERT_TAIL(&auth_unix_all, au, au_alllink); in authunix_create()
228 refcount_acquire(&au->au_refs); /* one for the cache, one for user */ in authunix_create()
248 struct audata *au; in authunix_marshal() local
250 au = AUTH_PRIVATE(auth); in authunix_marshal()
251 if (!XDR_PUTBYTES(xdrs, au->au_marshed, au->au_mpos)) in authunix_marshal()
261 struct audata *au; in authunix_validate() local
268 au = AUTH_PRIVATE(auth); in authunix_validate()
272 if (au->au_shcred.oa_base != NULL) { in authunix_validate()
273 mem_free(au->au_shcred.oa_base, in authunix_validate()
274 au->au_shcred.oa_length); in authunix_validate()
275 au->au_shcred.oa_base = NULL; in authunix_validate()
277 if (xdr_opaque_auth(&txdrs, &au->au_shcred)) { in authunix_validate()
278 auth->ah_cred = au->au_shcred; in authunix_validate()
281 (void)xdr_opaque_auth(&txdrs, &au->au_shcred); in authunix_validate()
282 au->au_shcred.oa_base = NULL; in authunix_validate()
283 auth->ah_cred = au->au_origcred; in authunix_validate()
294 struct audata *au = AUTH_PRIVATE(auth); in authunix_refresh() local
301 if (auth->ah_cred.oa_base == au->au_origcred.oa_base) { in authunix_refresh()
305 au->au_shfaults ++; in authunix_refresh()
308 xdrmem_create(&xdrs, au->au_origcred.oa_base, in authunix_refresh()
309 au->au_origcred.oa_length, XDR_DECODE); in authunix_refresh()
323 auth->ah_cred = au->au_origcred; in authunix_refresh()
333 struct audata *au; in authunix_destroy() local
335 au = AUTH_PRIVATE(auth); in authunix_destroy()
337 if (!refcount_release(&au->au_refs)) in authunix_destroy()
340 mem_free(au->au_origcred.oa_base, au->au_origcred.oa_length); in authunix_destroy()
342 if (au->au_shcred.oa_base != NULL) in authunix_destroy()
343 mem_free(au->au_shcred.oa_base, au->au_shcred.oa_length); in authunix_destroy()
362 struct audata *au; in marshal_new_auth() local
364 au = AUTH_PRIVATE(auth); in marshal_new_auth()
365 xdrmem_create(xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE); in marshal_new_auth()
370 au->au_mpos = XDR_GETPOS(xdrs); in marshal_new_auth()