anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
Blob Blame History Raw
From 2737fab0dba5ed238b4e0e927139e46e4911e1b4 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 28 Jan 2016 16:01:51 +0100
Subject: [PATCH] ask-password: don't abort when message is missing

This was fixed in upstream in
e287086b8aa2558356af225a12d9bfea8e7d61ca
add support for caching passwords in the kernel keyring

But we don't want that in rhel.

rhel-only

Resolves: #1261136
---
 src/shared/ask-password-api.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index 0a61dafc59..19baa6b55d 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -70,9 +70,11 @@ int ask_password_tty(
                 POLL_INOTIFY
         };
 
-        assert(message);
         assert(_passphrase);
 
+        if (!message)
+                message = "Password:";
+
         if (flag_file) {
                 notify = inotify_init1(IN_CLOEXEC|IN_NONBLOCK);
                 if (notify < 0) {