@@ -180,7 +180,7 @@ func DefaultConfig() (*Config, error) {
180
180
}
181
181
182
182
defaultEngineConfig .SignaturePolicyPath = DefaultSignaturePolicyPath
183
- if unshare . GetRootlessUID () > 0 {
183
+ if useUserConfigLocations () {
184
184
configHome , err := homedir .GetConfigHome ()
185
185
if err != nil {
186
186
return nil , err
@@ -289,7 +289,7 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
289
289
return nil , err
290
290
}
291
291
}
292
- storeOpts , err := types .DefaultStoreOptions (unshare . GetRootlessUID () > 0 , unshare .GetRootlessUID ())
292
+ storeOpts , err := types .DefaultStoreOptions (useUserConfigLocations () , unshare .GetRootlessUID ())
293
293
if err != nil {
294
294
return nil , err
295
295
}
@@ -427,7 +427,7 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
427
427
}
428
428
429
429
func defaultTmpDir () (string , error ) {
430
- if unshare . GetRootlessUID () == 0 {
430
+ if ! useUserConfigLocations () {
431
431
return getLibpodTmpDir (), nil
432
432
}
433
433
@@ -679,3 +679,10 @@ func getDefaultSSHConfig() string {
679
679
dirname := homedir .Get ()
680
680
return filepath .Join (dirname , ".ssh" , "config" )
681
681
}
682
+
683
+ func useUserConfigLocations () bool {
684
+ // NOTE: For now we want Windows to use system locations.
685
+ // GetRootlessUID == -1 on Windows, so exclude negative range
686
+ return unshare .GetRootlessUID () > 0
687
+ }
688
+
0 commit comments