linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Schwarzott <zzam@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: Starting helper programs - explicit check instead of just adding
Date: Thu, 29 Mar 2007 07:49:41 +0000	[thread overview]
Message-ID: <200703290949.41993.zzam@gentoo.org> (raw)

Hi there!

Generally executing udev-helper programs located in /lib/udev works well 
(without specifying a path).
Only one rule I use, just does not work like one could think:

SUBSYSTEM="pnp", ENV{MODALIAS}!="?*", RUN+="/bin/sh -c 'while read id; 
do /lib/udev/modprobe.sh pnp:d$$id; done < /sys$devpath/id'"

Here I have to explicitly give the full path to modprobe.sh.

The code uses this to look for not fully qualified pathes:
if (strchr(argv[0], '/') = NULL) {
                strlcpy(program, "/lib/udev/", sizeof(program));
                strlcat(program, argv[0], sizeof(program));
                argv[0] = program;
        }
...
execv(argv[0], argv);

And that only looks at the main program started in the cmd-line and not what 
this shell does.

Is this something that could be changed?
By e.g. using some exec-call respecting path?
Or keeping the code as it is, but still adding /lib/udev to PATH for such 
embedded calls to work like one could assume with common-sense?

Matthias

-- 
Matthias Schwarzott (zzam)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

             reply	other threads:[~2007-03-29  7:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29  7:49 Matthias Schwarzott [this message]
2007-03-29 11:59 ` Starting helper programs - explicit check instead of just adding Kay Sievers

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=200703290949.41993.zzam@gentoo.org \
    --to=zzam@gentoo.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).