mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-19 23:00:18 +01:00
Fix possible undefined use od preprocessor.
Mixing preprocessor #if and code is undefined behavior in general, rewrite tools_package_version to not use it.
This commit is contained in:
@@ -435,29 +435,34 @@ int tools_write_mk(const char *file, const char *key, int keysize)
|
||||
|
||||
void tools_package_version(const char *name, bool use_pwlibs)
|
||||
{
|
||||
log_std("%s %s flags: %s%s\n", name, PACKAGE_VERSION,
|
||||
bool udev = false, blkid = false, keyring = false, fips = false;
|
||||
bool kernel_capi = false, pwquality = false, passwdqc = false;
|
||||
#ifdef USE_UDEV
|
||||
"UDEV "
|
||||
udev = true;
|
||||
#endif
|
||||
#ifdef HAVE_BLKID
|
||||
"BLKID "
|
||||
blkid = true;
|
||||
#endif
|
||||
#ifdef KERNEL_KEYRING
|
||||
"KEYRING "
|
||||
keyring = true;
|
||||
#endif
|
||||
#ifdef ENABLE_FIPS
|
||||
"FIPS "
|
||||
fips = true;
|
||||
#endif
|
||||
#ifdef ENABLE_AF_ALG
|
||||
"KERNEL_CAPI "
|
||||
kernel_capi = true;
|
||||
#endif
|
||||
,
|
||||
#if defined(ENABLE_PWQUALITY)
|
||||
use_pwlibs ? "PWQUALITY " : ""
|
||||
pwquality = true;
|
||||
#elif defined(ENABLE_PASSWDQC)
|
||||
use_pwlibs ? "PASSWDQC " : ""
|
||||
#else
|
||||
""
|
||||
passwdqc = true;
|
||||
#endif
|
||||
);
|
||||
log_std("%s %s flags: %s%s%s%s%s%s%s\n", name, PACKAGE_VERSION,
|
||||
udev ? "UDEV " : "",
|
||||
blkid ? "BLKID " : "",
|
||||
keyring ? "KEYRING " : "",
|
||||
fips ? "FIPS " : "",
|
||||
kernel_capi ? "KERNEL_CAPI " : "",
|
||||
pwquality && use_pwlibs ? "PWQUALITY " : "",
|
||||
passwdqc && use_pwlibs ? "PASSWDQC " : "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user