Lines Matching full:as
22 * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
188 auth_approval(auth_session_t *as, login_cap_t *lc, char *name, char *type) in auth_approval() argument
195 close_on_exit = as == NULL; in auth_approval()
198 if (as != NULL && name == NULL) in auth_approval()
199 name = auth_getitem(as, AUTHV_NAME); in auth_approval()
201 if (as != NULL) in auth_approval()
202 pwd = auth_getpwd(as); in auth_approval()
274 if (as == NULL && (as = auth_open()) == NULL) { in auth_approval()
283 auth_setstate(as, AUTH_OKAY); in auth_approval()
284 if (auth_setitem(as, AUTHV_NAME, name) < 0) { in auth_approval()
289 if (auth_check_expire(as) < 0) /* is this account expired */ in auth_approval()
292 auth_getitem(as, AUTHV_INTERACTIVE) != NULL)) { in auth_approval()
293 auth_setstate(as, (auth_getstate(as) & ~AUTH_ALLOW)); in auth_approval()
303 auth_setstate(as, (auth_getstate(as) & ~AUTH_ALLOW)); in auth_approval()
308 auth_call(as, approve, strrchr(approve, '/') + 1, "--", name, in auth_approval()
317 return (auth_close(as)); in auth_approval()
318 return (auth_getstate(as) & AUTH_ALLOW); in auth_approval()
327 auth_session_t *as; in auth_usercheck() local
366 if ((as = auth_open()) == NULL) { in auth_usercheck()
370 auth_setitem(as, AUTHV_SERVICE, "response"); in auth_usercheck()
371 auth_setdata(as, "", 1); in auth_usercheck()
372 auth_setdata(as, password, strlen(password) + 1); in auth_usercheck()
375 as = NULL; in auth_usercheck()
376 as = auth_verify(as, style, name, lc->lc_class, (char *)NULL); in auth_usercheck()
378 return (as); in auth_usercheck()
385 auth_session_t *as; in auth_userokay() local
387 as = auth_usercheck(name, style, type, password); in auth_userokay()
389 return (as != NULL ? auth_close(as) : 0); in auth_userokay()
397 auth_session_t *as; in auth_userchallenge() local
432 (as = auth_open()) == NULL) { in auth_userchallenge()
436 if (auth_setitem(as, AUTHV_STYLE, style) < 0 || in auth_userchallenge()
437 auth_setitem(as, AUTHV_NAME, name) < 0 || in auth_userchallenge()
438 auth_setitem(as, AUTHV_CLASS, lc->lc_class) < 0) { in auth_userchallenge()
439 auth_close(as); in auth_userchallenge()
444 *challengep = auth_challenge(as); in auth_userchallenge()
445 return (as); in auth_userchallenge()
450 auth_userresponse(auth_session_t *as, char *response, int more) in auth_userresponse() argument
456 if (as == NULL) in auth_userresponse()
459 auth_setstate(as, 0); in auth_userresponse()
461 if ((style = auth_getitem(as, AUTHV_STYLE)) == NULL || in auth_userresponse()
462 (name = auth_getitem(as, AUTHV_NAME)) == NULL || in auth_userresponse()
465 return (auth_close(as)); in auth_userresponse()
472 return (auth_close(as)); in auth_userresponse()
476 challenge = auth_getitem(as, AUTHV_CHALLENGE); in auth_userresponse()
477 class = auth_getitem(as, AUTHV_CLASS); in auth_userresponse()
480 auth_setdata(as, challenge, strlen(challenge) + 1); in auth_userresponse()
482 auth_setdata(as, "", 1); in auth_userresponse()
484 auth_setdata(as, response, strlen(response) + 1); in auth_userresponse()
487 auth_setdata(as, "", 1); in auth_userresponse()
489 auth_call(as, path, style, "-s", "response", "--", name, in auth_userresponse()
495 if (auth_getstate(as) & AUTH_ALLOW) in auth_userresponse()
496 auth_check_expire(as); in auth_userresponse()
498 return (auth_close(as)); in auth_userresponse()
499 return (auth_getstate(as) & AUTH_ALLOW); in auth_userresponse()
505 * If ``as'' is NULL a new session is formed with the default service.
506 * Returns NULL only if ``as'' is NULL and we were unable to allocate
513 auth_verify(auth_session_t *as, char *style, char *name, ...) in auth_verify() argument
518 if ((name == NULL || style == NULL) && as == NULL) in auth_verify()
521 if (as == NULL && (as = auth_open()) == NULL) in auth_verify()
523 auth_setstate(as, 0); in auth_verify()
525 if (style != NULL && auth_setitem(as, AUTHV_STYLE, style) < 0) in auth_verify()
526 return (as); in auth_verify()
528 if (name != NULL && auth_setitem(as, AUTHV_NAME, name) < 0) in auth_verify()
529 return (as); in auth_verify()
531 style = auth_getitem(as, AUTHV_STYLE); in auth_verify()
532 name = auth_getitem(as, AUTHV_NAME); in auth_verify()
534 return (as); in auth_verify()
538 auth_set_va_list(as, ap); in auth_verify()
539 auth_call(as, path, auth_getitem(as, AUTHV_STYLE), "-s", in auth_verify()
540 auth_getitem(as, AUTHV_SERVICE), "--", name, (char *)NULL); in auth_verify()
542 return (as); in auth_verify()