recovery-utils: only print open device warning when encrypting partitions
Technically, partition unencryption is safe to do in open devices, although it implies that at least one partition has already been encrypted. If we aren't going to encrypt any partitions, there's no need to print the warning. Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
This commit is contained in:
parent
8c19cda181
commit
d5c696fd5b
|
|
@ -846,7 +846,12 @@ int encrypt_partitions(char *to_encrypt, char *to_unencrypt, unsigned char force
|
|||
goto err;
|
||||
}
|
||||
|
||||
print_open_device_warning();
|
||||
/*
|
||||
* Print warning on open devices only if we're encrypting at least
|
||||
* one partition.
|
||||
*/
|
||||
if (enc_diff[0])
|
||||
print_open_device_warning();
|
||||
|
||||
/*
|
||||
* At this point, we know that we have at least one partition to
|
||||
|
|
|
|||
Loading…
Reference in New Issue