mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
always check root dir in multi node setups
Fixes #920 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -227,10 +227,10 @@ func (fs *OsFs) CheckRootPath(username string, uid int, gid int) bool {
|
||||
var err error
|
||||
if _, err = fs.Stat(fs.rootDir); fs.IsNotExist(err) {
|
||||
err = os.MkdirAll(fs.rootDir, os.ModePerm)
|
||||
fsLog(fs, logger.LevelDebug, "root directory %#v for user %#v does not exist, try to create, mkdir error: %v",
|
||||
fs.rootDir, username, err)
|
||||
if err == nil {
|
||||
SetPathPermissions(fs, fs.rootDir, uid, gid)
|
||||
} else {
|
||||
fsLog(fs, logger.LevelError, "error creating root directory %q for user %q: %v", fs.rootDir, username, err)
|
||||
}
|
||||
}
|
||||
return err == nil
|
||||
|
||||
Reference in New Issue
Block a user