mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
set stat: remove unecessary check
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -925,16 +925,6 @@ func (c *BaseConnection) CreateSymlink(virtualSourcePath, virtualTargetPath stri
|
|||||||
return nil
|
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,
|
func (c *BaseConnection) doStatInternal(virtualPath string, mode int, checkFilePatterns,
|
||||||
convertResult bool,
|
convertResult bool,
|
||||||
) (os.FileInfo, error) {
|
) (os.FileInfo, error) {
|
||||||
@@ -1071,7 +1061,7 @@ func (c *BaseConnection) SetStat(virtualPath string, attributes *StatAttributes)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
pathForPerms := c.getPathForSetStatPerms(fs, fsPath, virtualPath)
|
pathForPerms := path.Dir(virtualPath)
|
||||||
|
|
||||||
if attributes.Flags&StatAttrTimes != 0 {
|
if attributes.Flags&StatAttrTimes != 0 {
|
||||||
if err = c.handleChtimes(fs, fsPath, pathForPerms, attributes); err != nil {
|
if err = c.handleChtimes(fs, fsPath, pathForPerms, attributes); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user