summaryrefslogtreecommitdiffstats
path: root/src/tty-ask-password-agent
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-09-06 08:00:32 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-09-06 08:00:32 +0200
commit204529d0fcde9a95119b489225620f36649c2f5b (patch)
treeb23dcaaa757c559946a5edc780b60f1bd2e8c3e5 /src/tty-ask-password-agent
parentask-password: refuse empty password strv (diff)
downloadsystemd-204529d0fcde9a95119b489225620f36649c2f5b.tar.xz
systemd-204529d0fcde9a95119b489225620f36649c2f5b.zip
tree-wide: check if non-empty password is acquired
Diffstat (limited to 'src/tty-ask-password-agent')
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c4
1 files changed, 1 insertions, 3 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 4b1e848749..df21f3d28f 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -263,9 +263,7 @@ static int process_one_password_file(const char *filename) {
return log_error_errno(r, "Failed to query password: %m");
}
- if (strv_isempty(passwords))
- return -ECANCELED;
-
+ assert(!strv_isempty(passwords));
r = send_passwords(socket_name, passwords);
if (r < 0)
return log_error_errno(r, "Failed to send: %m");