Package: cryptmount
Version: 4.1-2
Severity: important
Tags: patch

When using optical media (sector size 2048 bytes), cryptmount guesses 
the device size as a quarter of its actual size.
Index: cryptmount-4.1/cryptmount.c
===================================================================
--- cryptmount-4.1.orig/cryptmount.c	2011-02-28 14:20:50.867166060 +0000
+++ cryptmount-4.1/cryptmount.c	2011-02-28 14:21:24.236073480 +0000
@@ -196,9 +196,8 @@
     if (fd < 0) return (int64_t)-1;
 
 #ifdef BLKGETSIZE64
-    if (ioctl(fd, BLKGETSIZE64, &count) == 0
-        && ioctl(fd, BLKSSZGET, &blklen) == 0) {
-        count /= (int64_t)blklen;
+    if (ioctl(fd, BLKGETSIZE64, &count) == 0) {
+        count /= 512;
     } else {
         count = -1;
     }

Reply via email to