Lines Matching full:auth

58 #include <rpc/auth.h>
64 static void authunix_nextverf (AUTH *);
65 static bool_t authunix_marshal (AUTH *, XDR *);
66 static bool_t authunix_validate (AUTH *, struct opaque_auth *);
67 static bool_t authunix_refresh (AUTH *, void *);
68 static void authunix_destroy (AUTH *);
69 static void marshal_new_auth (AUTH *);
82 #define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private) argument
86 * Returns an auth handle with the given stuff in it.
88 AUTH *
95 AUTH *auth; in authunix_create() local
99 * Allocate and set up auth handle in authunix_create()
102 auth = mem_alloc(sizeof(*auth)); in authunix_create()
104 if (auth == NULL) { in authunix_create()
116 auth->ah_ops = authunix_ops(); in authunix_create()
117 auth->ah_private = (caddr_t)au; in authunix_create()
118 auth->ah_verf = au->au_shcred = _null_auth; in authunix_create()
152 * set auth handle to reflect new cred. in authunix_create()
154 auth->ah_cred = au->au_origcred; in authunix_create()
155 marshal_new_auth(auth); in authunix_create()
156 return (auth); in authunix_create()
159 if (auth) in authunix_create()
160 mem_free(auth, sizeof(*auth)); in authunix_create()
171 * Returns an auth handle with parameters determined by doing lots of
174 AUTH *
177 AUTH *auth; in authunix_create_default() local
200 auth = authunix_create(machname, uid, gid, ngids, gids); in authunix_create_default()
202 return (auth); in authunix_create_default()
211 authunix_nextverf(AUTH *auth) in authunix_nextverf() argument
217 authunix_marshal(AUTH *auth, XDR *xdrs) in authunix_marshal() argument
221 assert(auth != NULL); in authunix_marshal()
224 au = AUTH_PRIVATE(auth); in authunix_marshal()
229 authunix_validate(AUTH *auth, struct opaque_auth *verf) in authunix_validate() argument
234 assert(auth != NULL); in authunix_validate()
238 au = AUTH_PRIVATE(auth); in authunix_validate()
248 auth->ah_cred = au->au_shcred; in authunix_validate()
253 auth->ah_cred = au->au_origcred; in authunix_validate()
255 marshal_new_auth(auth); in authunix_validate()
261 authunix_refresh(AUTH *auth, void *dummy) in authunix_refresh() argument
263 struct audata *au = AUTH_PRIVATE(auth); in authunix_refresh()
269 assert(auth != NULL); in authunix_refresh()
271 if (auth->ah_cred.oa_base == au->au_origcred.oa_base) { in authunix_refresh()
294 auth->ah_cred = au->au_origcred; in authunix_refresh()
295 marshal_new_auth(auth); in authunix_refresh()
305 authunix_destroy(AUTH *auth) in authunix_destroy() argument
309 assert(auth != NULL); in authunix_destroy()
311 au = AUTH_PRIVATE(auth); in authunix_destroy()
317 mem_free(auth->ah_private, sizeof(struct audata)); in authunix_destroy()
319 if (auth->ah_verf.oa_base != NULL) in authunix_destroy()
320 mem_free(auth->ah_verf.oa_base, auth->ah_verf.oa_length); in authunix_destroy()
322 mem_free(auth, sizeof(*auth)); in authunix_destroy()
326 * Marshals (pre-serializes) an auth struct.
330 marshal_new_auth(AUTH *auth) in marshal_new_auth() argument
336 assert(auth != NULL); in marshal_new_auth()
338 au = AUTH_PRIVATE(auth); in marshal_new_auth()
340 if ((! xdr_opaque_auth(xdrs, &(auth->ah_cred))) || in marshal_new_auth()
341 (! xdr_opaque_auth(xdrs, &(auth->ah_verf)))) in marshal_new_auth()