luci icon indicating copy to clipboard operation
luci copied to clipboard

modules/luci-lua-runtime/luasrc/dispatcher.lua: process_lua_controller() fs.stat() should be luci.fs.stat()

Open remindA opened this issue 3 months ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched among all existing issues (including closed issues)

screenshots or captures

Image

Actual behaviour

in file: modules/luci-lua-runtime/luasrc/dispatcher.lua in function: process_lua_controller(path)

if type(entry.file_depends) == "table" then for _, v in ipairs(entry.file_depends) do entry.depends = entry.depends or {} entry.depends.fs = entry.depends.fs or {}

			local ft = fs.stat(v, "type")
			if ft == "dir" then

'fs.stat' should be fixed as 'luci.fs.stat'

Expected behaviour

in file: modules/luci-lua-runtime/luasrc/dispatcher.lua in function: process_lua_controller(path)

if type(entry.file_depends) == "table" then for _, v in ipairs(entry.file_depends) do entry.depends = entry.depends or {} entry.depends.fs = entry.depends.fs or {}

			local ft = fs.stat(v, "type")
			if ft == "dir" then

'fs.stat' should be fixed as 'luci.fs.stat'

Steps to reproduce

  1. create /usr/lib/lua/luci/controller/test.lua
Image 2. entry with file_depends attr, will trigger this bug

Additional Information

{
        "kernel": "6.6.110",
        "hostname": "SH_convacs_backend",
        "system": "Intel(R) N100",
        "model": "Default string Default string",
        "board_name": "default-string-default-string",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "24.10.4",
                "revision": "V1.x-SH_convacs_backend",
                "target": "x86/64",
                "description": "OpenWrt 24.10.4 r28959-29397011cc",
                "builddate": "1760891865"
        }
}

What browsers do you see the problem on?

No response

Relevant log output


remindA avatar Dec 11 '25 10:12 remindA

Use JS - lua is deprecated and will be removed.

systemcrash avatar Dec 11 '25 14:12 systemcrash