systemd/0558-cryptenroll-fix-an-ass...

33 lines
1.5 KiB
Diff

From 9b0ead2c1db66555e6ca97934085fd3dac397595 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Tue, 9 May 2023 22:17:15 +0200
Subject: [PATCH] cryptenroll: fix an assertion with weak passwords
Passing 0 to log_xxx_errno() leads to an assertion, so let's not do that:
$ NEWPASSWORD="" build-san/systemd-cryptenroll --unlock-key-file=/tmp/password --password "$img"
/tmp/password has 0644 mode that is too permissive, please adjust the ownership and access mode.
Assertion '(_error) != 0' failed at src/cryptenroll/cryptenroll-password.c:164, function enroll_password(). Aborting.
Aborted (core dumped)
(cherry picked from commit 0e43ab6d245a77aab35c7963ec636f37e6103984)
Related: RHEL-16182
---
src/cryptenroll/cryptenroll-password.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cryptenroll/cryptenroll-password.c b/src/cryptenroll/cryptenroll-password.c
index 9b7c8b5400..2e2efcf6f6 100644
--- a/src/cryptenroll/cryptenroll-password.c
+++ b/src/cryptenroll/cryptenroll-password.c
@@ -81,7 +81,7 @@ int enroll_password(
if (r < 0)
return log_error_errno(r, "Failed to check password for quality: %m");
if (r == 0)
- log_warning_errno(r, "Specified password does not pass quality checks (%s), proceeding anyway.", error);
+ log_warning("Specified password does not pass quality checks (%s), proceeding anyway.", error);
keyslot = crypt_keyslot_add_by_volume_key(
cd,