Lines Matching refs:pamh
149 static int try_pam_auth(struct auth_request *request, pam_handle_t *pamh,
158 if ((status = pam_authenticate(pamh, 0)) != PAM_SUCCESS) {
166 pam_strerror(pamh, status), NULL);
194 if ((status = pam_setcred(pamh, PAM_ESTABLISH_CRED)) !=
198 pam_strerror(pamh, status));
204 if ((status = pam_acct_mgmt(pamh, 0)) != PAM_SUCCESS) {
207 pam_strerror(pamh, status));
212 if ((status = pam_open_session(pamh, 0)) != PAM_SUCCESS) {
215 pam_strerror(pamh, status));
219 if ((status = pam_close_session(pamh, 0)) != PAM_SUCCESS) {
222 pam_strerror(pamh, status));
227 status = pam_get_item(pamh, PAM_USER, &item);
231 pam_strerror(pamh, status));
238 static void set_pam_items(struct auth_request *request, pam_handle_t *pamh)
245 (void)pam_set_item(pamh, PAM_RHOST, host);
246 (void)pam_set_item(pamh, PAM_RUSER, request->user);
248 (void)pam_set_item(pamh, PAM_TTY, "dovecot");
255 pam_handle_t *pamh;
268 status = pam_start(service, request->user, &conv, &pamh);
272 pam_strerror(pamh, status));
276 set_pam_items(request, pamh);
277 status = try_pam_auth(request, pamh, service);
278 if ((status2 = pam_end(pamh, status)) != PAM_SUCCESS) {
281 pam_strerror(pamh, status2));