Skip to content

Commit 1ed9fb5

Browse files
author
Luxy.c
authored
runcode: Add console logging for unauthorized HTTP users (#185)
1 parent aeed683 commit 1ed9fb5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

[admin]/runcode/server.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,15 @@ addCommandHandler("crun",
7979
-- http interface run export
8080
function httpRun(commandstring)
8181
if not user then outputDebugString ( "httpRun can only be called via http", 2 ) return end
82-
82+
8383
-- check acl permission
8484
local objectName = "user." .. getAccountName(user)
85-
85+
8686
if(not hasObjectPermissionTo(objectName, "command.srun", false)) then
87+
outputServerLog(getAccountName(user) .. " from " .. hostname .. " attempted to execute Lua code with missing acl permission (command.srun)")
8788
return "Error: Permission denied"
8889
end
89-
90+
9091
local notReturned
9192
--First we test with return
9293
local commandFunction,errorMsg = loadstring("return "..commandstring)

0 commit comments

Comments
 (0)