bigbigmdm / IMSProg

IMSProg - software for CH341A-based programmers to work with I2C, SPI and MicroWire EEPROM/Flash chips
https://antenna-dvb-t2.ru/IMSProg.php
GNU General Public License v3.0
196 stars 34 forks source link

The `TAG+="uaccess"` has no effect in the udev rule #98

Closed wucke13 closed 1 month ago

wucke13 commented 1 month ago

As hinted here, udev uaccess is granted by /usr/lib/udev/rules.d/73-seat-late.rules. So having a rule add the uaccess tag after 73-seat-late.rules ran has not effect. The rules are ran in lexical order, so to be compatible with the uacccess system, the rule must be renamed, i.e. to 70-CH341.rules.

https://github.com/bigbigmdm/IMSProg/blob/062b2f0488d2e8fc4adbabaffbff6fb958ad26f2/IMSProg_programmer/other/99-CH341.rules#L3-L3

bigbigmdm commented 1 month ago

@wucke13 , GROUP=‘plugdev’ is not enough for the current user to get permissions?

wucke13 commented 1 month ago

It is, on distros that use the plugdev group menchanism. Udev's uaccess is a completely orthogonal mechanism to provide access: essentially, for each device that was tagged uaccess, in 73-seat-late.rules an internal function of udev is called to grant access to all users that have a local seat.

The mechanism is widely used, but unfortunately under-documented, as pointed out in https://github.com/systemd/systemd/issues/4288. However, many distros consider deprecating plugdev and instead moving to uaccess as the cleaner approach, i.e. as mentioned in the archwiki: https://wiki.archlinux.org/title/Udev#Allowing_regular_users_to_use_devices

bigbigmdm commented 1 month ago

@Fantu , may I have your opinion on this? (Pull request)

wucke13 commented 1 month ago

Fixed by 947320fca4878b46beefbee05e47279c3b27f94e