diff --git a/src/cryptsetup.c b/src/cryptsetup.c index 61b32b0b..30acc9a1 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -2899,8 +2899,7 @@ static void help(poptContext popt_context, struct action_type *action; const struct crypt_pbkdf_type *pbkdf_luks1, *pbkdf_luks2; - log_std("%s\n",PACKAGE_STRING); - + tools_package_version(PACKAGE_NAME, true); poptPrintHelp(popt_context, stdout, 0); log_std(_("\n" @@ -2958,7 +2957,7 @@ static void help(poptContext popt_context, poptFreeContext(popt_context); exit(EXIT_SUCCESS); } else if (key->shortName == 'V') { - log_std("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION); + tools_package_version(PACKAGE_NAME, true); tools_cleanup(); poptFreeContext(popt_context); exit(EXIT_SUCCESS); diff --git a/src/cryptsetup.h b/src/cryptsetup.h index e4bb29b3..7c1b2202 100644 --- a/src/cryptsetup.h +++ b/src/cryptsetup.h @@ -73,6 +73,7 @@ typedef enum { CREATED, UNLOCKED, REMOVED } crypt_object_op; void tools_keyslot_msg(int keyslot, crypt_object_op op); void tools_token_msg(int token, crypt_object_op op); void tools_token_error_msg(int error, const char *type, int token, bool pin_provided); +void tools_package_version(const char *name, bool use_pwlibs); extern volatile int quit; void set_int_block(int block); diff --git a/src/integritysetup.c b/src/integritysetup.c index 98c6bde9..b5b87e49 100644 --- a/src/integritysetup.c +++ b/src/integritysetup.c @@ -540,7 +540,7 @@ static void help(poptContext popt_context, struct action_type *action; if (key->shortName == '?') { - log_std("%s %s\n", PACKAGE_INTEGRITY, PACKAGE_VERSION); + tools_package_version(PACKAGE_INTEGRITY, false); poptPrintHelp(popt_context, stdout, 0); log_std(_("\n" " is one of:\n")); @@ -559,7 +559,7 @@ static void help(poptContext popt_context, poptFreeContext(popt_context); exit(EXIT_SUCCESS); } else if (key->shortName == 'V') { - log_std("%s %s\n", PACKAGE_INTEGRITY, PACKAGE_VERSION); + tools_package_version(PACKAGE_INTEGRITY, false); tools_cleanup(); poptFreeContext(popt_context); exit(EXIT_SUCCESS); diff --git a/src/utils_tools.c b/src/utils_tools.c index 1de3ebdc..bd07c998 100644 --- a/src/utils_tools.c +++ b/src/utils_tools.c @@ -432,3 +432,32 @@ int tools_write_mk(const char *file, const char *key, int keysize) close(fd); return r; } + +void tools_package_version(const char *name, bool use_pwlibs) +{ + log_std("%s %s flags: %s%s\n", name, PACKAGE_VERSION, +#ifdef USE_UDEV + "UDEV " +#endif +#ifdef HAVE_BLKID + "BLKID " +#endif +#ifdef KERNEL_KEYRING + "KEYRING " +#endif +#ifdef ENABLE_FIPS + "FIPS " +#endif +#ifdef ENABLE_AF_ALG + "KERNEL_CAPI " +#endif + , +#if defined(ENABLE_PWQUALITY) + use_pwlibs ? "PWQUALITY " : "" +#elif defined(ENABLE_PASSWDQC) + use_pwlibs ? "PASSWDQC " : "" +#else + "" +#endif + ); +} diff --git a/src/veritysetup.c b/src/veritysetup.c index c1ceb452..18f18fa0 100644 --- a/src/veritysetup.c +++ b/src/veritysetup.c @@ -493,7 +493,7 @@ static void help(poptContext popt_context, struct action_type *action; if (key->shortName == '?') { - log_std("%s %s\n", PACKAGE_VERITY, PACKAGE_VERSION); + tools_package_version(PACKAGE_VERITY, false); poptPrintHelp(popt_context, stdout, 0); log_std(_("\n" " is one of:\n")); @@ -516,7 +516,7 @@ static void help(poptContext popt_context, poptFreeContext(popt_context); exit(EXIT_SUCCESS); } else if (key->shortName == 'V') { - log_std("%s %s\n", PACKAGE_VERITY, PACKAGE_VERSION); + tools_package_version(PACKAGE_VERITY, false); tools_cleanup(); poptFreeContext(popt_context); exit(EXIT_SUCCESS);