[Bug 1863239] Re: /dev/bus/usb/*/* device file of HP multi-function printer assigned to "audio" group
Till Kamppeter
1863239 at bugs.launchpad.net
Thu Mar 19 18:25:29 UTC 2020
Now I tried to investigate from which UDEV rule the wrong setting comes
from. First I searched all UDEV rules for the word "audio":
till at till-x1yoga:~$ grep -l '\baudio\b' /*/udev/rules.d/*.rules
/lib/udev/rules.d/50-udev-default.rules
/lib/udev/rules.d/60-persistent-v4l.rules
/lib/udev/rules.d/69-libmtp.rules
/lib/udev/rules.d/70-uaccess.rules
/lib/udev/rules.d/90-pulseaudio.rules
till at till-x1yoga:~$
So I expect only one of these can be the culprit. Actually a 'GROUP="audio"' setting exists only in
/lib/udev/rules.d/50-udev-default.rules
and
/lib/udev/rules.d/69-libmtp.rules
The former is probably no problem as it assigns this group only to
devices of 'SUBSYSTEM=="sound"" where the latter seems to be actually
the culprit.
First it includes some devices explicitly and then it lists thousands of
supported devices. In the end there is some rule for passing a wide
range of devices through an auto-probing:
---------
# Autoprobe vendor-specific, communication and PTP devices
ENV{ID_MTP_DEVICE}!="1", ENV{MTP_NO_PROBE}!="1", ENV{COLOR_MEASUREMENT_DEVICE}!="1", ENV{ID_GPHOTO}!="1", ENV{libsane_matched}!="yes", ATTR{bDeviceClass}=="00|02|06|ef|ff", PROGRAM="mtp-probe /sys$env{DEVPATH} $attr{busnum} $attr{devnum}", RESULT=="1", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
---------
And this auto-probing tests positive on my printer:
till at till-x1yoga:~$ /lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-1 001 012
1
till at till-x1yoga:~$
The device path of the printer I have taken from the blob in the udevadm
output (attached to previous comment) which also contains
"ID_MEDIA_PLAYER=1". So mtp-probe identifies my printer as a media
player and assigns the device file to the "audio" group.
I assume that this happens to most or even all HP printers, so an
exclusion of only my device via Vendor and Product ID would not be the
correct solution.
Either mtp-probe needs to get fixed or before said rule in the end of
the 69-libmtp.rules file and after the lines explicitly identifying
media players from HP, there should be placed a line to exclude further
HP devices, like
----------
...
# Exclude any further, not explicitly specified HP devices
ATTR{idVendor}=="03f0", GOTO="libmtp_rules_end"
# Autoprobe vendor-specific, communication and PTP devices
ENV{ID_MTP_DEVICE}!="1", ENV{MTP_NO_PROBE}!="1", ENV{COLOR_MEASUREMENT_DEVICE}!="1", ENV{ID_GPHOTO}!="1", ENV{libsane_matched}!="yes", ATTR{bDeviceClass}=="00|02|06|ef|ff", PROGRAM="mtp-probe /sys$env{DEVPATH} $attr{busnum} $attr{devnum}", RESULT=="1", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
LABEL="libmtp_rules_end"
----------
** Changed in: systemd (Ubuntu)
Status: Incomplete => Invalid
** Changed in: libmtp (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1863239
Title:
/dev/bus/usb/*/* device file of HP multi-function printer assigned to
"audio" group
Status in libmtp package in Ubuntu:
Confirmed
Status in pulseaudio package in Ubuntu:
Invalid
Status in systemd package in Ubuntu:
Invalid
Status in udev package in Ubuntu:
Invalid
Bug description:
When testing HPLIP I found out that CUPS backends can access my
printer only when they are running as root, when they are running as
the special user lp, as it is usually the case, they cannot access the
printer.
So I tried to find out why and saw that the /dev/bus/usb/*/* device
file for the printer has group ownership "audio" and not "lp":
till at till-x1yoga:~/ubuntu/hplip/focal/debian/hplip-3.19.12+dfsg0$ ll /dev/bus/usb/*/*
crw-rw-r-- 1 root root 189, 0 Feb 11 14:17 /dev/bus/usb/001/001
crw-rw-r-- 1 root root 189, 2 Feb 11 14:17 /dev/bus/usb/001/003
crw-rw-r-- 1 root root 189, 3 Feb 11 14:17 /dev/bus/usb/001/004
crw-rw-r-- 1 root plugdev 189, 4 Feb 14 12:23 /dev/bus/usb/001/005
crw-rw-r-- 1 root root 189, 5 Feb 11 14:17 /dev/bus/usb/001/006
crw-rw----+ 1 root audio 189, 62 Feb 14 12:37 /dev/bus/usb/001/063
crw-rw-r-- 1 root root 189, 128 Feb 11 14:17 /dev/bus/usb/002/001
crw-rw-r-- 1 root root 189, 130 Feb 13 09:38 /dev/bus/usb/002/003
till at till-x1yoga:~/ubuntu/hplip/focal/debian/hplip-3.19.12+dfsg0$
The printer is the device /dev/bus/usb/001/063:
till at till-x1yoga:~/ubuntu/hplip/focal/debian/hplip-3.19.12+dfsg0$ lsusb
Bus 002 Device 003: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 138a:0097 Validity Sensors, Inc.
Bus 001 Device 004: ID 04f2:b5ce Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 006: ID 056a:50b7 Wacom Co., Ltd Pen and multitouch sensor
Bus 001 Device 063: ID 03f0:7a12 HP, Inc HP OfficeJet Pro 8730
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
till at till-x1yoga:~/ubuntu/hplip/focal/debian/hplip-3.19.12+dfsg0$
There must be a bug somewhere in the UDEV rules.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libmtp/+bug/1863239/+subscriptions
More information about the foundations-bugs
mailing list