summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2007-05-10 04:34:22 +0000
committerBrian Cameron <bcameron@src.gnome.org>2007-05-10 04:34:22 +0000
commit1b9faa0d1afa691e29852ddbe27ead48353c1977 (patch)
tree3af174d558f7ece66906119a56ef5d37b449be51
parentc43ef4074f6c2b5613e37ae62f8b653f4de681f2 (diff)
downloadgdm-1b9faa0d1afa691e29852ddbe27ead48353c1977.tar.gz
Fix handling of AlwaysLoginCurrentSession and DoubleLoginWarning so it
2007-05-10 Brian Cameron <brian.cameron@sun.com> * daemon/slave.c: Fix handling of AlwaysLoginCurrentSession and DoubleLoginWarning so it works for the non-migratable case (for Xnest, XDMCP, etc.). svn path=/trunk/; revision=4908
-rw-r--r--ChangeLog6
-rw-r--r--daemon/slave.c35
2 files changed, 30 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index b33a68a5..b00a183f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2007-05-10 Brian Cameron <brian.cameron@sun.com>
+ * daemon/slave.c: Fix handling of AlwaysLoginCurrentSession and
+ DoubleLoginWarning so it works for the non-migratable case
+ (for Xnest, XDMCP, etc.). Fixes bug #172600.
+
+2007-05-10 Brian Cameron <brian.cameron@sun.com>
+
* daemon/gdm.c: In debug message handle when display is NULL to
avoid core dump on Solaris.
diff --git a/daemon/slave.c b/daemon/slave.c
index 4a300f5c..b6e65f09 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -1157,6 +1157,23 @@ ask_migrate (const char *migrate_to)
char *but[4];
char *askbuttons_msg;
+ /*
+ * If migratable and ALWAYS_LOGIN_CURRENT_SESSION is true, then avoid
+ * the dialog.
+ */
+ if (migrate_to != NULL &&
+ gdm_daemon_config_get_value_bool (GDM_KEY_ALWAYS_LOGIN_CURRENT_SESSION)) {
+ return 1;
+ }
+
+ /*
+ * Avoid dialog if DOUBLE_LOGIN_WARNING is false. In this case
+ * ALWAYS_LOGIN_CURRENT_SESSION is false, so assume new session.
+ */
+ if (!gdm_daemon_config_get_value_bool (GDM_KEY_DOUBLE_LOGIN_WARNING)) {
+ return 0;
+ }
+
but[0] = _("Log in anyway");
if (migrate_to != NULL) {
msg = _("You are already logged in. "
@@ -1236,29 +1253,25 @@ gdm_slave_check_user_wants_to_log_in (const char *user)
if (d->type != TYPE_XDMCP_PROXY) {
int r;
- if (!gdm_daemon_config_get_value_bool (GDM_KEY_DOUBLE_LOGIN_WARNING)) {
- g_free (migrate_to);
- return TRUE;
- }
-
- if (gdm_daemon_config_get_value_bool (GDM_KEY_ALWAYS_LOGIN_CURRENT_SESSION))
- r = 1;
- else
- r = ask_migrate (migrate_to);
+ r = ask_migrate (migrate_to);
if (r <= 0) {
g_free (migrate_to);
return TRUE;
}
+ /*
+ * migrate_to should never be NULL here, since
+ * ask_migrate will always return 0 or 1 if migrate_to
+ * is NULL.
+ */
if (migrate_to == NULL ||
(migrate_to != NULL && r == 2)) {
g_free (migrate_to);
return FALSE;
}
- /* Must be that r == 1, that is
- return to previous login */
+ /* Must be that r == 1, that is return to previous login */
if (d->type == TYPE_FLEXI) {
gdm_slave_whack_greeter ();