mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-21 13:27:36 +00:00
The podman module paths are moving from github.com/containers/podman to go.podman.io/podman. This will help with future mobility. Signed-off-by: Brent Baude <bbaude@redhat.com>
22 lines
497 B
Go
22 lines
497 B
Go
//go:build linux || aix || android || darwin || dragonfly || freebsd || hurd || illumos || ios || netbsd || openbsd || solaris
|
|
|
|
package machine
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
"go.podman.io/podman/v6/pkg/rootless"
|
|
)
|
|
|
|
func isUnixSocket(file os.DirEntry) bool {
|
|
return file.Type()&os.ModeSocket != 0
|
|
}
|
|
|
|
func rootlessOnly(cmd *cobra.Command, _ []string) error {
|
|
if !rootless.IsRootless() {
|
|
return fmt.Errorf("cannot run command %q as root", cmd.CommandPath())
|
|
}
|
|
return nil
|
|
}
|