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