mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-17 05:40:13 +01:00
Add compile-in flag to program version output.
Then we can check if tools are compiled with a support for specific extension/library.
This commit is contained in:
@@ -2899,8 +2899,7 @@ static void help(poptContext popt_context,
|
|||||||
struct action_type *action;
|
struct action_type *action;
|
||||||
const struct crypt_pbkdf_type *pbkdf_luks1, *pbkdf_luks2;
|
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);
|
poptPrintHelp(popt_context, stdout, 0);
|
||||||
|
|
||||||
log_std(_("\n"
|
log_std(_("\n"
|
||||||
@@ -2958,7 +2957,7 @@ static void help(poptContext popt_context,
|
|||||||
poptFreeContext(popt_context);
|
poptFreeContext(popt_context);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
} else if (key->shortName == 'V') {
|
} else if (key->shortName == 'V') {
|
||||||
log_std("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
|
tools_package_version(PACKAGE_NAME, true);
|
||||||
tools_cleanup();
|
tools_cleanup();
|
||||||
poptFreeContext(popt_context);
|
poptFreeContext(popt_context);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ typedef enum { CREATED, UNLOCKED, REMOVED } crypt_object_op;
|
|||||||
void tools_keyslot_msg(int keyslot, crypt_object_op op);
|
void tools_keyslot_msg(int keyslot, crypt_object_op op);
|
||||||
void tools_token_msg(int token, 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_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;
|
extern volatile int quit;
|
||||||
void set_int_block(int block);
|
void set_int_block(int block);
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ static void help(poptContext popt_context,
|
|||||||
struct action_type *action;
|
struct action_type *action;
|
||||||
|
|
||||||
if (key->shortName == '?') {
|
if (key->shortName == '?') {
|
||||||
log_std("%s %s\n", PACKAGE_INTEGRITY, PACKAGE_VERSION);
|
tools_package_version(PACKAGE_INTEGRITY, false);
|
||||||
poptPrintHelp(popt_context, stdout, 0);
|
poptPrintHelp(popt_context, stdout, 0);
|
||||||
log_std(_("\n"
|
log_std(_("\n"
|
||||||
"<action> is one of:\n"));
|
"<action> is one of:\n"));
|
||||||
@@ -559,7 +559,7 @@ static void help(poptContext popt_context,
|
|||||||
poptFreeContext(popt_context);
|
poptFreeContext(popt_context);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
} else if (key->shortName == 'V') {
|
} else if (key->shortName == 'V') {
|
||||||
log_std("%s %s\n", PACKAGE_INTEGRITY, PACKAGE_VERSION);
|
tools_package_version(PACKAGE_INTEGRITY, false);
|
||||||
tools_cleanup();
|
tools_cleanup();
|
||||||
poptFreeContext(popt_context);
|
poptFreeContext(popt_context);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
|||||||
@@ -432,3 +432,32 @@ int tools_write_mk(const char *file, const char *key, int keysize)
|
|||||||
close(fd);
|
close(fd);
|
||||||
return r;
|
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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ static void help(poptContext popt_context,
|
|||||||
struct action_type *action;
|
struct action_type *action;
|
||||||
|
|
||||||
if (key->shortName == '?') {
|
if (key->shortName == '?') {
|
||||||
log_std("%s %s\n", PACKAGE_VERITY, PACKAGE_VERSION);
|
tools_package_version(PACKAGE_VERITY, false);
|
||||||
poptPrintHelp(popt_context, stdout, 0);
|
poptPrintHelp(popt_context, stdout, 0);
|
||||||
log_std(_("\n"
|
log_std(_("\n"
|
||||||
"<action> is one of:\n"));
|
"<action> is one of:\n"));
|
||||||
@@ -516,7 +516,7 @@ static void help(poptContext popt_context,
|
|||||||
poptFreeContext(popt_context);
|
poptFreeContext(popt_context);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
} else if (key->shortName == 'V') {
|
} else if (key->shortName == 'V') {
|
||||||
log_std("%s %s\n", PACKAGE_VERITY, PACKAGE_VERSION);
|
tools_package_version(PACKAGE_VERITY, false);
|
||||||
tools_cleanup();
|
tools_cleanup();
|
||||||
poptFreeContext(popt_context);
|
poptFreeContext(popt_context);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
|||||||
Reference in New Issue
Block a user