Support keyfile offset and keyfile size option even for plain volumes.

For historic reasons, in the plain mode the hashing is not used
if keyfile is used (with exception of --key-file=-).

Print warning if the parameters are ignored.

For other cases, uses keyfile offset, keyfile size and hash
as psecified on commandline.

Partially fixes issue#243
This commit is contained in:
Milan Broz
2015-02-04 15:37:41 +01:00
parent 6d51e8ab69
commit 31a4d552a2
4 changed files with 62 additions and 19 deletions

View File

@@ -46,6 +46,9 @@ static int device_ready(const char *device)
int devfd, r = 0;
struct stat st;
//FIXME: check if device allows to use O_DIRECT
// not only on open but also on read (with offset 0)
log_dbg("Trying to open and read device %s.", device);
devfd = open(device, O_RDONLY);
if (devfd < 0) {