diff options
Diffstat (limited to 'community/libcec/0001-Add-an-udev-rule-making-the-CEC-adapter-part-of-the-input-group.patch')
-rw-r--r-- | community/libcec/0001-Add-an-udev-rule-making-the-CEC-adapter-part-of-the-input-group.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/community/libcec/0001-Add-an-udev-rule-making-the-CEC-adapter-part-of-the-input-group.patch b/community/libcec/0001-Add-an-udev-rule-making-the-CEC-adapter-part-of-the-input-group.patch new file mode 100644 index 00000000000..9ed4364d1d3 --- /dev/null +++ b/community/libcec/0001-Add-an-udev-rule-making-the-CEC-adapter-part-of-the-input-group.patch @@ -0,0 +1,44 @@ +From a3e9213b5e3ae2572390435e4b718fd7f3f49617 Mon Sep 17 00:00:00 2001 +From: Bart Ribbers <bribbers@disroot.org> +Date: Thu, 23 Dec 2021 12:25:25 +0100 +Subject: [PATCH] Add an udev rule making the CEC adapter part of the input + group + +Without this, the HDMI CEC USB adapter appears as /dev/ttyACM0 owned by +the dialout group with mode 660. This means that any user that wants to +use this device needs to be part of the dialout group. This actually has +security concerns as all serial devices are owned by that group as well +and it would give the user too much control of them, meaning any rogue +process can cause harm without needing root access. + +Since the CEC adapter is actually used as an input device, this udev +rule makes the device be part of the input group instead. This makes +sense as it _is_ an input device and any rogue process shouldn't be able +to do to much harm with that group. On most distributions the standard +user is part of that group by default anyway +--- + CMakeLists.txt | 4 ++++ + udev/90-hdmi-cec.rules | 2 ++ + 2 files changed, 6 insertions(+) + create mode 100644 udev/90-hdmi-cec.rules + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index abd42db2..42c8a52e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -44,3 +44,7 @@ if(WIN32) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/dotnet/src/CecSharpTester/netfx/Properties/AssemblyInfo.cs.in + ${CMAKE_CURRENT_SOURCE_DIR}/src/dotnet/src/CecSharpTester/netfx/Properties/AssemblyInfo.cs) + endif() ++ ++if(UNIX AND NOT APPLE) ++ install(FILES udev/90-hdmi-cec.rules DESTINATION ${CMAKE_INSTALL_LIBDIR}/udev/rules.d) ++endif() +diff --git a/udev/90-hdmi-cec.rules b/udev/90-hdmi-cec.rules +new file mode 100644 +index 00000000..08cb14a1 +--- /dev/null ++++ b/udev/90-hdmi-cec.rules +@@ -0,0 +1,2 @@ ++# Pulse-Eight CEC adapter ++KERNEL=="ttyACM[0-9]*", SUBSYSTEM=="tty", ATTRS{idVendor}=="2548", ATTRS{idProduct}=="1002", GROUP="input" |