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

azureblob: fix "Entry doesn't belong in directory" errors when using directory markers

Nick Craig-Wood72b79504ea44
diff --git a/backend/azureblob/azureblob.go b/backend/azureblob/azureblob.go
index ec9756bb7..404b143c0 100644
--- a/backend/azureblob/azureblob.go
+++ b/backend/azureblob/azureblob.go
@@ -1063,11 +1063,7 @@ func (f *Fs) list(ctx context.Context, containerName, directory, prefix string,
fs.Debugf(f, "Odd name received %q", remote)
continue
}
- remote = remote[len(prefix):]
isDirectory := isDirectoryMarker(*file.Properties.ContentLength, file.Metadata, remote)
- if addContainer {
- remote = path.Join(containerName, remote)
- }
if isDirectory {
// Don't insert the root directory
if remote == directory {
@@ -1076,6 +1072,10 @@ func (f *Fs) list(ctx context.Context, containerName, directory, prefix string,
// process directory markers as directories
remote = strings.TrimRight(remote, "/")
}
+ remote = remote[len(prefix):]
+ if addContainer {
+ remote = path.Join(containerName, remote)
+ }
// Send object
err = fn(remote, file, isDirectory)
if err != nil {