[OpenWrt-Devel] [PATCH v2] base-files/hotplug: fix dedicated group for tty devices

Michael Heimpold mhei at heimpold.de
Tue Apr 2 15:48:11 EDT 2019


Commit 124ab1dc0a and 5523ee3459 introduced the assignment of the
group "tty" to /dev/tty* devices in order to support unprivileged
user access to serial devices.

However, due to an improperly rebased commit this feature broke.

This patch restores the lost hunk in hotplug.json file to
re-introduce this feature and also renames the existing "tty" group
to "dialout" as this is the more typical name for such a group
on desktop systems.

Fixes: 5209cfa534 ("procd: fix hotplug.json syntax")
Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---

@jow: I was not sure whether I should keep the group id 5 for dialout,
so I just compared the other group ids with my Debian system and found
that they are all equal. So I just decided to keep the 20 for dialout
to also match the Debian scheme. Please advice if you think we should
stay with 5 to not break any existing stuff?

 package/base-files/files/etc/group      | 2 +-
 package/system/procd/files/hotplug.json | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/group b/package/base-files/files/etc/group
index e8e2adf4ac..5b06dc6db9 100644
--- a/package/base-files/files/etc/group
+++ b/package/base-files/files/etc/group
@@ -1,8 +1,8 @@
 root:x:0:
 daemon:x:1:
 adm:x:4:
-tty:x:5:
 mail:x:8:
+dialout:x:20:
 audio:x:29:
 www-data:x:33:
 ftp:x:55:
diff --git a/package/system/procd/files/hotplug.json b/package/system/procd/files/hotplug.json
index 1c949bbea3..f676bac79e 100644
--- a/package/system/procd/files/hotplug.json
+++ b/package/system/procd/files/hotplug.json
@@ -20,6 +20,10 @@
 						[ "regex", "DEVNAME", "^snd" ],
 						[ "makedev", "/dev/%DEVNAME%", "0660", "audio" ]
 					],
+					[ "if",
+						[ "regex", "DEVNAME", "^tty" ],
+						[ "makedev", "/dev/%DEVNAME%", "0660", "dialout" ]
+					],
 					[ "if",
 						[ "has", "DEVNAME" ],
 						[ "makedev", "/dev/%DEVNAME%", "0600" ]
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list