summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-08-26 23:05:46 +0200
committerLennart Poettering <lennart@poettering.net>2020-08-26 23:10:05 +0200
commit66bff73b4f91f8d2fdd385f9f1e2b6339055c9e4 (patch)
treee446bc091907990e545aa3d1315e9cd27bc57d63 /src/tty-ask-password-agent
parent4c4a018caba30a58c3549924b8521074bbe5adad (diff)
downloadsystemd-66bff73b4f91f8d2fdd385f9f1e2b6339055c9e4.tar.gz
tty-ask-pw-agent: the message string might not be set
Diffstat (limited to 'src/tty-ask-password-agent')
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index 49b30e14e0..096b90c2aa 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -210,7 +210,7 @@ static int process_one_password_file(const char *filename) {
switch (arg_action) {
case ACTION_LIST:
- printf("'%s' (PID %u)\n", message, pid);
+ printf("'%s' (PID %u)\n", strna(message), pid);
return 0;
case ACTION_WALL: {
@@ -219,7 +219,7 @@ static int process_one_password_file(const char *filename) {
if (asprintf(&wall,
"Password entry required for \'%s\' (PID %u).\r\n"
"Please enter password with the systemd-tty-ask-password-agent tool.",
- message,
+ strna(message),
pid) < 0)
return log_oom();
@@ -233,7 +233,7 @@ static int process_one_password_file(const char *filename) {
if (access(socket_name, W_OK) < 0) {
if (arg_action == ACTION_QUERY)
- log_info("Not querying '%s' (PID %u), lacking privileges.", message, pid);
+ log_info("Not querying '%s' (PID %u), lacking privileges.", strna(message), pid);
return 0;
}
@@ -246,7 +246,6 @@ static int process_one_password_file(const char *filename) {
r = ask_password_plymouth(message, not_after, flags, filename, &passwords);
else
r = agent_ask_password_tty(message, not_after, flags, filename, &passwords);
-
if (r < 0) {
/* If the query went away, that's OK */
if (IN_SET(r, -ETIME, -ENOENT))
@@ -262,8 +261,7 @@ static int process_one_password_file(const char *filename) {
if (r < 0)
return log_error_errno(r, "Failed to send: %m");
break;
- }
- }
+ }}
return 0;
}