luci-base: sys.uc: increase init script START/STOP search space
authorJo-Philipp Wich <[email protected]>
Mon, 26 Sep 2022 08:50:40 +0000 (10:50 +0200)
committerJo-Philipp Wich <[email protected]>
Mon, 24 Oct 2022 23:03:37 +0000 (01:03 +0200)
Some init scripts, such as the sysfsutils one, declare their START or
STOP variables very late in the file. Duplicate the search buffer to
2048 byte in order to catch these cases.

Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-base/ucode/sys.uc

index d4db91a9b957b1729f7cce464bef5ea57ecaae3c..5bbaa8b19dca0f6ed34dd41554a2ed0a0052e3c0 100644 (file)
@@ -121,7 +121,7 @@ export function init_list() {
 };
 
 export function init_index(name) {
-       const src = readfile(`/etc/init.d/${basename(name)}`, 1024);
+       const src = readfile(`/etc/init.d/${basename(name)}`, 2048);
        const idx = [];
 
        for (let m in match(src, /^[[:space:]]*(START|STOP)=('[0-9][0-9]'|"[0-9][0-9]"|[0-9][0-9])[[:space:]]*$/gs)) {