Fix disk wipe (during keyslot removal) if used on 4k hw block device.

The "Gutmann" metod uses various offset, direct-io need
to even read device when working with buffer...

Fixes Issue 129.
This commit is contained in:
Milan Broz
2012-05-09 21:57:50 +02:00
parent f8aa0bc084
commit 490c17b3cd
3 changed files with 17 additions and 1 deletions

View File

@@ -133,7 +133,7 @@ int crypt_wipe(const char *device,
if (!buffer)
return -ENOMEM;
flags = O_WRONLY | O_DIRECT | O_SYNC;
flags = O_RDWR | O_DIRECT | O_SYNC;
/* use O_EXCL only for block devices */
if (exclusive && S_ISBLK(st.st_mode))