Eval symlinks on XDG_RUNTIME_DIR

Partial Fix for https://github.com/containers/podman/issues/14606

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2022-09-23 13:49:44 -04:00
parent f21847917e
commit 71f0c9f33a
5 changed files with 37 additions and 2 deletions

View File

@ -129,7 +129,11 @@ func dbusAuthRootlessConnection(createBus func(opts ...godbus.ConnOption) (*godb
func newRootlessConnection() (*dbus.Conn, error) {
return dbus.NewConnection(func() (*godbus.Conn, error) {
return dbusAuthRootlessConnection(func(opts ...godbus.ConnOption) (*godbus.Conn, error) {
path := filepath.Join(os.Getenv("XDG_RUNTIME_DIR"), "systemd/private")
path := filepath.Join(os.Getenv("XDG_RUNTIME_DIR"), "systemd", "private")
path, err := filepath.EvalSymlinks(path)
if err != nil {
return nil, err
}
return godbus.Dial(fmt.Sprintf("unix:path=%s", path))
})
})