mirror of
https://github.com/drakkan/sftpgo.git
synced 2026-03-14 14:25:52 +01:00
set stat: remove unecessary check
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
cface046dd
commit
814f5022b1
1 changed files with 1 additions and 11 deletions
|
|
@ -922,16 +922,6 @@ func (c *BaseConnection) CreateSymlink(virtualSourcePath, virtualTargetPath stri
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *BaseConnection) getPathForSetStatPerms(fs vfs.Fs, fsPath, virtualPath string) string {
|
||||
pathForPerms := virtualPath
|
||||
if fi, err := fs.Lstat(fsPath); err == nil {
|
||||
if fi.IsDir() {
|
||||
pathForPerms = path.Dir(virtualPath)
|
||||
}
|
||||
}
|
||||
return pathForPerms
|
||||
}
|
||||
|
||||
func (c *BaseConnection) doStatInternal(virtualPath string, mode int, checkFilePatterns,
|
||||
convertResult bool,
|
||||
) (os.FileInfo, error) {
|
||||
|
|
@ -1068,7 +1058,7 @@ func (c *BaseConnection) SetStat(virtualPath string, attributes *StatAttributes)
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pathForPerms := c.getPathForSetStatPerms(fs, fsPath, virtualPath)
|
||||
pathForPerms := path.Dir(virtualPath)
|
||||
|
||||
if attributes.Flags&StatAttrTimes != 0 {
|
||||
if err = c.handleChtimes(fs, fsPath, pathForPerms, attributes); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue