udev-ish replacement for hal-cups-utils?

Tim Waugh twaugh at redhat.com
Thu Jul 16 09:58:40 PDT 2009


On Thu, 2009-07-16 at 18:46 +0200, Martin Pitt wrote:
> Tim Waugh [2009-07-16 16:59 +0100]:
> > It's no reason to quote anything if the programs are executed correctly
> > using an argv.
> 
> But RUN clauses in udev rules are mere strings, and thus cannot be
> picked apart properly.

This line is a mere string too:

udev-configure-printer "$IEEE1284_ID"

You'll now point out that double-quotes are needed to keep the
environment variable expansion in a single word for the argument vector.
That's what single quotes are for. :-)

ACTION=="add" RUN+='udev-configure-printer "$IEEE1284_ID"'

but I don't think udev understands that syntax.  My point is that it
ought to have been made that way.

In other words, a command line is a string that can be picked apart into
separate words for an argument vector, by the shell or by wordexp().
The way to pass in arbitrary strings safely is with properly quoted
environment variables.

> In fact, udev doesn't "collect" sysfs attributes, it just provides one
> interface for sysfs. But I agree that this is a bit unfortunate.

Probably the best idea for now is to use your suggestion of reading %
p/ieee1284_id from the file system.

Tim.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/devkit-devel/attachments/20090716/683aab06/attachment.pgp 


More information about the devkit-devel mailing list