diff options
author | Brian Cameron <brian.cameron@oracle.com> | 2012-06-27 15:45:57 -0500 |
---|---|---|
committer | Brian Cameron <brian.cameron@oracle.com> | 2012-06-27 15:45:57 -0500 |
commit | 8c429b88279207cb8ca980b9b37a2b056ae8e5ee (patch) | |
tree | 945d1b46fcfbc163cbdeb86d8cc0684d6d9fa63f | |
parent | 4468525464e738e0d7ab28c95f33af1cd319320c (diff) | |
download | gdm-8c429b88279207cb8ca980b9b37a2b056ae8e5ee.tar.gz |
Fix automatic login so it works properly when used with a script that
returns NULL. The gdm_slave_get_timed_login_details function only checks
the script output if you pass in a non-NULL username.
-rw-r--r-- | daemon/gdm-simple-slave.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c index e80122f6..ffb8b13c 100644 --- a/daemon/gdm-simple-slave.c +++ b/daemon/gdm-simple-slave.c @@ -1080,6 +1080,7 @@ idle_connect_to_display (GdmSimpleSlave *slave) res = gdm_slave_connect_to_x11_display (GDM_SLAVE (slave)); if (res) { gboolean enabled; + char *username; int delay; /* FIXME: handle wait-for-go */ @@ -1088,7 +1089,8 @@ idle_connect_to_display (GdmSimpleSlave *slave) delay = 0; enabled = FALSE; - gdm_slave_get_timed_login_details (GDM_SLAVE (slave), &enabled, NULL, &delay); + username = NULL; + gdm_slave_get_timed_login_details (GDM_SLAVE (slave), &enabled, &username, &delay); if (! enabled || delay > 0) { start_greeter (slave); create_new_session (slave); @@ -1097,6 +1099,7 @@ idle_connect_to_display (GdmSimpleSlave *slave) gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/Init", GDM_USERNAME); reset_session (slave); } + g_free (username); } else { if (slave->priv->connection_attempts >= MAX_CONNECT_ATTEMPTS) { g_warning ("Unable to connect to display after %d tries - bailing out", slave->priv->connection_attempts); |