smb: fix issue where spurious dot directory is created
This commit is contained in:
parent
959cd938bc
commit
7db1c506f2
1 changed files with 5 additions and 1 deletions
|
@ -478,11 +478,15 @@ func (f *Fs) makeEntryRelative(share, _path, relative string, stat os.FileInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Fs) ensureDirectory(ctx context.Context, share, _path string) error {
|
func (f *Fs) ensureDirectory(ctx context.Context, share, _path string) error {
|
||||||
|
dir := path.Dir(_path)
|
||||||
|
if dir == "." {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
cn, err := f.getConnection(ctx, share)
|
cn, err := f.getConnection(ctx, share)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = cn.smbShare.MkdirAll(f.toSambaPath(path.Dir(_path)), 0o755)
|
err = cn.smbShare.MkdirAll(f.toSambaPath(dir), 0o755)
|
||||||
f.putConnection(&cn)
|
f.putConnection(&cn)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue