From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: udevstart badly broken in udev 031
Date: Mon, 13 Sep 2004 01:23:58 +0000 [thread overview]
Message-ID: <1095038638.3537.22.camel@localhost.localdomain> (raw)
In-Reply-To: <20040912235611.GA2326@wonderland.linux.it>
[-- Attachment #1: Type: text/plain, Size: 731 bytes --]
On Mon, 2004-09-13 at 01:56 +0200, Marco d'Itri wrote:
> Starting from udev 031, the %-arguments passed to PROGRAMs are not
> correct when the new udevstart code is being used.
>
> KERNEL="event[0-9]*", NAME="input/%k", PROGRAM="/etc/udev/inputdev.sh %k %n %M %m", RESULT="inputdev", MODE="0664", GROUP="video"
>
> generates this log (just echo $*):
>
> event0 0 13 64
> event0 0 13 64
> event0 0 13 64
>
> while the correct log (generated using the old shell script instead of
> udevstart) would be:
>
> event0 0 13 64
> event1 1 13 65
> event2 2 13 66
Yes, I can simulate this, please try the attached patch. I expect, that
it fixes it, cause we better not mangle the parsed config while matching
the rules.
Thanks,
Kay
[-- Attachment #2: udevstart-fix-01.patch --]
[-- Type: text/x-patch, Size: 735 bytes --]
===== namedev.c 1.144 vs edited =====
--- 1.144/namedev.c 2004-09-07 12:50:10 +02:00
+++ edited/namedev.c 2004-09-13 03:15:56 +02:00
@@ -813,10 +813,12 @@
/* execute external program */
if (dev->program[0] != '\0') {
+ char program[PROGRAM_SIZE];
+
dbg("check " FIELD_PROGRAM);
- apply_format(udev, dev->program, sizeof(dev->program),
- class_dev, sysfs_device);
- if (execute_program(dev->program, udev->program_result, NAME_SIZE) != 0) {
+ strfieldcpy(program, dev->program);
+ apply_format(udev, program, sizeof(program), class_dev, sysfs_device);
+ if (execute_program(program, udev->program_result, NAME_SIZE) != 0) {
dbg(FIELD_PROGRAM " returned nonzero");
goto try_parent;
} else {
next prev parent reply other threads:[~2004-09-13 1:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-12 23:56 udevstart badly broken in udev 031 Marco d'Itri
2004-09-13 1:23 ` Kay Sievers [this message]
2004-09-13 6:15 ` Bob Barry
2004-09-14 6:00 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1095038638.3537.22.camel@localhost.localdomain \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).