From 2f67864064d846c3d1bbbe58ab271c0a8fc83b12 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 1 Jun 2021 13:16:47 +0200 Subject: [PATCH] cryptsetup: explicitl set default log functions wherever needed Code using libcryptsetup already sets the global log function if it uses dlopen_cryptsetup(). Make sure we do the same for the three programs that explicitly link against libcryptsetup and hence to not use dlopen_cryptsetup(). --- src/cryptenroll/cryptenroll.c | 2 ++ src/cryptsetup/cryptsetup.c | 2 +- src/veritysetup/veritysetup.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cryptenroll/cryptenroll.c b/src/cryptenroll/cryptenroll.c index 030296cc02..460e895a02 100644 --- a/src/cryptenroll/cryptenroll.c +++ b/src/cryptenroll/cryptenroll.c @@ -510,6 +510,8 @@ static int run(int argc, char *argv[]) { if (r <= 0) return r; + cryptsetup_enable_logging(NULL); + if (arg_enroll_type < 0) r = prepare_luks(&cd, NULL, NULL); /* No need to unlock device if we don't need the volume key because we don't need to enroll anything */ else diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 024909f733..28ac78cd37 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -1449,7 +1449,7 @@ static int run(int argc, char *argv[]) { log_setup(); - cryptsetup_enable_logging(cd); + cryptsetup_enable_logging(NULL); umask(0022); diff --git a/src/veritysetup/veritysetup.c b/src/veritysetup/veritysetup.c index 2b54065437..34208dcd87 100644 --- a/src/veritysetup/veritysetup.c +++ b/src/veritysetup/veritysetup.c @@ -138,6 +138,8 @@ static int run(int argc, char *argv[]) { log_setup(); + cryptsetup_enable_logging(NULL); + umask(0022); if (streq(argv[1], "attach")) {