fix(cli): harden backup publication and quiescing
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"path"
|
||||
"regexp"
|
||||
"sort"
|
||||
@@ -193,7 +194,8 @@ func DecodeManifest(value []byte) (Manifest, error) {
|
||||
if err := decoder.Decode(&manifest); err != nil {
|
||||
return Manifest{}, fmt.Errorf("decode backup manifest: %w", err)
|
||||
}
|
||||
if decoder.More() {
|
||||
var trailing any
|
||||
if err := decoder.Decode(&trailing); !errors.Is(err, io.EOF) {
|
||||
return Manifest{}, errors.New("backup manifest contains trailing data")
|
||||
}
|
||||
if err := manifest.Finalize(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user