Merge pull request #1157 from giuseppe/look-uid-instead-of-rootless
config: look user id instead of rootless
This commit is contained in:
commit
5b5dc24ac6
|
|
@ -23,7 +23,7 @@ func customConfigFile() (string, error) {
|
|||
if path, found := os.LookupEnv("CONTAINERS_CONF"); found {
|
||||
return path, nil
|
||||
}
|
||||
if unshare.IsRootless() {
|
||||
if unshare.GetRootlessUID() > 0 {
|
||||
path, err := rootlessConfigPath()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
@ -34,7 +34,7 @@ func customConfigFile() (string, error) {
|
|||
}
|
||||
|
||||
func ifRootlessConfigPath() (string, error) {
|
||||
if unshare.IsRootless() {
|
||||
if unshare.GetRootlessUID() > 0 {
|
||||
path, err := rootlessConfigPath()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ func DefaultConfig() (*Config, error) {
|
|||
}
|
||||
|
||||
defaultEngineConfig.SignaturePolicyPath = DefaultSignaturePolicyPath
|
||||
if unshare.IsRootless() {
|
||||
if unshare.GetRootlessUID() > 0 {
|
||||
configHome, err := homedir.GetConfigHome()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -289,7 +289,7 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
storeOpts, err := types.DefaultStoreOptions(unshare.IsRootless(), unshare.GetRootlessUID())
|
||||
storeOpts, err := types.DefaultStoreOptions(unshare.GetRootlessUID() > 0, unshare.GetRootlessUID())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -427,7 +427,7 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
|
|||
}
|
||||
|
||||
func defaultTmpDir() (string, error) {
|
||||
if !unshare.IsRootless() {
|
||||
if unshare.GetRootlessUID() != 0 {
|
||||
return getLibpodTmpDir(), nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue