Package: cryptsetup
Version: 2:1.3.0-3
Severity: minor
Tags: patch

Dear Maintainer,

While was looking at the cryptroot initramfs-script
and found a minor bug in process.

The message "maximum number of tries" will never be
printed because the "-lt" condition in the while loop
will trigger once $count is equal to $crypttries.

while [ $crypttries -le 0 ] || [ $count -lt $crypttries ]; do
        count = $(( $count + 1 ))
        ...

        if [ $crypttries -gt ] && [ $count -gt $cryptties ]; then
                message "maximum number of tries..."
                return
        fi
done

[ A fix should be attached, but it's been a while since
I've used reportbug :D ]

-- Package-specific info:
-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-rc10-wl+ (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages cryptsetup depends on:
ii  debconf [debconf-2.0]  1.5.41     
ii  dmsetup                2:1.02.65-1
ii  libc6                  2.13-21    
ii  libcryptsetup1         2:1.3.0-3  
ii  libpopt0               1.16-1     

cryptsetup recommends no packages.

Versions of packages cryptsetup suggests:
ii  busybox                                 1:1.18.5-1
ii  dosfstools                              3.0.9-1   
ii  initramfs-tools [linux-initramfs-tool]  0.99      
ii  liblocale-gettext-perl                  1.05-7    
ii  udev                                    172-1     

-- debconf information excluded

-- debsums errors found:
debsums: changed file /usr/share/initramfs-tools/scripts/local-top/cryptroot 
(from cryptsetup package)
^^ obviously, I did that
--- cryptroot.orig	2011-10-21 09:14:13.000000000 +0200
+++ cryptroot	2011-10-21 09:14:56.000000000 +0200
@@ -259,11 +259,6 @@ setup_mapping()
 			/bin/sleep 3
 		fi
 
-		if [ $crypttries -gt 0 ] && [ $count -gt $crypttries ]; then
-			message "cryptsetup: maximum number of tries exceeded for $crypttarget"
-			return 1
-		fi
-
 		if [ -z "$cryptkeyscript" ]; then
 			cryptkey="Unlocking the disk $cryptsource ($crypttarget)\nEnter passphrase: "
 			if [ -x /bin/plymouth ] && plymouth --ping; then
@@ -319,6 +314,11 @@ setup_mapping()
 		break
 	done
 
+	if [ $crypttries -gt 0 ] && [ $count -eq $crypttries ]; then
+		message "cryptsetup: maximum number of tries exceeded for $crypttarget"
+		return 1
+	fi
+
 	udev_settle
 	return 0
 }

Reply via email to