richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
ff6046
From 95bfd1d2f52698604e44c17dba2082f61b5f8eab Mon Sep 17 00:00:00 2001
ff6046
From: Lennart Poettering <lennart@poettering.net>
ff6046
Date: Fri, 5 Oct 2018 22:37:37 +0200
ff6046
Subject: [PATCH] cryptsetup: don't use %m if there's no error to show
ff6046
ff6046
We are not the ones receiving an error here, but the ones generating it,
ff6046
hence we shouldn't show it with %m, that's just confusing, as it
ff6046
suggests we received an error from some other call.
ff6046
ff6046
(cherry-picked from commit 2abe64666e544be6499f870618185f8819b4c152)
ff6046
ff6046
Related: #1656869
ff6046
---
ff6046
 src/cryptsetup/cryptsetup-generator.c | 6 ++++--
ff6046
 1 file changed, 4 insertions(+), 2 deletions(-)
ff6046
ff6046
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
ff6046
index 8c7a76e789..52391bd185 100644
ff6046
--- a/src/cryptsetup/cryptsetup-generator.c
ff6046
+++ b/src/cryptsetup/cryptsetup-generator.c
ff6046
@@ -152,8 +152,10 @@ static int create_disk(
ff6046
                         return log_oom();
ff6046
         }
ff6046
 
ff6046
-        if (keydev && !password)
ff6046
-                return log_error_errno(-EINVAL, "Keydev is specified, but path to the password file is missing: %m");
ff6046
+        if (keydev && !password) {
ff6046
+                log_error("Key device is specified, but path to the password file is missing.");
ff6046
+                return -EINVAL;
ff6046
+        }
ff6046
 
ff6046
         r = generator_open_unit_file(arg_dest, NULL, n, &f);
ff6046
         if (r < 0)