mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
tree-wide: check if non-empty password is acquired
This commit is contained in:
parent
623a8b1922
commit
204529d0fc
@ -1244,6 +1244,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();
|
||||
|
@ -3079,6 +3079,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];
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user