Package: udev
Version: 0.076-5
Severity: normal
Tags: patch

Hi,

[a-z] may not represent all 26 ASCII lowercase letters in regular
expressions, eg. Estonian collation sorts z between s and t:
  $ echo rstuvwxyz | LC_ALL=en_US.UTF-8 sed -e 's/[a-z]//g'

  $ echo rstuvwxyz | LC_ALL=et_EE.UTF-8 sed -e 's/[a-z]//g'
  tuvwxy
As shown above, this applies to sed, but also awk, grep, expr
  $ echo tuv | LC_ALL=et_EE.UTF-8 awk '/[a-z]/ {print}'
  $ echo tuv | LC_ALL=et_EE.UTF-8 grep [a-z]
  $ LC_ALL=et_EE.UTF-8 expr tuv : [a-z]
  $
and many more.
One must then switch to C locale to avoid those collation issues,
see attached patch.  It is very unlikely that someone gets hit by
this problem in udev.preinst, but who knows, maybe an Estonian guy
with more than 20 IDE disks on his machine will complain one day?

Thanks

Denis
diff -ru debian.orig/udev.preinst debian/udev.preinst
--- debian.orig/udev.preinst    2005-12-16 13:34:58.000000000 +0100
+++ debian/udev.preinst 2005-12-16 13:37:32.000000000 +0100
@@ -97,7 +97,7 @@
   fi
   if dpkg --compare-versions $2 lt 0.046-5; then
     
CD_RE='^KERNEL="(hd[a-z]|sr[0-9]*|pcd[0-9]*)",[[:space:]]*PROGRAM="/etc/udev/scripts/cdsymlinks.sh
 %k"'
-    if grep --no-messages -q -E $CD_RE /etc/udev/rules.d/* \
+    if LC_ALL=C grep --no-messages -q -E $CD_RE /etc/udev/rules.d/* \
        && [ ! -e /etc/udev/rules.d/cd-aliases.rules ]; then
       ln -s ../cd-aliases.rules /etc/udev/rules.d/cd-aliases.rules
     fi

Reply via email to