mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Revert "resolve the config file from the sudo user"
This reverts commit afde6450ee.
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
da4f2ce629
commit
863b571617
4 changed files with 3 additions and 30 deletions
|
|
@ -29,19 +29,6 @@ func Get() string {
|
|||
return home
|
||||
}
|
||||
|
||||
// GetWithSudoUser returns the home directory of the user who called sudo (if
|
||||
// available, retrieved from $SUDO_USER). It fallbacks to Get if any error occurs.
|
||||
// Returned path should be used with "path/filepath" to form new paths.
|
||||
func GetWithSudoUser() string {
|
||||
sudoUser := os.Getenv("SUDO_USER")
|
||||
if sudoUser != "" {
|
||||
if user, err := user.LookupUser(sudoUser); err == nil {
|
||||
return user.Home
|
||||
}
|
||||
}
|
||||
return Get()
|
||||
}
|
||||
|
||||
// GetShortcutString returns the string that is shortcut to user's home directory
|
||||
// in the native shell of the platform running on.
|
||||
func GetShortcutString() string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue