luci-proto-modemmanager: fix acl regex to support more then 9 modem objects
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 3 Feb 2023 08:56:00 +0000 (09:56 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 15 Mar 2023 23:05:18 +0000 (00:05 +0100)
If a modem is restarted often, the modem manager object number is
increased by one. Currently, the regex is set so that the modem can no
longer be selected if the object number is greater than 9. This change
fixes that.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
[replace wildcard with rule duplication to disallow option injection]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
protocols/luci-proto-modemmanager/root/usr/share/rpcd/acl.d/luci-proto-modemmanager.json

index 716f4c465515d5b4d994fcc1540a6ccf99b844b3..e3d5df7bec0665f1e0d40f15efa95456e1553a0a 100644 (file)
@@ -5,7 +5,9 @@
                        "cgi-io": [ "exec" ],
                        "file": {
                                "/usr/bin/mmcli -L": [ "exec" ],
-                               "/usr/bin/mmcli -m [0-9]": [ "exec" ]
+                               "/usr/bin/mmcli -m [0-9]": [ "exec" ],
+                               "/usr/bin/mmcli -m [0-9][0-9]": [ "exec" ],
+                               "/usr/bin/mmcli -m [0-9][0-9][0-9]": [ "exec" ]
                        }
                }
        }