mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-31 22:11:51 +00:00
cmd/syncthing, lib/model: Handle rel/abs paths for config/protected paths (fixes #3183)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3995
This commit is contained in:
parent
3475a9ab0a
commit
c20d612736
@ -344,7 +344,13 @@ func main() {
|
||||
|
||||
if options.confDir != "" {
|
||||
// Not set as default above because the string can be really long.
|
||||
baseDirs["config"] = options.confDir
|
||||
if !filepath.IsAbs(options.confDir) {
|
||||
path, err := filepath.Abs(options.confDir)
|
||||
if err != nil {
|
||||
l.Fatalln(err)
|
||||
}
|
||||
baseDirs["config"] = path
|
||||
}
|
||||
}
|
||||
|
||||
if err := expandLocations(); err != nil {
|
||||
|
@ -285,7 +285,8 @@ func (m *Model) warnAboutOverwritingProtectedFiles(folder string) {
|
||||
}
|
||||
|
||||
// check if file is ignored
|
||||
if ignores.Match(protectedFilePath).IsIgnored() {
|
||||
relPath, _ := filepath.Rel(folderLocation, protectedFilePath)
|
||||
if ignores.Match(relPath).IsIgnored() {
|
||||
continue
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user