add a File interface so we can avoid to use os.File directly

This commit is contained in:
Nicola Murino
2020-11-17 19:36:39 +01:00
parent 969b38586e
commit ca0ff0d630
17 changed files with 63 additions and 47 deletions

View File

@@ -552,7 +552,7 @@ func (c *sshCommand) hasCopyPermissions(sshSourcePath, sshDestPath string, srcIn
}
if srcInfo.IsDir() {
return c.connection.User.HasPerm(dataprovider.PermCreateDirs, path.Dir(sshDestPath))
} else if srcInfo.Mode()&os.ModeSymlink == os.ModeSymlink {
} else if srcInfo.Mode()&os.ModeSymlink != 0 {
return c.connection.User.HasPerm(dataprovider.PermCreateSymlinks, path.Dir(sshDestPath))
}
return c.connection.User.HasPerm(dataprovider.PermUpload, path.Dir(sshDestPath))