mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Report correct RemoteURI
Rather than assuming a filesystem path, the API service URI is recorded in the libpod runtime configuration and then reported as requested. Note: All schemes other than "unix" are hard-coded to report URI exists. Fixes #12023 Signed-off-by: Jhon Honce <jhonce@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -731,29 +731,6 @@ func IDtoolsToRuntimeSpec(idMaps []idtools.IDMap) (convertedIDMap []specs.LinuxI
|
||||
return convertedIDMap
|
||||
}
|
||||
|
||||
var socketPath string
|
||||
|
||||
func SetSocketPath(path string) {
|
||||
socketPath = path
|
||||
}
|
||||
|
||||
func SocketPath() (string, error) {
|
||||
if socketPath != "" {
|
||||
return socketPath, nil
|
||||
}
|
||||
xdg, err := GetRuntimeDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(xdg) == 0 {
|
||||
// If no xdg is returned, assume root socket
|
||||
xdg = "/run"
|
||||
}
|
||||
|
||||
// Glue the socket path together
|
||||
return filepath.Join(xdg, "podman", "podman.sock"), nil
|
||||
}
|
||||
|
||||
func LookupUser(name string) (*user.User, error) {
|
||||
// Assume UID look up first, if it fails lookup by username
|
||||
if u, err := user.LookupId(name); err == nil {
|
||||
|
Reference in New Issue
Block a user