summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2020-01-25 08:57:10 +0000
committerDaiki Ueno <ueno@gnu.org>2020-01-25 08:57:10 +0000
commitfd130b339fec0d38427f2dec53868846744d472e (patch)
tree5ebb511484ecf11880d54e1747585f542379f3d9
parentaf0a6f5d290cc99046c289336b3d1978ec5eea26 (diff)
parent49bdee0ea20fdfef9336b9f21b047c84de864a1e (diff)
downloadgnome-keyring-fd130b339fec0d38427f2dec53868846744d472e.tar.gz
Merge branch '28-more-insight-pam-keyring-module' into 'master'
Provide more insight from pam_gnome_keyring about unlocking Closes #28 See merge request GNOME/gnome-keyring!28
-rw-r--r--pam/gkr-pam-module.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/pam/gkr-pam-module.c b/pam/gkr-pam-module.c
index 599cb20c..7a6b735e 100644
--- a/pam/gkr-pam-module.c
+++ b/pam/gkr-pam-module.c
@@ -583,6 +583,10 @@ start_daemon (pam_handle_t *ph,
}
ret = foreach_line (output, setup_environment, ph);
+ if (password)
+ syslog (GKR_LOG_INFO, "gkr-pam: gnome-keyring-daemon started properly and unlocked keyring");
+ else
+ syslog (GKR_LOG_INFO, "gkr-pam: gnome-keyring-daemon started properly");
done:
/* Restore old handler */
@@ -884,13 +888,13 @@ pam_sm_authenticate (pam_handle_t *ph, int unused, int argc, const char **argv)
ret = unlock_keyring (ph, pwd, password, &need_daemon);
if (ret != PAM_SUCCESS && need_daemon) {
- /* If we started the daemon, its already unlocked, since we passed the password */
- if (args & ARG_AUTO_START)
+ if (args & ARG_AUTO_START) {
+ /* We pass password to the daemon when starting, thus it will immediately unlock keyring */
ret = start_daemon (ph, pwd, true, password);
-
- /* Otherwise start later in open session, store password */
- else
+ } else {
ret = stash_password_for_session (ph, password);
+ syslog (GKR_LOG_INFO, "gkr-pam: stashed password to try later in open session");
+ }
}
return ret;