Skip to content

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

@remindA

Description

@remindA

Is there an existing issue for this?

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions