mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
Fix windows config/socket dir location
RMM uses non-user account which results in config + socket file being written to a random directory, which is not a real directory that can be accessed. Fix this by using directory of ctrld binary as user home dir.
This commit is contained in:
committed by
Cuong Manh Le
parent
34758f6205
commit
c58516cfb0
+7
-1
@@ -1309,7 +1309,13 @@ func userHomeDir() (string, error) {
|
|||||||
}
|
}
|
||||||
// viper will expand for us.
|
// viper will expand for us.
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
return os.UserHomeDir()
|
// If we're on windows, use the install path for this.
|
||||||
|
exePath, err := os.Executable()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return filepath.Dir(exePath), nil
|
||||||
}
|
}
|
||||||
// Mobile platform should provide a rw dir path for this.
|
// Mobile platform should provide a rw dir path for this.
|
||||||
if isMobile() {
|
if isMobile() {
|
||||||
|
|||||||
Reference in New Issue
Block a user