summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2002-07-09 15:32:12 +0000
committerGeorge Lebl <jirka@src.gnome.org>2002-07-09 15:32:12 +0000
commitf24d49dfe74822f67374ed817ad099f863f1df24 (patch)
tree85dc4a3614a29671f3f98eb3e7cf027f86c47b21
parent1b3aaea568c07a93c5337fd264f0ef9aba4367be (diff)
downloadgdm-f24d49dfe74822f67374ed817ad099f863f1df24.tar.gz
Fix a bug with finding the parent process (Oswald Buddenhagen
Tue Jul 09 08:44:04 2002 George Lebl <jirka@5z.com> * daemon/slave.c: Fix a bug with finding the parent process (Oswald Buddenhagen <ossi@kde.org>) * daemon/verify-pam.c: the autologin should do setcred/open_session just like normal login
-rw-r--r--ChangeLog8
-rw-r--r--daemon/slave.c2
-rw-r--r--daemon/verify-pam.c15
3 files changed, 18 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index d45603c3..59fb7f80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Jul 09 08:44:04 2002 George Lebl <jirka@5z.com>
+
+ * daemon/slave.c: Fix a bug with finding the parent process
+ (Oswald Buddenhagen <ossi@kde.org>)
+
+ * daemon/verify-pam.c: the autologin should do setcred/open_session
+ just like normal login
+
Mon Jul 08 20:42:27 2002 George Lebl <jirka@5z.com>
* configure.in, NEWS: raise version add some news
diff --git a/daemon/slave.c b/daemon/slave.c
index 38f8dae0..eb5d5dab 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -1465,7 +1465,7 @@ parent_exists (void)
{
pid_t ppid = getppid ();
- if (ppid <= 0 ||
+ if (ppid <= 1 ||
kill (ppid, 0) < 0)
return FALSE;
return TRUE;
diff --git a/daemon/verify-pam.c b/daemon/verify-pam.c
index dd5c7f99..aed109aa 100644
--- a/daemon/verify-pam.c
+++ b/daemon/verify-pam.c
@@ -557,19 +557,22 @@ gdm_verify_setup_user (GdmDisplay *d, const gchar *login, const gchar *display)
goto setup_pamerr;
}
- /* Register the session */
- pamerr = pam_open_session (pamh, 0);
+ /* Set credentials */
+ pamerr = pam_setcred (pamh, PAM_ESTABLISH_CRED);
if (pamerr != PAM_SUCCESS) {
if (gdm_slave_should_complain ())
- gdm_error (_("Couldn't open session for %s"), login);
+ gdm_error (_("Couldn't set credentials for %s"), login);
goto setup_pamerr;
}
- /* Set credentials */
- pamerr = pam_setcred (pamh, PAM_ESTABLISH_CRED);
+ /* Register the session */
+ pamerr = pam_open_session (pamh, 0);
if (pamerr != PAM_SUCCESS) {
+ /* Throw away the credentials */
+ pam_setcred (pamh, PAM_DELETE_CRED);
+
if (gdm_slave_should_complain ())
- gdm_error (_("Couldn't set credentials for %s"), login);
+ gdm_error (_("Couldn't open session for %s"), login);
goto setup_pamerr;
}