linux-base: Discard labels containing the # character

svn path=/dists/sid/linux-2.6/; revision=15510
This commit is contained in:
Ben Hutchings 2010-04-11 00:51:27 +00:00
parent 06986e9c25
commit 63d419cf28
1 changed files with 2 additions and 1 deletions

View File

@ -1264,12 +1264,13 @@ 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.
# Similarly for '#' which blkid surprisingly does not consider unsafe.
# 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{$_}} == 1 && $_ !~ /\\/ }
grep({ @{$id_map{$_}} == 1 && $_ !~ /[\\#]/ }
@{$bdev_map{$bdev}->{ids}}));
}