webdav: pin an upload's final update to the Object Lock state it read

An upload writes the whole entry back when it closes. A hold or retention
set on the new object while the upload was buffering would be dropped, so
the filer now refuses the update if that state changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-11-24 12:14:51 -08:00
1 parent e6ace2d929
commit 674b5765e5
1 file changed
+4 -3
+4 -3
View File
@@ -819,9 +819,10 @@ func (f *WebDavFile) Write(buf []byte) (int, error) {
f.entry.Attributes.Mtime = time.Now().Unix()
request := &filer_pb.UpdateEntryRequest{
Directory: dir,
Entry: f.entry,
Signatures: []int32{f.fs.signature},
Directory: dir,
Entry: f.entry,
Signatures: []int32{f.fs.signature},
ExpectedExtended: objectLockState(f.entry),
}
if _, err := client.UpdateEntry(ctx, request); err != nil {