udev(7) claims $attr{} searches parents, when it doesn't

Bug #348513 reported by Scott James Remnant (Canonical) on 2009-03-25
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: udev

The udev(7) manpage claims that the $attr{} expansion searches all parents:

    If the matching device does not have such
    an attribute, all devices along the chain of parents are searched
    for a matching attribute.

This is not correct. Instead $attr{} only looks at the current device; or if KERNELS, SUBSYSTEMS, DRIVERS, ATTRS, etc. are used, the device matched by those.

If this is the intended behaviour, the documentation should be changed to match.

While we're at it, the manpage doesn't really make it clear that the KERNELS, SUBSYSTEMS, DRIVERS and ATTRS rules must all match the same device.

Changed in udev (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Martin Pitt (pitti) on 2009-07-18
Changed in udev (Ubuntu):
status: Confirmed → Triaged
Martin Pitt (pitti) wrote :

kay | the man page describes the old behavior, it should describe what it is doing today

Changed in udev (Ubuntu):
status: Triaged → In Progress
Martin Pitt (pitti) wrote :

As for your second issue about matching the same device, udev(7) currently says:

      "The following key names can be used to match against device properties.
       Some of the keys also match against properties of the parent devices in
       sysfs, not only the device that has generated the event. If multiple
       keys that match a parent device are specified in a single rule, all
       these keys must match at one and the same parent device."

Which is what you described.

Martin Pitt (pitti) wrote :
Changed in udev (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package udev - 161+git20100827-1

---------------
udev (161+git20100827-1) maverick; urgency=low

  * Merge fixes from trunk:
    - keymap: Fix Acer TravelMate 4720 (LP: #569815)
    - gudev: fix crash if netlink is not available (LP: #581527)
    - udev(7) manpage: Fix description of $attr (LP: #348513)
  * debian/changelog: Fix bug reference in previous upload.
  * debian/udev.{pre,post}inst: Remove pre-lucid upgrade code.
  * debian/udev.postinst: Drop obsolete /lib/udev/devices/sndstat symlink, OSS
    has gone from our kernels ages ago. (LP: #605443)
  * debian/udev.postinst, create_devices(): Drop devices which are handled by
    static_dev_create_links().
  * debian/udev.postinst, create_devices(): Drop devices which are handled by
    devtmpfs.
  * debian/rules: Work around gtk-doc not being able to work in a separate
    build tree; debian/rules prep already fixes $srcdir→$builddir, so copy
    the relevant source files into the build tree so that gtk-doc has
    something to scan for. (LP: #519670)
  * Add debian/local/hotplug.functions: Provides some helper functions which
    udev callouts can use. This is being used by usb-modeswitch, alsa, and
    other Debian packages. Copied from current udev sid package. (LP: #625110)
 -- Martin Pitt <email address hidden> Mon, 30 Aug 2010 11:21:43 +0200

Changed in udev (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers