1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2024-12-22 17:06:10 +00:00
g810-led/udev/g810-led.rules
Stephen Kitt e2b486fd1b
Rely on uaccess to control device access
The udev rules currently make supported device nodes world-readable
and writable, which means that any process on the system can read
traffic from keyboards including passwords etc. To avoid this, while
still allowing the "controlling" user to run g810-led without being
root, this patch adds a uaccess tag; this ensures that the user at the
console has write access to the devices. The mode is also changed to
660 to ensure that existing device nodes are fixed on upgrade.

Thanks to Xavi Drudis Ferran for bringing this to my attention.

Fixes: #293
Signed-off-by: Stephen Kitt <steve@sk2.org>
2022-11-28 21:05:05 +01:00

26 lines
4.0 KiB
Plaintext

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c336", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g213-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c330", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g410-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33a", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g413-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c342", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g512-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33c", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g513-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c333", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c338", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c331", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c337", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33f", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g815-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c32b", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g910-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c335", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g910-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c339", MODE="660", TAG+="uaccess", RUN+="/usr/bin/gpro-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c336", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g213-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c330", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g410-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33a", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g413-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c342", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g512-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c33c", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g513-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c333", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c338", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g610-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c331", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c337", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g810-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c32b", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g910-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c335", MODE="660", TAG+="uaccess", RUN+="/usr/bin/g910-led -p /etc/g810-led/profile"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c339", MODE="660", TAG+="uaccess", RUN+="/usr/bin/gpro-led -p /etc/g810-led/profile"