2010-12-16 13:59:25 +01:00
|
|
|
From 81eca00461968aac09f9e8535f4327282698b495 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Stefan Seyfried <seife+obs@b1-systems.com>
|
|
|
|
Date: Thu, 16 Dec 2010 11:30:17 +0100
|
|
|
|
Subject: [PATCH] Add bootsplash handling for password dialogs
|
|
|
|
|
|
|
|
openSUSE uses bootsplash.org, so add a crude handling for setting the
|
|
|
|
splash screen to verbose when a password is asked...
|
|
|
|
---
|
|
|
|
diff --git a/src/ask-password-api.c b/src/ask-password-api.c
|
2011-04-22 19:35:38 +02:00
|
|
|
index da967ab..b89bcea 100644
|
2012-10-26 14:34:44 +02:00
|
|
|
--- a/src/shared/ask-password-api.c
|
|
|
|
+++ b/src/shared/ask-password-api.c
|
2011-04-22 19:35:38 +02:00
|
|
|
@@ -62,6 +62,9 @@ int ask_password_tty(
|
2010-12-16 13:59:25 +01:00
|
|
|
bool reset_tty = false;
|
2011-04-22 19:35:38 +02:00
|
|
|
bool silent_mode = false;
|
|
|
|
bool dirty = false;
|
2010-12-16 13:59:25 +01:00
|
|
|
+ bool splash_silent = false;
|
|
|
|
+ FILE *procsplash = NULL;
|
|
|
|
+ char *line = NULL;
|
|
|
|
enum {
|
|
|
|
POLL_TTY,
|
|
|
|
POLL_INOTIFY
|
2011-04-22 19:35:38 +02:00
|
|
|
@@ -105,6 +108,19 @@ int ask_password_tty(
|
2010-12-16 13:59:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
reset_tty = true;
|
|
|
|
+ procsplash = fopen("/proc/splash", "r+");
|
|
|
|
+ if (procsplash) {
|
|
|
|
+ getline(&line, &p, procsplash);
|
|
|
|
+ p = 0; /* reset, just to make sure */
|
|
|
|
+ if (line &&
|
|
|
|
+ (strstr(line, "on\n") == line + strlen(line) - 3) &&
|
|
|
|
+ (strstr(line, "silent") != NULL)) {
|
|
|
|
+ splash_silent = true;
|
|
|
|
+ rewind(procsplash);
|
|
|
|
+ fprintf(procsplash, "verbose\n");
|
|
|
|
+ fflush(procsplash);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
zero(pollfd);
|
2011-04-22 19:35:38 +02:00
|
|
|
@@ -239,6 +255,12 @@ finish:
|
2010-12-16 13:59:25 +01:00
|
|
|
close_nointr_nofail(ttyfd);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (splash_silent) { /* only set if procsplash != NULL */
|
|
|
|
+ rewind(procsplash);
|
|
|
|
+ fprintf(procsplash, "silent\n");
|
|
|
|
+ fclose(procsplash);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|