Home | History | Annotate | Download | only in rpc

Lines Matching defs:auth

70 #include <rpc/auth.h>
82 static void authunix_nextverf(AUTH *);
83 static bool_t authunix_marshal(AUTH *, XDR *);
84 static bool_t authunix_validate(AUTH *, struct opaque_auth *);
85 static bool_t authunix_refresh(AUTH *);
86 static void authunix_destroy(AUTH *);
87 static void marshal_new_auth(AUTH *);
100 #define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private)
104 * Returns an auth handle with the given stuff in it.
106 AUTH *
113 AUTH *auth;
117 * Allocate and set up auth handle
120 auth = mem_alloc(sizeof(*auth));
122 if (auth == NULL) {
134 auth->ah_ops = authunix_ops();
135 auth->ah_private = au;
136 auth->ah_verf = au->au_shcred = _null_auth;
170 * set auth handle to reflect new cred.
172 auth->ah_cred = au->au_origcred;
173 marshal_new_auth(auth);
174 return (auth);
177 if (auth)
178 mem_free(auth, sizeof(*auth));
203 * Returns an auth handle with parameters determined by doing lots of
206 AUTH *
235 authunix_nextverf(AUTH *auth)
241 authunix_marshal(AUTH *auth, XDR *xdrs)
245 _DIAGASSERT(auth != NULL);
248 au = AUTH_PRIVATE(auth);
253 authunix_validate(AUTH *auth, struct opaque_auth *verf)
258 _DIAGASSERT(auth != NULL);
262 au = AUTH_PRIVATE(auth);
272 auth->ah_cred = au->au_shcred;
277 auth->ah_cred = au->au_origcred;
279 marshal_new_auth(auth);
285 authunix_refresh(AUTH *auth)
287 struct audata *au = AUTH_PRIVATE(auth);
293 _DIAGASSERT(auth != NULL);
295 if (auth->ah_cred.oa_base == au->au_origcred.oa_base) {
318 auth->ah_cred = au->au_origcred;
319 marshal_new_auth(auth);
329 authunix_destroy(AUTH *auth)
333 _DIAGASSERT(auth != NULL);
335 au = AUTH_PRIVATE(auth);
341 mem_free(auth->ah_private, sizeof(struct audata));
343 if (auth->ah_verf.oa_base != NULL)
344 mem_free(auth->ah_verf.oa_base, auth->ah_verf.oa_length);
346 mem_free(auth, sizeof(*auth));
350 * Marshals (pre-serializes) an auth struct.
354 marshal_new_auth(AUTH *auth)
360 _DIAGASSERT(auth != NULL);
362 au = AUTH_PRIVATE(auth);
364 if ((! xdr_opaque_auth(xdrs, &(auth->ah_cred))) ||
365 (! xdr_opaque_auth(xdrs, &(auth->ah_verf))))