Skip to content

Commit 57d7ea1

Browse files
committed
do not set default auth file path when creating a new config struct
1 parent aa1749a commit 57d7ea1

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

config/config.go

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ type Config struct {
7171
func GetDefaultConfig() *Config {
7272
return &Config{
7373
AuthenticationScheme: AuthenticationSchemeDefault,
74-
AuthenticationFile: GetDefaultPasswordFilePath(),
7574
ClientServerNegotiation: ClientServerNegotiationDefault,
7675
ClientServerPolicy: ClientServerPolicyDefault,
7776
Port: PortDefault,

config/icommands.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,9 @@ func (manager *ICommandsEnvironmentManager) SetEnvironmentFilePath(envFilePath s
150150

151151
manager.EnvironmentDirPath = filepath.Dir(envFilePath)
152152
manager.EnvironmentFilePath = envFilePath
153+
manager.SessionFilePath = fmt.Sprintf("%s.%d", manager.EnvironmentFilePath, manager.PPID)
153154
manager.PasswordFilePath = filepath.Join(manager.EnvironmentDirPath, passwordFilenameDefault)
154155

155-
sessionFilePath := fmt.Sprintf("%s.%d", manager.EnvironmentFilePath, manager.PPID)
156-
manager.SessionFilePath = sessionFilePath
157-
158156
manager.Environment.AuthenticationFile = manager.PasswordFilePath
159157
return nil
160158
}
@@ -168,11 +166,9 @@ func (manager *ICommandsEnvironmentManager) SetEnvironmentDirPath(envDirPath str
168166

169167
manager.EnvironmentDirPath = envDirPath
170168
manager.EnvironmentFilePath = filepath.Join(envDirPath, environmentFilenameDefault)
169+
manager.SessionFilePath = fmt.Sprintf("%s.%d", manager.EnvironmentFilePath, manager.PPID)
171170
manager.PasswordFilePath = filepath.Join(manager.EnvironmentDirPath, passwordFilenameDefault)
172171

173-
sessionFilePath := fmt.Sprintf("%s.%d", manager.EnvironmentFilePath, manager.PPID)
174-
manager.SessionFilePath = sessionFilePath
175-
176172
manager.Environment.AuthenticationFile = manager.PasswordFilePath
177173
return nil
178174
}

irods/util/path.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func ExpandHomeDir(path string) (string, error) {
7070
}
7171

7272
if path[0] != '~' {
73-
return path, nil
73+
return filepath.Abs(path)
7474
}
7575

7676
homedir, err := os.UserHomeDir()
@@ -80,16 +80,16 @@ func ExpandHomeDir(path string) (string, error) {
8080

8181
// resolve "~"
8282
if len(path) == 1 {
83-
return homedir, nil
83+
return filepath.Abs(homedir)
8484
}
8585

8686
// resolve "~/"
8787
if path[1] == '/' {
8888
path = filepath.Join(homedir, path[2:])
89-
return filepath.Clean(path), nil
89+
return filepath.Abs(path)
9090
}
9191

92-
return path, nil
92+
return filepath.Abs(path)
9393
}
9494

9595
// ExistFile checks if file exists

0 commit comments

Comments
 (0)