mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
shared/subprocess: Don't use internal packages
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
parent
63afa662ad
commit
b81af5098b
@ -4,19 +4,17 @@ package subprocess
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"github.com/lxc/incus/internal/idmap"
|
||||
)
|
||||
|
||||
// SetUserns allows running inside of a user namespace.
|
||||
func (p *Process) SetUserns(userns *idmap.IdmapSet) {
|
||||
func (p *Process) SetUserns(uidMap []syscall.SysProcIDMap, gidMap []syscall.SysProcIDMap) {
|
||||
p.SysProcAttr = &syscall.SysProcAttr{
|
||||
Cloneflags: syscall.CLONE_NEWUSER,
|
||||
Credential: &syscall.Credential{
|
||||
Uid: uint32(0),
|
||||
Gid: uint32(0),
|
||||
},
|
||||
UidMappings: userns.ToUidMappings(),
|
||||
GidMappings: userns.ToGidMappings(),
|
||||
UidMappings: uidMap,
|
||||
GidMappings: gidMap,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
//go:build (!linux || !cgo) && !windows
|
||||
|
||||
package subprocess
|
||||
|
||||
import (
|
||||
"github.com/lxc/incus/internal/idmap"
|
||||
)
|
||||
|
||||
// SetUserns allows running inside of a user namespace.
|
||||
func (p *Process) SetUserns(userns *idmap.IdmapSet) {
|
||||
return
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user