mirror of
https://github.com/containers/podman.git
synced 2026-03-21 08:03:50 -04:00
cmd: drop check for euid==0
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@@ -78,7 +78,7 @@ func podCreateCmd(c *cliconfig.PodCreateValues) error {
|
||||
if !c.Infra && c.Flag("share").Changed && c.Share != "none" && c.Share != "" {
|
||||
return errors.Errorf("You cannot share kernel namespaces on the pod level without an infra container")
|
||||
}
|
||||
if c.Flag("pod-id-file").Changed && os.Geteuid() == 0 {
|
||||
if c.Flag("pod-id-file").Changed {
|
||||
podIdFile, err = util.OpenExclusiveFile(c.PodIDFile)
|
||||
if err != nil && os.IsExist(err) {
|
||||
return errors.Errorf("pod id file exists. Ensure another pod is not using it or delete %s", c.PodIDFile)
|
||||
|
||||
@@ -55,7 +55,7 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod.
|
||||
rootfs = c.InputArgs[0]
|
||||
}
|
||||
|
||||
if c.IsSet("cidfile") && os.Geteuid() == 0 {
|
||||
if c.IsSet("cidfile") {
|
||||
cidFile, err = util.OpenExclusiveFile(c.String("cidfile"))
|
||||
if err != nil && os.IsExist(err) {
|
||||
return nil, nil, errors.Errorf("container id file exists. Ensure another container is not using it or delete %s", c.String("cidfile"))
|
||||
@@ -70,8 +70,8 @@ func CreateContainer(ctx context.Context, c *GenericCLIResults, runtime *libpod.
|
||||
imageName := ""
|
||||
var data *inspect.ImageData = nil
|
||||
|
||||
// Set the storage if we are running as euid == 0 and there is no rootfs specified
|
||||
if rootfs == "" && os.Geteuid() == 0 {
|
||||
// Set the storage if there is no rootfs specified
|
||||
if rootfs == "" {
|
||||
var writer io.Writer
|
||||
if !c.Bool("quiet") {
|
||||
writer = os.Stderr
|
||||
|
||||
Reference in New Issue
Block a user