From: Lennart Poettering Date: Tue, 1 Jun 2021 11:16:47 +0000 (+0200) Subject: cryptsetup: explicitl set default log functions wherever needed X-Git-Tag: v249-rc1~121^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f67864064d846c3d1bbbe58ab271c0a8fc83b12;p=thirdparty%2Fsystemd.git 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(). --- diff --git a/src/cryptenroll/cryptenroll.c b/src/cryptenroll/cryptenroll.c index 030296cc025..460e895a02b 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 024909f7334..28ac78cd378 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 2b54065437f..34208dcd876 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")) {