Files
podman/pkg/rootless/rootless_unsupported.go
Giuseppe Scrivano 1789242933 rootless: add new function to join existing namespace
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1371
Approved by: rhatdan
2018-08-29 16:25:20 +00:00

46 lines
1.2 KiB
Go

// +build !linux
package rootless
import (
"os"
"github.com/pkg/errors"
)
// IsRootless returns false on all non-linux platforms
func IsRootless() bool {
return false
}
// BecomeRootInUserNS is a stub function that always returns false and an
// error on unsupported OS's
func BecomeRootInUserNS() (bool, int, error) {
return false, -1, errors.New("this function is not supported on this os")
}
// GetRootlessUID returns the UID of the user in the parent userNS
func GetRootlessUID() int {
return -1
}
// SetSkipStorageSetup tells the runtime to not setup containers/storage
func SetSkipStorageSetup(bool) {
}
// SkipStorageSetup tells if we should skip the containers/storage setup
func SkipStorageSetup() bool {
return false
}
// JoinNS re-exec podman in a new userNS and join the user namespace of the specified
// PID.
func JoinNS(pid uint) (bool, int, error) {
return false, -1, errors.New("this function is not supported on this os")
}
// GetUserNSForPid returns an open FD for the first direct child user namespace that created the process
func GetUserNSForPid(pid uint) (*os.File, error) {
return nil, errors.New("this function is not supported on this os")
}