Bug 294303 - devd(8) overwrites "bus" variable for "nomatch" event
Summary: devd(8) overwrites "bus" variable for "nomatch" event
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-07 14:13 UTC by Poul-Henning Kamp
Modified: 2026-04-08 18:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Poul-Henning Kamp freebsd_committer freebsd_triage 2026-04-07 14:13:43 UTC
When my Canon Lide printer is attach, no driver matches and devd(8) goes quantity surveying to find something.

When doing that it sets two different values for "bus":

  setting timestamp=1775570495.177197
  setting vm_guest=none
  setting bus=0
  setting hubaddr=1
  setting port=2
  setting devaddr=2
  setting interface=2
  setting ugen=ugen0.2
  setting vendor=0x04a9
  setting product=0x1912
  setting devclass=0x00
  setting devsubclass=0x00
  setting devproto=0x00
  setting sernum=4F3AFB
  setting release=0x0100
  setting mode=host
  setting intclass=0xff
  setting intsubclass=0xff
  setting intprotocol=0xff
  setting bus=uhub0

I'm catching that with:

  nomatch 1000 {
        match "vendor"          "0x04a9";
        match "product"         "0x1912";
        match "sernum"          "4F3AFB";
        action "echo FOO!; chmod 666 /dev/usb/0.$devaddr.0";
  };

But have to hard code the USB bus name because "uhub0" is not what I need.

See also: #198015 which seems to be the same problem presumably fixed 10 years ago?

Feel free to stick this example in the handbook's section 7.7.3.2:
   
    7.7.3.2. Using the Device State Change Daemon (devd(8))
    To be written...