Skip to content

Commit af46b1b

Browse files
committed
Log that a sudo action has occurred
Signed-off-by: Andrew Thornton <[email protected]>
1 parent d245164 commit af46b1b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

routers/api/v1/api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ import (
6262
"code.gitea.io/gitea/models"
6363
"code.gitea.io/gitea/modules/auth"
6464
"code.gitea.io/gitea/modules/context"
65+
"code.gitea.io/gitea/modules/log"
6566
"code.gitea.io/gitea/modules/setting"
6667
"code.gitea.io/gitea/routers/api/v1/admin"
6768
"code.gitea.io/gitea/routers/api/v1/misc"
@@ -94,6 +95,7 @@ func sudo() macaron.Handler {
9495
}
9596
return
9697
}
98+
log.Trace("Sudo from (%s) to: %s", ctx.User.Name, user.Name)
9799
ctx.User = user
98100
} else {
99101
ctx.JSON(403, map[string]string{

0 commit comments

Comments
 (0)