summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2010-01-26 01:13:33 -0500
committerRay Strode <rstrode@redhat.com>2010-01-26 01:20:00 -0500
commit8ccb7f17549c3a6e6199420cf90c8c0a2e1af666 (patch)
tree069b28377ed692fffb9b04e56f5a3ea2703c4873
parentf57fc3dcc56f4dc9731c1fdef1187a5b30e2ea5b (diff)
[main] Defer password requests to client if daemon unavailable
There are times when plymouthd isn't in a position to ask for the password (for instance, if the initramfs is about to run init=/bin/bash or something). In those cases, any password requests need to be handled by the client.
-rw-r--r--src/client/plymouth.c4
-rw-r--r--src/main.c18
2 files changed, 18 insertions, 4 deletions
diff --git a/src/client/plymouth.c b/src/client/plymouth.c
index 2d44294..a520901 100644
--- a/src/client/plymouth.c
+++ b/src/client/plymouth.c
@@ -283,6 +283,10 @@ on_password_answer (password_answer_state_t *answer_state,
exit_status = 0;
}
}
+ else if (answer == NULL)
+ {
+ on_password_answer_failure (answer_state, answer_state->state->client);
+ }
if (WIFSIGNALED (exit_status))
raise (WTERMSIG (exit_status));
diff --git a/src/main.c b/src/main.c
index e3cafc0..af956ee 100644
--- a/src/main.c
+++ b/src/main.c
@@ -251,8 +251,17 @@ on_ask_for_password (state_t *state,
const char *prompt,
ply_trigger_t *answer)
{
- ply_entry_trigger_t *entry_trigger =
- calloc (1, sizeof (ply_entry_trigger_t));
+ ply_entry_trigger_t *entry_trigger;
+
+ /* No splash, client will have to get password
+ */
+ if (state->boot_splash == NULL)
+ {
+ ply_trigger_pull (answer, NULL);
+ return;
+ }
+
+ entry_trigger = calloc (1, sizeof (ply_entry_trigger_t));
entry_trigger->type = PLY_ENTRY_TRIGGER_TYPE_PASSWORD;
entry_trigger->prompt = prompt;
entry_trigger->trigger = answer;
@@ -265,8 +274,9 @@ on_ask_question (state_t *state,
const char *prompt,
ply_trigger_t *answer)
{
- ply_entry_trigger_t *entry_trigger =
- calloc (1, sizeof (ply_entry_trigger_t));
+ ply_entry_trigger_t *entry_trigger;
+
+ entry_trigger = calloc (1, sizeof (ply_entry_trigger_t));
entry_trigger->type = PLY_ENTRY_TRIGGER_TYPE_QUESTION;
entry_trigger->prompt = prompt;
entry_trigger->trigger = answer;