]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: don't skip asking for password if splash is coming up
authorRay Strode <rstrode@redhat.com>
Fri, 10 Jan 2014 15:33:14 +0000 (10:33 -0500)
committerRay Strode <rstrode@redhat.com>
Fri, 10 Jan 2014 19:16:36 +0000 (14:16 -0500)
If the client asks for a password and we don't have a splash
screen, we currently reply with a NOANSWER reply which makes
the client ask for the password instead.  This is so ask-for-password
requests that come up when plymouthd isn't controlling the tty can be
handled.

These days show-splash requests are asynchronous and so a splash screen
might not be around "right now" but will be around in the near
future. In these cases, we really want plymouth to handle asking for
the password, because it's going to take control of the tty imminently,
so the client won't able able to ask for the password (and, of course,
we'd rather the splash ask for the password anyway, since it's a better
user experience)

This commit checks if there's a looming show splash request.  If there
is, it avoids doing the NOANSWER reply and instead just sits tight
waiting for the splash to come up and the user to enter the password.

src/main.c

index fd81f7243cd26fae2f067af0709015d3b8d0250a..50ccbf064784a9770fda5877a58e08c8eff3ac29 100644 (file)
@@ -461,10 +461,16 @@ on_ask_for_password (state_t      *state,
 {
   ply_entry_trigger_t *entry_trigger;
 
-  /* No splash, client will have to get password
+  /* Waiting to be shown, boot splash will
+   * arrive shortly so just sit tight
    */
-  if (state->boot_splash == NULL)
+  if (state->show_trigger != NULL)
+    {
+      ply_trace ("splash still coming up, waiting a bit");
+    }
+  else if (state->boot_splash == NULL)
     {
+      /* No splash, client will have to get password */
       ply_trace ("no splash loaded, replying immediately with no password");
       ply_trigger_pull (answer, NULL);
       return;