gnome-keyring r1378 - in trunk: . pam



Author: nnielsen
Date: Thu Dec 11 20:44:16 2008
New Revision: 1378
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1378&view=rev

Log:
* pam/gkr-pam-module.c: Don't leave gnome-keyring-daemon running
if started for a password change. Patch by Vincent Untz.
Fixes bug #558636


Modified:
   trunk/ChangeLog
   trunk/pam/gkr-pam-module.c

Modified: trunk/pam/gkr-pam-module.c
==============================================================================
--- trunk/pam/gkr-pam-module.c	(original)
+++ trunk/pam/gkr-pam-module.c	Thu Dec 11 20:44:16 2008
@@ -925,7 +925,7 @@
 }
 
 static int
-pam_chauthtok_update (pam_handle_t *ph, struct passwd *pwd)
+pam_chauthtok_update (pam_handle_t *ph, struct passwd *pwd, uint args)
 {
 	const char *password, *original;
 	int ret, started_daemon = 0;
@@ -967,6 +967,12 @@
 		return ret;
 	
 	ret = change_keyring_password (ph, pwd, password, original);
+
+	/* if not auto_start, kill the daemon if we started it: we don't want
+	 * it to stay */
+	if (started_daemon && !(args & ARG_AUTO_START))
+		stop_daemon (ph, pwd);
+
 	if (ret != PAM_SUCCESS)
 		return ret;
 		
@@ -978,8 +984,11 @@
 {
 	const char *user;
 	struct passwd *pwd;
+	uint args;
 	int ret;
 	
+	args = parse_args (argc, argv);
+
 	/* Figure out and/or prompt for the user name */
 	ret = pam_get_user (ph, &user, NULL);
 	if (ret != PAM_SUCCESS) {
@@ -997,7 +1006,7 @@
 	if (flags & PAM_PRELIM_CHECK) 
 		return pam_chauthtok_preliminary (ph, pwd);
 	else if (flags & PAM_UPDATE_AUTHTOK)
-		return pam_chauthtok_update (ph, pwd);
+		return pam_chauthtok_update (ph, pwd, args);
 	else 
 		return PAM_IGNORE;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]