An easier way to remove args[0]

This commit is contained in:
Frank Denis 2018-07-01 22:48:50 +02:00
parent cc327fdc48
commit f9b6994fd2
1 changed files with 1 additions and 4 deletions

View File

@ -37,10 +37,7 @@ func (proxy *Proxy) dropPrivilege(userStr string, fds []*os.File) {
dlog.Fatal(err)
}
// remove arg[0]
copy(args[0:], args[0+1:])
args[len(args)-1] = ""
args = args[:len(args)-1]
args = args[1:]
args = append(args, "-child")
cmd := exec.Command(path, args...)