mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Open device in locked mode for wipe when necessary.
This commit is contained in:
@@ -157,6 +157,9 @@ int crypt_wipe_device(struct crypt_device *cd,
|
|||||||
if (MISALIGNED_512(offset) || MISALIGNED_512(length) || MISALIGNED_512(wipe_block_size))
|
if (MISALIGNED_512(offset) || MISALIGNED_512(length) || MISALIGNED_512(wipe_block_size))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (device_is_locked(device))
|
||||||
|
devfd = device_open_locked(cd, device, O_RDWR);
|
||||||
|
else
|
||||||
devfd = device_open(cd, device, O_RDWR);
|
devfd = device_open(cd, device, O_RDWR);
|
||||||
if (devfd < 0)
|
if (devfd < 0)
|
||||||
return errno ? -errno : -EINVAL;
|
return errno ? -errno : -EINVAL;
|
||||||
|
|||||||
Reference in New Issue
Block a user