]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup: explicitl set default log functions wherever needed
authorLennart Poettering <lennart@poettering.net>
Tue, 1 Jun 2021 11:16:47 +0000 (13:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Jun 2021 11:33:09 +0000 (13:33 +0200)
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
src/cryptsetup/cryptsetup.c
src/veritysetup/veritysetup.c

index 030296cc0252d5120024cdc924c1faa4a6e0260f..460e895a02ba771877171eb75816e89f986c541e 100644 (file)
@@ -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
index 024909f7334b07f970b4358d2bc45b09c6f676f9..28ac78cd3783612bb1674998b2b206d775f29d01 100644 (file)
@@ -1449,7 +1449,7 @@ static int run(int argc, char *argv[]) {
 
         log_setup();
 
-        cryptsetup_enable_logging(cd);
+        cryptsetup_enable_logging(NULL);
 
         umask(0022);
 
index 2b54065437fe49f1375cfcc6a8811feed04ee7ea..34208dcd87659e5da4501e169aa9856fd5344783 100644 (file)
@@ -138,6 +138,8 @@ static int run(int argc, char *argv[]) {
 
         log_setup();
 
+        cryptsetup_enable_logging(NULL);
+
         umask(0022);
 
         if (streq(argv[1], "attach")) {