On Wed, 09 Dec 2015 at 21:43:35 +0100, Guilhem Moulin wrote:
> Sorry, typo :-(.  Patch updated.

…and again.  Sorry for the noise.

-- 
Guilhem.
From c4bcd1acdc3f65f5ce7943345d529b50bbeb21fb Mon Sep 17 00:00:00 2001
From: Guilhem Moulin <guil...@guilhem.org>
Date: Wed, 9 Dec 2015 21:42:19 +0100
Subject: [PATCH] d/initramfs/cryptroot-hook: Display a warning for invalid
 source devices.

---
 debian/changelog                | 2 ++
 debian/initramfs/cryptroot-hook | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index ac35aed..b0eb6ce 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -41,6 +41,8 @@ cryptsetup (2:1.7.0-1~mejo2) mejo-unstable; urgency=medium
     to cryptroot initramfs script. (closes: #801479)
   * debian/README.initramfs, debian/initramfs/cryptroot-hook: add support for
     storing keyfiles directly in the initrd. (closes: #786578)
+  * debian/initramfs/cryptroot-hook: display a warning for invalid source
+    devices (closes: #720515)
 
  -- Jonas Meurer <m...@debian.org>  Wed, 09 Dec 2015 16:07:18 +0100
 
diff --git a/debian/initramfs/cryptroot-hook b/debian/initramfs/cryptroot-hook
index 4b1eadd..8db3c82 100644
--- a/debian/initramfs/cryptroot-hook
+++ b/debian/initramfs/cryptroot-hook
@@ -268,6 +268,10 @@ get_device_opts() {
 			source="$link"
 		fi
 	fi
+	if [ "UUID=${source#UUID=}" = "$source" -a ! -b "/dev/disk/by-uuid/${source#UUID=}" ] ||
+		[ "UUID=${source#UUID=}" != "$source" -a ! -b "$source" ]; then
+			echo "cryptsetup: WARNING: Invalid source device $source" >&2
+	fi
 
 	# Sanity checks for $key
 	if [ "$key" = "/dev/random" ] || [ "$key" = "/dev/urandom" ]; then
-- 
2.6.3

Attachment: signature.asc
Description: PGP signature

Reply via email to