mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-18 14:20:09 +01:00
Fis status command to display only specific device types.
Cryptsetup, veritysetup and integrity setup should ignore other device mappings in status command (it should display only basic type information).
This commit is contained in:
@@ -707,6 +707,10 @@ static int action_status(void)
|
||||
|
||||
log_std(" type: %s\n", crypt_get_type(cd) ?: "n/a");
|
||||
|
||||
/* Print only CRYPT type devices */
|
||||
if (!crypt_get_cipher(cd))
|
||||
goto out;
|
||||
|
||||
r = crypt_get_active_device(cd, action_argv[0], &cad);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
@@ -392,6 +392,7 @@ static int action_status(int arg)
|
||||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
/* Print only INTEGRITY (and LUKS2 with integrity) info */
|
||||
r = crypt_get_integrity_info(cd, &ip);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
@@ -257,22 +257,23 @@ static int action_status(int arg)
|
||||
ci == CRYPT_BUSY ? " and is in use" : "");
|
||||
|
||||
r = crypt_init_by_name_and_header(&cd, action_argv[0], NULL);
|
||||
if (r < 0 || !crypt_get_type(cd))
|
||||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
log_std(" type: %s\n", crypt_get_type(cd));
|
||||
log_std(" type: %s\n", crypt_get_type(cd) ?: "n/a");
|
||||
|
||||
r = crypt_get_active_device(cd, action_argv[0], &cad);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
log_std(" status: %s\n",
|
||||
cad.flags & CRYPT_ACTIVATE_CORRUPTED ? "corrupted" : "verified");
|
||||
|
||||
/* Print only VERITY type devices */
|
||||
r = crypt_get_verity_info(cd, &vp);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
log_std(" status: %s\n",
|
||||
cad.flags & CRYPT_ACTIVATE_CORRUPTED ? "corrupted" : "verified");
|
||||
|
||||
log_std(" hash type: %u\n", vp.hash_type);
|
||||
log_std(" data block: %u\n", vp.data_block_size);
|
||||
log_std(" hash block: %u\n", vp.hash_block_size);
|
||||
|
||||
Reference in New Issue
Block a user