From 0ad7933296ae2af9b3ba15e214b52a603b3b6fab Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 5 Apr 2010 18:12:44 +0000 Subject: [PATCH] linux-base: Do not use device labels including certain unsafe characters (Closes: #576537) svn path=/dists/sid/linux-2.6/; revision=15488 --- debian/changelog | 2 ++ debian/linux-base.postinst | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9ca3712e1..559185825 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,8 @@ linux-2.6 (2.6.32-11) UNRELEASED; urgency=low (Closes: #576442) - Where a device has both a UUID and a label, prefer to identify it by UUID, consistent with fresh installations + - Do not use device labels including certain unsafe characters + (Closes: #576537) * iwlwifi: Fix repeated warnings about tfds_in_queue (Closes: #574526) * eeepc-laptop: Disable CPU speed control on 701 and 702 since it can cause the system to hang (Closes: #559578) diff --git a/debian/linux-base.postinst b/debian/linux-base.postinst index 93fa5c2af..c3219fe76 100644 --- a/debian/linux-base.postinst +++ b/debian/linux-base.postinst @@ -1230,12 +1230,15 @@ sub scan_devices { } # Discard all labels and UUIDs(!) that are ambiguous. + # Discard all labels with 'unsafe' characters (escaped by blkid using + # backslashes) as they will not be usable in all configuration files. # Sort each device's IDs in reverse lexical order so that UUIDs are # preferred. for my $bdev (keys(%bdev_map)) { @{$bdev_map{$bdev}->{ids}} = sort({$b cmp $a} - grep({ $#{$id_map{$_}} == 0 } @{$bdev_map{$bdev}->{ids}})); + grep({ @{$id_map{$_}} == 1 && $_ !~ /\\/ } + @{$bdev_map{$bdev}->{ids}})); } # Add persistent aliases for CD/DVD/BD drives