Correctly test for config file

This commit is contained in:
Alexander Neumann 2015-08-26 22:06:52 +02:00
parent b211f834fa
commit 0a457eafed
3 changed files with 9 additions and 6 deletions

View file

@ -110,7 +110,7 @@ func Create(dir string, program string, args ...string) (*SFTP, error) {
}
// test if config file already exists
_, err = sftp.c.Lstat(backend.Paths.Config)
_, err = sftp.c.Lstat(filepath.Join(dir, backend.Paths.Config))
if err == nil {
return nil, errors.New("config file already exists")
}