diff --git a/internal/locker/runtime_darwin.go b/internal/locker/runtime_darwin.go index 6a46fba88..127a5fb04 100644 --- a/internal/locker/runtime_darwin.go +++ b/internal/locker/runtime_darwin.go @@ -21,6 +21,10 @@ import ( "path/filepath" ) +// Based on https://github.com/adrg/xdg +// Licensed under MIT License (MIT) +// Copyright (c) 2014 Adrian-George Bostan + func osDependentRunDir() (string, error) { home, err := os.UserHomeDir() if err != nil { diff --git a/internal/locker/runtime_unix.go b/internal/locker/runtime_unix.go index f0a92e974..32ee50125 100644 --- a/internal/locker/runtime_unix.go +++ b/internal/locker/runtime_unix.go @@ -24,10 +24,14 @@ import ( "strconv" ) +// Based on https://github.com/adrg/xdg +// Licensed under MIT License (MIT) +// Copyright (c) 2014 Adrian-George Bostan + func osDependentRunDir() (string, error) { run := filepath.Join("run", "user", strconv.Itoa(os.Getuid())) if _, err := os.Stat(run); err == nil { - return run + return run, nil } // /run/user/$uid is set by pam_systemd, but might not be present, especially in containerized environments diff --git a/internal/locker/runtime_windows.go b/internal/locker/runtime_windows.go index 6db76518f..4d4451b61 100644 --- a/internal/locker/runtime_windows.go +++ b/internal/locker/runtime_windows.go @@ -23,6 +23,10 @@ import ( "golang.org/x/sys/windows" ) +// Based on https://github.com/adrg/xdg +// Licensed under MIT License (MIT) +// Copyright (c) 2014 Adrian-George Bostan + func osDependentRunDir() (string, error) { flags := []uint32{windows.KF_FLAG_DEFAULT, windows.KF_FLAG_DEFAULT_PATH} for _, flag := range flags { diff --git a/pkg/remote/cache_darwin.go b/pkg/remote/cache_darwin.go index 59f5589ae..7830e8ade 100644 --- a/pkg/remote/cache_darwin.go +++ b/pkg/remote/cache_darwin.go @@ -21,6 +21,10 @@ import ( "path/filepath" ) +// Based on https://github.com/adrg/xdg +// Licensed under MIT License (MIT) +// Copyright (c) 2014 Adrian-George Bostan + func osDependentCacheDir() (string, error) { home, err := os.UserHomeDir() if err != nil { diff --git a/pkg/remote/cache_unix.go b/pkg/remote/cache_unix.go index bf9a95479..4349f30db 100644 --- a/pkg/remote/cache_unix.go +++ b/pkg/remote/cache_unix.go @@ -23,6 +23,10 @@ import ( "path/filepath" ) +// Based on https://github.com/adrg/xdg +// Licensed under MIT License (MIT) +// Copyright (c) 2014 Adrian-George Bostan + func osDependentCacheDir() (string, error) { home, err := os.UserHomeDir() if err != nil { diff --git a/pkg/remote/cache_windows.go b/pkg/remote/cache_windows.go index 767d83a5c..5bc7a2f1d 100644 --- a/pkg/remote/cache_windows.go +++ b/pkg/remote/cache_windows.go @@ -23,6 +23,10 @@ import ( "golang.org/x/sys/windows" ) +// Based on https://github.com/adrg/xdg +// Licensed under MIT License (MIT) +// Copyright (c) 2014 Adrian-George Bostan + func osDependentCacheDir() (string, error) { flags := []uint32{windows.KF_FLAG_DEFAULT, windows.KF_FLAG_DEFAULT_PATH} for _, flag := range flags {