From d610346a7b1d83829e33108db3b65b26fbeb281d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 2 Jul 2021 08:47:00 +0300 Subject: [PATCH] [#660] cli/container: Use version.IsValid in parseEACL Extended ACL input can have version later than CLI one, and it should not be downgraded. But the version should be still adequate. Set `pkg.SDKVersion` on false return of `version.IsValid`. Signed-off-by: Leonard Lyubich --- cmd/neofs-cli/modules/container.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/neofs-cli/modules/container.go b/cmd/neofs-cli/modules/container.go index 55ddcd9c0..95152af06 100644 --- a/cmd/neofs-cli/modules/container.go +++ b/cmd/neofs-cli/modules/container.go @@ -23,6 +23,7 @@ import ( "github.com/nspcc-dev/neofs-api-go/pkg/object" "github.com/nspcc-dev/neofs-api-go/pkg/owner" "github.com/nspcc-dev/neofs-api-go/pkg/session" + "github.com/nspcc-dev/neofs-node/pkg/core/version" "github.com/nspcc-dev/neofs-sdk-go/pkg/policy" "github.com/spf13/cobra" ) @@ -845,8 +846,8 @@ func parseEACL(eaclPath string) (*eacl.Table, error) { table := eacl.NewTable() if err = table.UnmarshalJSON(data); err == nil { - version := table.Version() - if err := pkg.IsSupportedVersion(&version); err != nil { + v := table.Version() + if !version.IsValid(v) { table.SetVersion(*pkg.SDKVersion()) }