From af46b1b82d687c39d3a6f7cb09998c4f3c06237e Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Thu, 30 Aug 2018 11:24:30 +0100 Subject: [PATCH] Log that a sudo action has occurred Signed-off-by: Andrew Thornton --- routers/api/v1/api.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index bd670c8c0a593..967db3b01c4a3 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -62,6 +62,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth" "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/routers/api/v1/admin" "code.gitea.io/gitea/routers/api/v1/misc" @@ -94,6 +95,7 @@ func sudo() macaron.Handler { } return } + log.Trace("Sudo from (%s) to: %s", ctx.User.Name, user.Name) ctx.User = user } else { ctx.JSON(403, map[string]string{