From 50adbfd30085715940a22f1517c81584d73d767b Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 27 Nov 2018 08:24:20 +0100
Subject: [PATCH 065/142] two-step: Fix crash asking for password with multiple
 heads

Commit 9639ed895331 ("two-step: Fix animation not starting on later
added heads") unconditionally calls view_start_progress_animation() when
adding secondary heads, to fix the animation not running on secondary
heads when not asking for a password.

But we should not start the animation when adding a head after we've
already entered PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY state, otherwise
we end up starting it a second time when the user is done entering his
password, causing plymouth to crash and the boot to hang.

We already have the is_animating bool to indicate whether animations have
been started or not, use this to decide if we should start the animation
when adding a new head, fixing the crash.

Fixes: 9639ed895331 ("two-step: Fix animation not starting on ... added heads")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/plugins/splash/two-step/plugin.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c
index 924207c..0ceda90 100644
--- a/src/plugins/splash/two-step/plugin.c
+++ b/src/plugins/splash/two-step/plugin.c
@@ -1004,7 +1004,8 @@ add_pixel_display (ply_boot_splash_plugin_t *plugin,
         if (plugin->is_visible) {
                 if (view_load (view)) {
                         ply_list_append_data (plugin->views, view);
-                        view_start_progress_animation (view);
+                        if (plugin->is_animating)
+                                view_start_progress_animation (view);
                 } else {
                         view_free (view);
                 }
-- 
2.7.4

