Always print warning when device is not LUKS in crypt_load().
authorMilan Broz <gmazyland@gmail.com>
Sat, 14 Nov 2009 21:33:30 +0000 (21:33 +0000)
committerMilan Broz <gmazyland@gmail.com>
Sat, 14 Nov 2009 21:33:30 +0000 (21:33 +0000)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@137 36d66b0a-2a48-0410-832c-cd162a569da5

lib/setup.c
luks/keymanage.c

index 101caba..bd9bf25 100644 (file)
@@ -1182,7 +1182,7 @@ int crypt_load(struct crypt_device *cd,
                return -ENOSYS;
        }
 
-       r = LUKS_read_phdr(cd->device, &hdr, 0, cd);
+       r = LUKS_read_phdr(cd->device, &hdr, 1, cd);
 
        if (!r) {
                memcpy(&cd->hdr, &hdr, sizeof(hdr));
index 54d322a..63700da 100644 (file)
@@ -251,9 +251,9 @@ static int _check_and_convert_hdr(const char *device,
        if(memcmp(hdr->magic, luksMagic, LUKS_MAGIC_L)) { /* Check magic */
                log_dbg("LUKS header not detected.");
                if (require_luks_device)
-                       log_err(ctx, _("%s is not LUKS device.\n"), device);
+                       log_err(ctx, _("%s is not LUKS device.\n"), device);
                else
-                       set_error(_("%s is not LUKS device."), device);
+                       set_error(_("%s is not LUKS device."), device);
                r = -EINVAL;
        } else if((hdr->version = ntohs(hdr->version)) != 1) {  /* Convert every uint16/32_t item from network byte order */
                log_err(ctx, _("Unsupported LUKS version %d.\n"), hdr->version);