mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-22 22:03:43 +03:00
tree-wide: check if non-empty password is acquired
(cherry picked from commit 204529d0fcde9a95119b489225620f36649c2f5b) (cherry picked from commit e80e9dce63787d1d4494ed65d7c27018344387d5) (cherry picked from commit a505f10b4b35b09cab6d4b06a364e52e3982ee55) (cherry picked from commit 1a628174759c03ad8590b6b35bf3baa75bcc35ba)
This commit is contained in:
parent
339e0b4c31
commit
bf4bc357f4
@ -1204,6 +1204,8 @@ static int acquire_new_password(
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to acquire password: %m");
|
||||
|
||||
assert(!strv_isempty(first));
|
||||
|
||||
question = mfree(question);
|
||||
if (asprintf(&question, "Please enter new password for user %s (repeat):", user_name) < 0)
|
||||
return log_oom();
|
||||
|
@ -2544,6 +2544,7 @@ int dissected_image_decrypt_interactively(
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to query for passphrase: %m");
|
||||
|
||||
assert(!strv_isempty(z));
|
||||
passphrase = z[0];
|
||||
}
|
||||
}
|
||||
|
@ -257,9 +257,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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user