summaryrefslogtreecommitdiff
path: root/test/udev-test.pl
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-08-28 15:55:58 +0200
committerKay Sievers <kay.sievers@suse.de>2005-08-28 15:55:58 +0200
commit764ce7f2ab526c084f005186e0dcbabe59070247 (patch)
tree411a1246ee2a77271d2dab8a6480e5e7388694ac /test/udev-test.pl
parent5b13ecb830cdec338b514b9ed8c2c559c2f05223 (diff)
start to enforce plain ascii or valid utf8
No device node or symlink can have other characters as plain readable ascii or valid utf8. The /dev/disk/by-label/* symlinks can no longer contain weird stuff read from untrusted sources. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'test/udev-test.pl')
-rwxr-xr-xtest/udev-test.pl20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl
index c32cfe7eeb..e7c00e29e6 100755
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -1324,7 +1324,25 @@ EOF
devpath => "/block/sda/sda1",
exp_name => "sane",
rules => <<EOF
-BUS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e name; (/sbin/badprogram)", RESULT="name_ _/sbin/badprogram_", NAME="sane"
+BUS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e name; (/sbin/badprogram)", RESULT=="name_ _/sbin/badprogram_", NAME="sane"
+EOF
+ },
+ {
+ desc => "untrusted string sanitize (don't replace utf8)",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "uber",
+ rules => <<EOF
+BUS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e \\xc3\\xbcber" RESULT=="\xc3\xbcber", NAME="uber"
+EOF
+ },
+ {
+ desc => "untrusted string sanitize (replace invalid utf8)",
+ subsys => "block",
+ devpath => "/block/sda/sda1",
+ exp_name => "replaced",
+ rules => <<EOF
+BUS=="scsi", KERNEL=="sda1", PROGRAM=="/bin/echo -e \\xef\\xe8garbage", RESULT=="[?][?]garbage", NAME="replaced"
EOF
},
{