mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-25 17:10:28 +00:00
17 lines
315 B
Go
17 lines
315 B
Go
//go:build !windows
|
|
// +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
|
|
}
|