From 5b90d8f3741ef9a48bdbc081bfc98811471b6473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Fri, 12 Oct 2012 12:25:05 +0200 Subject: [PATCH] weston-launch: Check result of pam_start. --- src/weston-launch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/weston-launch.c b/src/weston-launch.c index 36f9c6bf..cb69968a 100644 --- a/src/weston-launch.c +++ b/src/weston-launch.c @@ -157,6 +157,12 @@ setup_pam(struct weston_launch *wl) wl->pc.appdata_ptr = wl; err = pam_start("login", wl->pw->pw_name, &wl->pc, &wl->ph); + if (err != PAM_SUCCESS) { + fprintf(stderr, "failed to start pam transaction: %d: %s\n", + err, pam_strerror(wl->ph, err)); + return -1; + } + err = pam_set_item(wl->ph, PAM_TTY, ttyname(wl->tty)); if (err != PAM_SUCCESS) { fprintf(stderr, "failed to set PAM_TTY item: %d: %s\n",