* Fwd: Parse error in reading /etc/udev/udev.rules [udev-009]
@ 2003-12-23 12:17 Mitch
2003-12-23 15:12 ` Mitch
0 siblings, 1 reply; 2+ messages in thread
From: Mitch @ 2003-12-23 12:17 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]
Oops, did that patch in reverse. There is more than one occorunce of this
bug, so here is the updated patch.
Mitch
-------- Original Message --------
Subject: Parse error in reading /etc/udev/udev.rules [udev-009]
Date: Tue, 23 Dec 2003 12:13:31 +0000
From: Mitch <mitch@0bits.com>
To: linux-hotplug-devel@lists.sourceforge.net
Hi,
I've been pulling my hair out why my rule in udev.rules wasn't being honoured.
I turned debugging on and didn't get any joy either. Perusing the source
i found that DEBUG_PARSER is *not* defined when i compile DEBUG=true ! This
provides very useful information. Please enable it.
Anyhow back to my problem. I found i was getting a parse error in udev.rules
with the stock default provided udev.rules and hence no additional lines
were being read and parsing terminates - note this parse is *silent* and the
user is given no feedback if the parser fails. It would be nice even with debug
turned off that we got feedback about parse errors !
Dec 23 11:49:29 core udev[13191]: namedev_init_rules: read ' '
Dec 23 11:49:29 core udev[13191]: namedev_init_rules: unknown type of method ''
Dec 23 11:49:29 core udev[13187]: namedev_init_rules: /etc/udev/udev.rules:14:1073743040:< >: field missing or parse error
So i looked at the source, and found that i need to make the change shown in
the attachment since fgets() *stores* the '\n' character in the buffer and so the
empty line test fails and parsing stops. With this fix in the file is parsed correctly
and my rules are honoured.
Please apply.
Cheers
Mitch
P.s. man fgets() shows:
fgets() reads in at most one less than size characters from stream and stores them into
the buffer pointed to by s. Reading stops after an EOF or a newline. If a newline is
read, it is stored into the buffer. A '\0' is stored after the last character in the
buffer.
[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 691 bytes --]
*** namedev_parse.c.orig Tue Dec 23 12:15:04 2003
--- namedev_parse.c Tue Dec 23 12:15:41 2003
***************
*** 160,166 ****
dbg_parse("read '%s'", temp);
/* empty line? */
! if (*temp == 0x00)
continue;
/* see if this is a comment */
--- 160,166 ----
dbg_parse("read '%s'", temp);
/* empty line? */
! if (*temp == 0xa)
continue;
/* see if this is a comment */
***************
*** 352,358 ****
++temp;
/* empty line? */
! if (*temp == 0x00)
continue;
/* see if this is a comment */
--- 352,358 ----
++temp;
/* empty line? */
! if (*temp == 0xa)
continue;
/* see if this is a comment */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Fwd: Parse error in reading /etc/udev/udev.rules [udev-009]
2003-12-23 12:17 Fwd: Parse error in reading /etc/udev/udev.rules [udev-009] Mitch
@ 2003-12-23 15:12 ` Mitch
0 siblings, 0 replies; 2+ messages in thread
From: Mitch @ 2003-12-23 15:12 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 2159 bytes --]
A newer diff. We need to check for '\n' and '\0'.
-------- Original Message --------
Subject: Fwd: Parse error in reading /etc/udev/udev.rules [udev-009]
Date: Tue, 23 Dec 2003 12:17:22 +0000
From: Mitch <mitch@0bits.com>
To: linux-hotplug-devel@lists.sourceforge.net
Oops, did that patch in reverse. There is more than one occorunce of this
bug, so here is the updated patch.
Mitch
-------- Original Message --------
Subject: Parse error in reading /etc/udev/udev.rules [udev-009]
Date: Tue, 23 Dec 2003 12:13:31 +0000
From: Mitch <mitch@0bits.com>
To: linux-hotplug-devel@lists.sourceforge.net
Hi,
I've been pulling my hair out why my rule in udev.rules wasn't being honoured.
I turned debugging on and didn't get any joy either. Perusing the source
i found that DEBUG_PARSER is *not* defined when i compile DEBUG=true ! This
provides very useful information. Please enable it.
Anyhow back to my problem. I found i was getting a parse error in udev.rules
with the stock default provided udev.rules and hence no additional lines
were being read and parsing terminates - note this parse is *silent* and the
user is given no feedback if the parser fails. It would be nice even with debug
turned off that we got feedback about parse errors !
Dec 23 11:49:29 core udev[13191]: namedev_init_rules: read ' '
Dec 23 11:49:29 core udev[13191]: namedev_init_rules: unknown type of method ''
Dec 23 11:49:29 core udev[13187]: namedev_init_rules: /etc/udev/udev.rules:14:1073743040:< >: field missing or parse error
So i looked at the source, and found that i need to make the change shown in
the attachment since fgets() *stores* the '\n' character in the buffer and so the
empty line test fails and parsing stops. With this fix in the file is parsed correctly
and my rules are honoured.
Please apply.
Cheers
Mitch
P.s. man fgets() shows:
fgets() reads in at most one less than size characters from stream and stores them into
the buffer pointed to by s. Reading stops after an EOF or a newline. If a newline is
read, it is stored into the buffer. A '\0' is stored after the last character in the
buffer.
[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 681 bytes --]
*** namedev_parse.c.orig Tue Dec 23 15:10:54 2003
--- namedev_parse.c Tue Dec 23 15:09:20 2003
***************
*** 176,182 ****
++temp;
/* empty line? */
! if (*temp == 0x00)
continue;
/* see if this is a comment */
--- 176,182 ----
++temp;
/* empty line? */
! if (*temp == 0xa || *temp == 0x0)
continue;
/* see if this is a comment */
***************
*** 378,384 ****
++temp;
/* empty line? */
! if (*temp == 0x00)
continue;
/* see if this is a comment */
--- 378,384 ----
++temp;
/* empty line? */
! if (*temp == 0xa || *temp == 0x0)
continue;
/* see if this is a comment */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-12-23 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-23 12:17 Fwd: Parse error in reading /etc/udev/udev.rules [udev-009] Mitch
2003-12-23 15:12 ` Mitch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).