Merge pull request #12972 from intelfx/cryptsetup-enable-libcryptsetup-debug

cryptsetup: properly handle libcryptsetup debug logging
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-07-09 00:47:06 +02:00
committed by GitHub
3 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -1110,11 +1110,11 @@ void log_parse_environment_realm(LogRealm realm) {
e = getenv("SYSTEMD_LOG_COLOR");
if (e && log_show_color_from_string(e) < 0)
log_warning("Failed to parse bool '%s'. Ignoring.", e);
log_warning("Failed to parse log color '%s'. Ignoring.", e);
e = getenv("SYSTEMD_LOG_LOCATION");
if (e && log_show_location_from_string(e) < 0)
log_warning("Failed to parse bool '%s'. Ignoring.", e);
log_warning("Failed to parse log location '%s'. Ignoring.", e);
}
LogTarget log_get_target(void) {
+5
View File
@@ -637,6 +637,11 @@ static int run(int argc, char *argv[]) {
log_setup_service();
crypt_set_log_callback(NULL, cryptsetup_log_glue, NULL);
if (DEBUG_LOGGING)
/* libcryptsetup won't even consider debug messages by default */
crypt_set_debug_level(CRYPT_DEBUG_ALL);
umask(0022);
if (streq(argv[1], "attach")) {
+2 -1
View File
@@ -129,7 +129,8 @@ static int maybe_resize_slave_device(const char *mountpath, dev_t main_devno) {
#if HAVE_LIBCRYPTSETUP
crypt_set_log_callback(NULL, cryptsetup_log_glue, NULL);
crypt_set_debug_level(1);
if (DEBUG_LOGGING)
crypt_set_debug_level(CRYPT_DEBUG_ALL);
#endif
r = get_block_device_harder(mountpath, &devno);