Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

smb: fix issue where spurious dot directory is created

albertony7db1c506f261
diff --git a/backend/smb/smb.go b/backend/smb/smb.go
index 3e750cc1f..688221ce4 100644
--- a/backend/smb/smb.go
+++ b/backend/smb/smb.go
@@ -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 {
+ dir := path.Dir(_path)
+ if dir == "." {
+ return nil
+ }
cn, err := f.getConnection(ctx, share)
if err != nil {
return err
}
- err = cn.smbShare.MkdirAll(f.toSambaPath(path.Dir(_path)), 0o755)
+ err = cn.smbShare.MkdirAll(f.toSambaPath(dir), 0o755)
f.putConnection(&cn)
return err
}