diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-09-09 11:09:18 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-09-10 15:29:15 +0200 |
commit | 5dc61be74636c9c643f83ed146545db07c3b20cd (patch) | |
tree | 5c11cef148322e9ec56be897de13d28b382d0267 /modules/luci-base/root/usr | |
parent | 9cae3b9e67aef68cd579213bee1865ce1b815027 (diff) |
luci-base: replace luci/getHostname with generic file/read rpc operation
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/root/usr')
-rwxr-xr-x | modules/luci-base/root/usr/libexec/rpcd/luci | 11 | ||||
-rw-r--r-- | modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json | 7 |
2 files changed, 4 insertions, 14 deletions
diff --git a/modules/luci-base/root/usr/libexec/rpcd/luci b/modules/luci-base/root/usr/libexec/rpcd/luci index b8243b8272..850b159acf 100755 --- a/modules/luci-base/root/usr/libexec/rpcd/luci +++ b/modules/luci-base/root/usr/libexec/rpcd/luci @@ -468,17 +468,6 @@ local methods = { return rv end - }, - - getHostname = { - call = function() - local fs = require "nixio.fs" - local hostname, code, err = fs.readfile("/proc/sys/kernel/hostname") - if err then - return { error = err }, 1 - end - return { result = hostname:gsub("\n$", "") } - end } } diff --git a/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json b/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json index 417296a394..1952a7c3ae 100644 --- a/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json +++ b/modules/luci-base/root/usr/share/rpcd/acl.d/luci-base.json @@ -22,12 +22,13 @@ "read": { "file": { "/": [ "list" ], - "/*": [ "list" ] + "/*": [ "list" ], + "/proc/sys/kernel/hostname": [ "read" ] }, "ubus": { - "file": [ "list", "stat" ], + "file": [ "list", "read", "stat" ], "iwinfo": [ "assoclist", "freqlist", "txpowerlist", "countrylist" ], - "luci": [ "getBoardJSON", "getDUIDHints", "getHostHints", "getIfaddrs", "getInitList", "getLocaltime", "getTimezones", "getDHCPLeases", "getLEDs", "getNetworkDevices", "getUSBDevices", "getHostname", "getWirelessDevices" ], + "luci": [ "getBoardJSON", "getDUIDHints", "getHostHints", "getIfaddrs", "getInitList", "getLocaltime", "getTimezones", "getDHCPLeases", "getLEDs", "getNetworkDevices", "getUSBDevices", "getWirelessDevices" ], "network.device": [ "status" ], "network.interface": [ "dump" ], "network": [ "get_proto_handlers" ], |