mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-15 18:48:32 +02:00
fix(s3api): drop ancestor directory markers from prefixed ListObjectVersions (#9885)
processExplicitDirectory appended a directory-key object as a version without checking it against the prefix. A versioned listing descends through ancestor markers to reach a deeper prefix, so every ancestor (Veeam/, Veeam/Backup/, ...) leaked into Versions even though none of them match the prefix - which makes Veeam's immutable repository scan abort on an unexpected key. Guard on the prefix so only keys at or under it surface, matching ListObjectsV2 and AWS.
This commit is contained in:
1 parent
d569dd686f
commit
2871e6552a
2 files changed
+88
No files matched your search
@@ -652,6 +652,15 @@ func (vc *versionCollector) processExplicitDirectory(entryPath string, entry *fi
|
||||
directoryKey += "/"
|
||||
}
|
||||
|
||||
// Only surface a directory key whose own key matches the prefix. Ancestor
|
||||
// markers (e.g. "Veeam/") get descended through to reach a deeper prefix but
|
||||
// don't match it themselves, so they must not appear as version entries -
|
||||
// this mirrors ListObjectsV2 and AWS, and stops clients like Veeam that
|
||||
// reject unexpected keys in a listing from aborting.
|
||||
if !strings.HasPrefix(directoryKey, vc.prefix) {
|
||||
return
|
||||
}
|
||||
|
||||
// Skip directories at or before keyMarker
|
||||
if vc.keyMarker != "" && directoryKey <= vc.keyMarker {
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user