Accepting request 1168519 from devel:microos
OBS-URL: https://build.opensuse.org/request/show/1168519 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cni?expand=0&rev=19
This commit is contained in:
commit
7cf4ccdfec
@ -1,167 +0,0 @@
|
|||||||
From 383b2e75a7a4198c42f8f87833eefb772868a56f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Russ Cox <rsc@golang.org>
|
|
||||||
Date: Mon, 9 Aug 2021 15:09:12 -0400
|
|
||||||
Subject: [PATCH] language: turn parsing panics into ErrSyntax
|
|
||||||
|
|
||||||
We keep finding new panics in the language parser.
|
|
||||||
Limit the damage by reporting those inputs as syntax errors.
|
|
||||||
|
|
||||||
Change-Id: I786fe127c3df7e4c8e042d15095d3acf3c4e4a50
|
|
||||||
Reviewed-on: https://go-review.googlesource.com/c/text/+/340830
|
|
||||||
Trust: Russ Cox <rsc@golang.org>
|
|
||||||
Run-TryBot: Russ Cox <rsc@golang.org>
|
|
||||||
TryBot-Result: Go Bot <gobot@golang.org>
|
|
||||||
Reviewed-by: Roland Shoemaker <roland@golang.org>
|
|
||||||
---
|
|
||||||
internal/language/language.go | 43 +++++++++++++++++++++++++++++++----
|
|
||||||
internal/language/parse.go | 7 ++++++
|
|
||||||
language/parse.go | 22 ++++++++++++++++++
|
|
||||||
3 files changed, 68 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/internal/language/language.go b/internal/language/language.go
|
|
||||||
index f41aedcfc..6105bc7fa 100644
|
|
||||||
--- a/internal/language/language.go
|
|
||||||
+++ b/internal/language/language.go
|
|
||||||
@@ -251,6 +251,13 @@ func (t Tag) Parent() Tag {
|
|
||||||
|
|
||||||
// ParseExtension parses s as an extension and returns it on success.
|
|
||||||
func ParseExtension(s string) (ext string, err error) {
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ ext = ""
|
|
||||||
+ err = ErrSyntax
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
+
|
|
||||||
scan := makeScannerString(s)
|
|
||||||
var end int
|
|
||||||
if n := len(scan.token); n != 1 {
|
|
||||||
@@ -461,7 +468,14 @@ func (t Tag) findTypeForKey(key string) (start, sep, end int, hasExt bool) {
|
|
||||||
// ParseBase parses a 2- or 3-letter ISO 639 code.
|
|
||||||
// It returns a ValueError if s is a well-formed but unknown language identifier
|
|
||||||
// or another error if another error occurred.
|
|
||||||
-func ParseBase(s string) (Language, error) {
|
|
||||||
+func ParseBase(s string) (l Language, err error) {
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ l = 0
|
|
||||||
+ err = ErrSyntax
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
+
|
|
||||||
if n := len(s); n < 2 || 3 < n {
|
|
||||||
return 0, ErrSyntax
|
|
||||||
}
|
|
||||||
@@ -472,7 +486,14 @@ func ParseBase(s string) (Language, error) {
|
|
||||||
// ParseScript parses a 4-letter ISO 15924 code.
|
|
||||||
// It returns a ValueError if s is a well-formed but unknown script identifier
|
|
||||||
// or another error if another error occurred.
|
|
||||||
-func ParseScript(s string) (Script, error) {
|
|
||||||
+func ParseScript(s string) (scr Script, err error) {
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ scr = 0
|
|
||||||
+ err = ErrSyntax
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
+
|
|
||||||
if len(s) != 4 {
|
|
||||||
return 0, ErrSyntax
|
|
||||||
}
|
|
||||||
@@ -489,7 +510,14 @@ func EncodeM49(r int) (Region, error) {
|
|
||||||
// ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code.
|
|
||||||
// It returns a ValueError if s is a well-formed but unknown region identifier
|
|
||||||
// or another error if another error occurred.
|
|
||||||
-func ParseRegion(s string) (Region, error) {
|
|
||||||
+func ParseRegion(s string) (r Region, err error) {
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ r = 0
|
|
||||||
+ err = ErrSyntax
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
+
|
|
||||||
if n := len(s); n < 2 || 3 < n {
|
|
||||||
return 0, ErrSyntax
|
|
||||||
}
|
|
||||||
@@ -578,7 +606,14 @@ type Variant struct {
|
|
||||||
|
|
||||||
// ParseVariant parses and returns a Variant. An error is returned if s is not
|
|
||||||
// a valid variant.
|
|
||||||
-func ParseVariant(s string) (Variant, error) {
|
|
||||||
+func ParseVariant(s string) (v Variant, err error) {
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ v = Variant{}
|
|
||||||
+ err = ErrSyntax
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
+
|
|
||||||
s = strings.ToLower(s)
|
|
||||||
if id, ok := variantIndex[s]; ok {
|
|
||||||
return Variant{id, s}, nil
|
|
||||||
diff --git a/internal/language/parse.go b/internal/language/parse.go
|
|
||||||
index c696fd0bd..47ee0fed1 100644
|
|
||||||
--- a/internal/language/parse.go
|
|
||||||
+++ b/internal/language/parse.go
|
|
||||||
@@ -232,6 +232,13 @@ func Parse(s string) (t Tag, err error) {
|
|
||||||
if s == "" {
|
|
||||||
return Und, ErrSyntax
|
|
||||||
}
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ t = Und
|
|
||||||
+ err = ErrSyntax
|
|
||||||
+ return
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
if len(s) <= maxAltTaglen {
|
|
||||||
b := [maxAltTaglen]byte{}
|
|
||||||
for i, c := range s {
|
|
||||||
diff --git a/language/parse.go b/language/parse.go
|
|
||||||
index 11acfd885..59b041008 100644
|
|
||||||
--- a/language/parse.go
|
|
||||||
+++ b/language/parse.go
|
|
||||||
@@ -43,6 +43,13 @@ func Parse(s string) (t Tag, err error) {
|
|
||||||
// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
|
|
||||||
// The resulting tag is canonicalized using the canonicalization type c.
|
|
||||||
func (c CanonType) Parse(s string) (t Tag, err error) {
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ t = Tag{}
|
|
||||||
+ err = language.ErrSyntax
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
+
|
|
||||||
tt, err := language.Parse(s)
|
|
||||||
if err != nil {
|
|
||||||
return makeTag(tt), err
|
|
||||||
@@ -79,6 +86,13 @@ func Compose(part ...interface{}) (t Tag, err error) {
|
|
||||||
// tag is returned after canonicalizing using CanonType c. If one or more errors
|
|
||||||
// are encountered, one of the errors is returned.
|
|
||||||
func (c CanonType) Compose(part ...interface{}) (t Tag, err error) {
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ t = Tag{}
|
|
||||||
+ err = language.ErrSyntax
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
+
|
|
||||||
var b language.Builder
|
|
||||||
if err = update(&b, part...); err != nil {
|
|
||||||
return und, err
|
|
||||||
@@ -142,6 +156,14 @@ var errInvalidWeight = errors.New("ParseAcceptLanguage: invalid weight")
|
|
||||||
// Tags with a weight of zero will be dropped. An error will be returned if the
|
|
||||||
// input could not be parsed.
|
|
||||||
func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) {
|
|
||||||
+ defer func() {
|
|
||||||
+ if recover() != nil {
|
|
||||||
+ tag = nil
|
|
||||||
+ q = nil
|
|
||||||
+ err = language.ErrSyntax
|
|
||||||
+ }
|
|
||||||
+ }()
|
|
||||||
+
|
|
||||||
var entry string
|
|
||||||
for s != "" {
|
|
||||||
if entry, s = split(s, ','); entry == "" {
|
|
21
_service
21
_service
@ -1,20 +1,19 @@
|
|||||||
<services>
|
<services>
|
||||||
<service name="tar_scm" mode="disabled">
|
<service name="obs_scm" mode="manual">
|
||||||
<param name="url">https://github.com/containernetworking/cni.git</param>
|
<param name="url">https://github.com/containernetworking/cni.git</param>
|
||||||
<param name="scm">git</param>
|
<param name="scm">git</param>
|
||||||
<param name="filename">cni</param>
|
<param name="revision">v1.2.0</param>
|
||||||
<param name="exclude">.git</param>
|
|
||||||
<param name="versionformat">@PARENT_TAG@</param>
|
<param name="versionformat">@PARENT_TAG@</param>
|
||||||
<param name="revision">v1.1.2</param>
|
|
||||||
<param name="versionrewrite-pattern">v(.*)</param>
|
<param name="versionrewrite-pattern">v(.*)</param>
|
||||||
|
<!-- filter out spec-vN.M.O tags -->
|
||||||
|
<param name="match-tag">v*</param>
|
||||||
<param name="changesgenerate">enable</param>
|
<param name="changesgenerate">enable</param>
|
||||||
</service>
|
</service>
|
||||||
<service name="recompress" mode="disabled">
|
<service name="tar" mode="buildtime"/>
|
||||||
<param name="file">cni-*.tar</param>
|
<service name="recompress" mode="buildtime">
|
||||||
<param name="compression">gz</param>
|
<param name="file">*.tar</param>
|
||||||
|
<param name="compression">zst</param>
|
||||||
</service>
|
</service>
|
||||||
<service name="set_version" mode="disabled">
|
<service name="set_version" mode="manual" />
|
||||||
<param name="basename">cni</param>
|
<service name="go_modules" mode="manual"/>
|
||||||
</service>
|
|
||||||
<service name="go_modules" mode="disabled"/>
|
|
||||||
</services>
|
</services>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<servicedata>
|
<servicedata>
|
||||||
<service name="tar_scm">
|
<service name="tar_scm">
|
||||||
<param name="url">https://github.com/containernetworking/cni.git</param>
|
<param name="url">https://github.com/containernetworking/cni.git</param>
|
||||||
<param name="changesrevision">3363d143688bb83ca18489ac8b9dc204c1d49c4a</param></service></servicedata>
|
<param name="changesrevision">df52e9460d3a819920b63e28c4d5d6f12bed6758</param></service></servicedata>
|
BIN
cni-1.1.2.tar.gz
(Stored with Git LFS)
BIN
cni-1.1.2.tar.gz
(Stored with Git LFS)
Binary file not shown.
3
cni-1.2.0.obscpio
Normal file
3
cni-1.2.0.obscpio
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:461565925812439cfbdd64916eb7346f6982289ac1342477ec5975c1c679c846
|
||||||
|
size 4164620
|
11
cni.changes
11
cni.changes
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Apr 16 13:27:50 UTC 2024 - Dan Čermák <dcermak@suse.com>
|
||||||
|
|
||||||
|
- Remove 0001-fix-upstream-CVE-2021-38561.patch, patch has been merged into
|
||||||
|
golang.org/x/text version 0.3.7, vendored bundle now contains 0.14.0
|
||||||
|
- Stop shipping development files DCO & CONTRIBUTING.md
|
||||||
|
- New upstream release 1.2.0 with spec 1.1.0:
|
||||||
|
* GC verb
|
||||||
|
* STATUS verb
|
||||||
|
* Version negotiation
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Oct 9 09:40:04 UTC 2023 - Dan Čermák <dcermak@suse.com>
|
Mon Oct 9 09:40:04 UTC 2023 - Dan Čermák <dcermak@suse.com>
|
||||||
|
|
||||||
|
4
cni.obsinfo
Normal file
4
cni.obsinfo
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
name: cni
|
||||||
|
version: 1.2.0
|
||||||
|
mtime: 1713196028
|
||||||
|
commit: df52e9460d3a819920b63e28c4d5d6f12bed6758
|
14
cni.spec
14
cni.spec
@ -22,21 +22,20 @@
|
|||||||
%define cni_bin_dir %{_libexecdir}/cni
|
%define cni_bin_dir %{_libexecdir}/cni
|
||||||
%define cni_doc_dir %{_docdir}/cni
|
%define cni_doc_dir %{_docdir}/cni
|
||||||
Name: cni
|
Name: cni
|
||||||
Version: 1.1.2
|
Version: 1.2.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Container Network Interface - networking for Linux containers
|
Summary: Container Network Interface - networking for Linux containers
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
Group: System/Management
|
Group: System/Management
|
||||||
URL: https://github.com/containernetworking/cni
|
URL: https://github.com/containernetworking/cni
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.zst
|
||||||
Source1: 99-loopback.conf
|
Source1: 99-loopback.conf
|
||||||
Source2: vendor.tar.gz
|
Source2: vendor.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM bsc#1206711
|
|
||||||
Patch0: 0001-fix-upstream-CVE-2021-38561.patch
|
|
||||||
BuildRequires: golang-packaging
|
BuildRequires: golang-packaging
|
||||||
BuildRequires: shadow
|
BuildRequires: shadow
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: golang(API) >= 1.21
|
BuildRequires: golang(API) >= 1.21
|
||||||
|
BuildRequires: zstd
|
||||||
Requires(post): %fillup_prereq
|
Requires(post): %fillup_prereq
|
||||||
Recommends: cni-plugins
|
Recommends: cni-plugins
|
||||||
%{?systemd_requires}
|
%{?systemd_requires}
|
||||||
@ -51,10 +50,7 @@ the container is deleted. Because of this focus, CNI has a wide
|
|||||||
range of support and the specification is simple to implement.
|
range of support and the specification is simple to implement.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -a2 -N
|
%autosetup -a2
|
||||||
pushd vendor/golang.org/x/text
|
|
||||||
%autopatch -p1
|
|
||||||
popd
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export GOFLAGS=-mod=vendor
|
export GOFLAGS=-mod=vendor
|
||||||
@ -89,7 +85,7 @@ install -m 755 -d "%{buildroot}%{cni_doc_dir}"
|
|||||||
%{fillup_only -n %{name}}
|
%{fillup_only -n %{name}}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc CONTRIBUTING.md README.md DCO
|
%doc README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%dir %{cni_etc_dir}
|
%dir %{cni_etc_dir}
|
||||||
%dir %{cni_etc_dir}/net.d
|
%dir %{cni_etc_dir}/net.d
|
||||||
|
BIN
vendor.tar.gz
(Stored with Git LFS)
BIN
vendor.tar.gz
(Stored with Git LFS)
Binary file not shown.
Loading…
Reference in New Issue
Block a user