mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
local fs: fixed paths validation for some Windows specific edge cases
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
|||||||
"github.com/rs/xid"
|
"github.com/rs/xid"
|
||||||
|
|
||||||
"github.com/drakkan/sftpgo/v2/internal/logger"
|
"github.com/drakkan/sftpgo/v2/internal/logger"
|
||||||
|
"github.com/drakkan/sftpgo/v2/internal/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -406,6 +407,9 @@ func (fs *OsFs) findNonexistentDirs(filePath string) ([]string, error) {
|
|||||||
for fs.IsNotExist(err) {
|
for fs.IsNotExist(err) {
|
||||||
results = append(results, parent)
|
results = append(results, parent)
|
||||||
parent = filepath.Dir(parent)
|
parent = filepath.Dir(parent)
|
||||||
|
if util.Contains(results, parent) {
|
||||||
|
break
|
||||||
|
}
|
||||||
_, err = os.Stat(parent)
|
_, err = os.Stat(parent)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user