diff options
author | Jan Pavlinec <jan.pavlinec@nic.cz> | 2021-03-12 16:24:52 +0100 |
---|---|---|
committer | Jan Pavlinec <jan.pavlinec@nic.cz> | 2021-04-30 13:46:50 +0200 |
commit | be8d749599a11229435141d85cfe5eba2dcf96d2 (patch) | |
tree | ab29a9f9dc5c128c0c9594d1c2e42567b2f02950 | |
parent | 9184721fab65934fe016c132a8f11a2308742f92 (diff) |
luci-base: send failed/successfull login to syslog
Note: This change is relevant for systems that don't
use uhttpd for LuCI.
This log can be later used for fail2ban etc.
Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
-rw-r--r-- | modules/luci-base/luasrc/dispatcher.lua | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index 44c17c85f8..2f965b16a8 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -563,15 +563,13 @@ local function session_setup(user, pass) ubus_rpc_session = login.ubus_rpc_session, values = { token = sys.uniqueid(16) } }) - - io.stderr:write("luci: accepted login on /%s for %s from %s\n" - %{ rp, user or "?", http.getenv("REMOTE_ADDR") or "?" }) + nixio.syslog("info", tostring("luci: accepted login on /%s for %s from %s\n" + %{ rp, user or "?", http.getenv("REMOTE_ADDR") or "?" })) return session_retrieve(login.ubus_rpc_session) end - - io.stderr:write("luci: failed login on /%s for %s from %s\n" - %{ rp, user or "?", http.getenv("REMOTE_ADDR") or "?" }) + nixio.syslog("info", tostring("luci: failed login on /%s for %s from %s\n" + %{ rp, user or "?", http.getenv("REMOTE_ADDR") or "?" })) end local function check_authentication(method) |