commit b0cffd15344a9df8d47a23351580b2c130ad06dd
parent 4f8338466caad52c298c3093d1b57c9dca97cd4d
Author: St John Karp <contact@stjo.hn>
Date: Fri, 10 Jun 2022 12:08:21 -0400
smdev: Manually set permissions on bus/usb nodes
I couldn't figure out how to get smdev to set the owner/permissions
on nodes that get created in bus/usb/[0-9]+/[0-9]+. It's possible
it doesn't support this, even though mdev has this sort of regex
matching with folder depth, e.g.:
$DEVNAME=bus/usb/([0-9]+)/([0-9]+) root:plugdev 0660 =bus/usb/%1/%2
Instead I've put in a terrible hack to just run a command on these
nodes when they appear and set permissions with chmod/chgrp.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/core/smdev/build b/core/smdev/build
@@ -6,6 +6,7 @@ sed 's/\/usr\/local/\/usr/' config.mk > _
mv _ config.mk
sed -e '/fuse/a \\t{ "hidraw[0-9]", "root", "plugdev", 0660, NULL, NULL },' \
-e '/fuse/a \\t{ "hiddev[0-9]", "root", "plugdev", 0660, NULL, NULL },' \
+ -e '/fuse/a \\t{ "bus/usb/[0-9]+/[0-9]+", "root", "plugdev", 0660, NULL, "@chgrp plugdev /dev/bus/usb/*/* && chmod 660 /dev/bus/usb/*/*" },' \
-e 's/"tty\[0-9\]", "root", "root", 0600,/"tty\[0-9\]", "root", "tty", 0660,/' \
-e 's/"input\/\.\*", "root", "root", 0640,/"input\/\.\*", "root", "input", 0660,/' \
config.def.h > _