anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0273-ask-password-don-t-abort-when-message-is-missing.patch

1abbee
From 2737fab0dba5ed238b4e0e927139e46e4911e1b4 Mon Sep 17 00:00:00 2001
1abbee
From: Lukas Nykryn <lnykryn@redhat.com>
1abbee
Date: Thu, 28 Jan 2016 16:01:51 +0100
1abbee
Subject: [PATCH] ask-password: don't abort when message is missing
1abbee
1abbee
This was fixed in upstream in
1abbee
e287086b8aa2558356af225a12d9bfea8e7d61ca
1abbee
add support for caching passwords in the kernel keyring
1abbee
1abbee
But we don't want that in rhel.
1abbee
1abbee
rhel-only
1abbee
1abbee
Resolves: #1261136
1abbee
---
1abbee
 src/shared/ask-password-api.c | 4 +++-
1abbee
 1 file changed, 3 insertions(+), 1 deletion(-)
1abbee
1abbee
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
181b3f
index 0a61dafc5..19baa6b55 100644
1abbee
--- a/src/shared/ask-password-api.c
1abbee
+++ b/src/shared/ask-password-api.c
1abbee
@@ -70,9 +70,11 @@ int ask_password_tty(
1abbee
                 POLL_INOTIFY
1abbee
         };
1abbee
 
1abbee
-        assert(message);
1abbee
         assert(_passphrase);
1abbee
 
1abbee
+        if (!message)
1abbee
+                message = "Password:";
1abbee
+
1abbee
         if (flag_file) {
1abbee
                 notify = inotify_init1(IN_CLOEXEC|IN_NONBLOCK);
1abbee
                 if (notify < 0) {