mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey-cryptsetup: Fix logging of libcryptsetup debug messages
Messages from libcryptsetup for logging level CRYPT_LOG_DEBUG may or may not include an EOL, dependent on the cryptsetup version: Between libcryptsetup version 2.1 and 2.2 debug messages do not include an EOL character, but since 2.2 they do. Append an EOL only if the message does not already end with EOL. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Reviewed-by: Jorg Schmidbauer <jschmidb@de.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
fb6e7e70c6
commit
d98a10f67f
@@ -455,7 +455,8 @@ static void cryptsetup_log(int level, const char *msg,
|
||||
fprintf(stderr, "%s: %s", program_invocation_short_name, msg);
|
||||
break;
|
||||
case CRYPT_LOG_DEBUG:
|
||||
fprintf(stderr, "%s: # %s\n", program_invocation_short_name, msg);
|
||||
fprintf(stderr, "%s: # %s%s", program_invocation_short_name,
|
||||
msg, msg[strlen(msg) - 1] == '\n' ? "" : "\n");
|
||||
break;
|
||||
#ifdef CRYPT_DEBUG_JSON
|
||||
case CRYPT_DEBUG_JSON:
|
||||
|
||||
Reference in New Issue
Block a user