mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-22 15:40:23 +00:00
17 lines
295 B
Go
17 lines
295 B
Go
|
// +build !windows
|
||
|
|
||
|
package sftpd
|
||
|
|
||
|
import (
|
||
|
"os/exec"
|
||
|
"syscall"
|
||
|
)
|
||
|
|
||
|
func wrapCmd(cmd *exec.Cmd, uid, gid int) *exec.Cmd {
|
||
|
if uid > 0 || gid > 0 {
|
||
|
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||
|
cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uint32(uid), Gid: uint32(gid)}
|
||
|
}
|
||
|
return cmd
|
||
|
}
|