瀏覽代碼

base-files/hotplug: fix dedicated group for tty devices

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 <[email protected]>
Acked-by: Jo-Philipp Wich <[email protected]>
Michael Heimpold 6 年之前
父節點
當前提交
6e060bd62c
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 1 1
      package/base-files/files/etc/group
  2. 4 0
      package/system/procd/files/hotplug.json

+ 1 - 1
package/base-files/files/etc/group

@@ -1,8 +1,8 @@
 root:x:0:
 root:x:0:
 daemon:x:1:
 daemon:x:1:
 adm:x:4:
 adm:x:4:
-tty:x:5:
 mail:x:8:
 mail:x:8:
+dialout:x:20:
 audio:x:29:
 audio:x:29:
 www-data:x:33:
 www-data:x:33:
 ftp:x:55:
 ftp:x:55:

+ 4 - 0
package/system/procd/files/hotplug.json

@@ -20,6 +20,10 @@
 						[ "regex", "DEVNAME", "^snd" ],
 						[ "regex", "DEVNAME", "^snd" ],
 						[ "makedev", "/dev/%DEVNAME%", "0660", "audio" ]
 						[ "makedev", "/dev/%DEVNAME%", "0660", "audio" ]
 					],
 					],
+					[ "if",
+						[ "regex", "DEVNAME", "^tty" ],
+						[ "makedev", "/dev/%DEVNAME%", "0660", "dialout" ]
+					],
 					[ "if",
 					[ "if",
 						[ "has", "DEVNAME" ],
 						[ "has", "DEVNAME" ],
 						[ "makedev", "/dev/%DEVNAME%", "0600" ]
 						[ "makedev", "/dev/%DEVNAME%", "0600" ]