[gdm] slave: respond to non-zero edit codes of PostLogin



commit e9dd70447e6b2e945f332e2354b3a0a53d383f20
Author: Paul van Tilburg <paul luon net>
Date:   Tue Sep 4 21:50:25 2012 -0400

    slave: respond to non-zero edit codes of PostLogin
    
    According to the documentation (see
    http://library.gnome.org/admin/gdm/stable/configuration.html.en#scripting),
    logins should be aborted if a PostLogin script exits with a non-zero
    return code.
    
    However, at the moment it doesn't and proceeds with logging the user in.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677931

 daemon/gdm-simple-slave.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-simple-slave.c b/daemon/gdm-simple-slave.c
index 2ee2261..2af76c7 100644
--- a/daemon/gdm-simple-slave.c
+++ b/daemon/gdm-simple-slave.c
@@ -330,6 +330,7 @@ static void
 stop_greeter (GdmSimpleSlave *slave)
 {
         char *username;
+        gboolean script_successful;
 
         g_debug ("GdmSimpleSlave: Stopping greeter");
 
@@ -345,10 +346,20 @@ stop_greeter (GdmSimpleSlave *slave)
         }
 
         if (username != NULL) {
-                gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", username);
+                script_successful = gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PostLogin", username);
+        } else {
+                script_successful = TRUE;
         }
         g_free (username);
 
+        if (!script_successful) {
+                g_debug ("GdmSimpleSlave: PostLogin script unsuccessful");
+
+                slave->priv->start_session_id = 0;
+                queue_greeter_reset (slave);
+                return;
+        }
+
         gdm_launch_environment_stop (GDM_LAUNCH_ENVIRONMENT (slave->priv->greeter_environment));
 }
 



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