aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-09-14 17:45:48 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:37:01 -0700
commit3db7fa27027110fde92a1b6061fab434fe708e9f (patch)
treec7023de1613b738ba77b4780a7459e00b3f06378 /test
parentcb5203fb48d2c28f264b175aa560f08d6e368320 (diff)
downloadudev-3db7fa27027110fde92a1b6061fab434fe708e9f.tar.gz
[PATCH] fix udev segfaults with bad permissions file
On Tue, Sep 14, 2004 at 02:53:12PM +0200, Loleslaw wrote: > Hi, > Since I started using udev-031 on my gentoo udevstart would just segfault > (udev-030 worked). As it turned out I had a file in /etc/udev/permissions.d > with a single space in one line. I've cleaned the file and it works all > right, but I thought you could be interested. > I've traced it to function namedev_init_permissions in namedev_parse.c > I don't know C well enough to suggest a patch. Yeah, thanks for pointing that out. It only happens if the file ends with whitespace-only lines. Here is a fix and a test for udev-test.pl to cover that case.
Diffstat (limited to 'test')
-rw-r--r--test/udev-test.pl16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl
index 1e7c51e5..9feb28a7 100644
--- a/test/udev-test.pl
+++ b/test/udev-test.pl
@@ -161,6 +161,22 @@ KERNEL="ttyUSB0", NAME="visor"
EOF
},
{
+ desc => "Handle whitespace only lines (and replace kernel name)",
+ subsys => "tty",
+ devpath => "/class/tty/ttyUSB0",
+ exp_name => "whitespace" ,
+ conf => <<EOF
+
+
+
+ # this is a comment with whitespace before the comment
+KERNEL="ttyUSB0", NAME="whitespace"
+
+
+
+EOF
+ },
+ {
desc => "Handle empty lines in config file (and replace kernel name)",
subsys => "tty",
devpath => "/class/tty/ttyUSB0",