mirror of
https://github.com/distribution/distribution.git
synced 2025-09-20 10:47:26 +00:00
Verify manifest name format
Signed-off-by: Troels Thomsen <troels@thomsen.io>
This commit is contained in:
@@ -112,6 +112,10 @@ func (ms *manifestStore) verifyManifest(ctx context.Context, mnfst *schema1.Sign
|
|||||||
errs = append(errs, fmt.Errorf("manifest name must not be more than %v characters", reference.NameTotalLengthMax))
|
errs = append(errs, fmt.Errorf("manifest name must not be more than %v characters", reference.NameTotalLengthMax))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !reference.NameRegexp.MatchString(mnfst.Name) {
|
||||||
|
errs = append(errs, fmt.Errorf("invalid manifest name format"))
|
||||||
|
}
|
||||||
|
|
||||||
if len(mnfst.History) != len(mnfst.FSLayers) {
|
if len(mnfst.History) != len(mnfst.FSLayers) {
|
||||||
errs = append(errs, fmt.Errorf("mismatched history and fslayer cardinality %d != %d",
|
errs = append(errs, fmt.Errorf("mismatched history and fslayer cardinality %d != %d",
|
||||||
len(mnfst.History), len(mnfst.FSLayers)))
|
len(mnfst.History), len(mnfst.FSLayers)))
|
||||||
|
Reference in New Issue
Block a user