mirror of
https://github.com/adnanh/webhook.git
synced 2025-06-17 10:02:30 +00:00
add run-as to run hook in other user context
This commit is contained in:
parent
f187592147
commit
af3ceffdac
5 changed files with 47 additions and 0 deletions
|
@ -575,6 +575,9 @@ func handleHook(h *hook.Hook, r *hook.Request) (string, error) {
|
|||
}
|
||||
|
||||
cmd := exec.Command(cmdPath)
|
||||
if h.RunAs != "" {
|
||||
setUser(cmd, h.RunAs)
|
||||
}
|
||||
cmd.Dir = h.CommandWorkingDirectory
|
||||
|
||||
cmd.Args, errors = h.ExtractCommandArguments(r)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue