From d18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 15 Jun 2021 14:57:03 +0100 Subject: gentoo resync : 15.06.2021 --- games-board/Manifest.gz | Bin 10534 -> 10528 bytes games-board/gnuchess/Manifest | 2 + .../files/gnuchess-6.2.8-cve-2021-30184.patch | 72 +++++++++++ games-board/gnuchess/gnuchess-6.2.8-r1.ebuild | 21 ++++ games-board/pychess/Manifest | 2 - games-board/pychess/files/pychess-gtk-compat.patch | 46 ------- .../pychess/files/pychess-setup-no-display.patch | 136 --------------------- 7 files changed, 95 insertions(+), 184 deletions(-) create mode 100644 games-board/gnuchess/files/gnuchess-6.2.8-cve-2021-30184.patch create mode 100644 games-board/gnuchess/gnuchess-6.2.8-r1.ebuild delete mode 100644 games-board/pychess/files/pychess-gtk-compat.patch delete mode 100644 games-board/pychess/files/pychess-setup-no-display.patch (limited to 'games-board') diff --git a/games-board/Manifest.gz b/games-board/Manifest.gz index 2cc4b82461dd..df04490461e3 100644 Binary files a/games-board/Manifest.gz and b/games-board/Manifest.gz differ diff --git a/games-board/gnuchess/Manifest b/games-board/gnuchess/Manifest index b1595a80210d..2f3724443551 100644 --- a/games-board/gnuchess/Manifest +++ b/games-board/gnuchess/Manifest @@ -1,5 +1,7 @@ +AUX gnuchess-6.2.8-cve-2021-30184.patch 1949 BLAKE2B e40c05ab4e2d459685ffdd6ad0d22382489bc26154c234da058e78f9fd3cbe9babfebab22e8b1525abf5dc50283db0b1868c82587cb9f04da0f4d14b113561ce SHA512 e44f53f8e25e86f20399e57d79d1d6835eabd69c34d89ba165e78d357471e2b82da5a48b184c8820c8340ddc55e3bd4097fdee737d62cbb73ffbc3870f94dc40 DIST gnuchess-6.2.7.tar.gz 802863 BLAKE2B 2fea825cdf0e629b3c2e9965d16f432edff81ceac8e7fbfd99b7be93f7281f813b10b91a62b3823acbf8967af538b04d2d87f93abde4a580e659e1fbdc5966e9 SHA512 1ed9e9344fbfc8e78504290a44e2710acab53f211c4349cafb7b64cc9a1fa923fbef4b4cbe3dd96438049b1da21415db3eb81fe663a94551c30105207086e343 DIST gnuchess-6.2.8.tar.gz 804080 BLAKE2B 7079c07ae7cd2f225c428a7bf14d53eec394382508544994918b87db35d5cbdeb9cf42a11f5bc2f9c0c7b778384d6cdb9aad4490bc9cfd40a513fc2e36cbdd67 SHA512 9146ee727c1eb8002eb3b1e762d71876b512eff0799eafec7019d5312766fe2bd6655c622e66f86e92f80d2f3666e48158a1245b42c30bd3221a8b379689ecdd EBUILD gnuchess-6.2.7.ebuild 379 BLAKE2B 40744e6f5027920c0b3b9689f8eef8343fa152ff3af013772389aa7bcb04563364a00579b71e345da527ae3f6393a5520d543f7da7d870ab02b558a0afa7b3c0 SHA512 ad55b40e15bce4b2d77f29d64582b76412a99f82e1224e58efa805285889de13abf545196ed6c88342db943a1a5bef9d339bd2449c007d2be2562a341e46b1fb +EBUILD gnuchess-6.2.8-r1.ebuild 450 BLAKE2B 519362e18f8a442f7ba7026f134a0830e09a0c1179b2129bd9ec4670a8a500ec5c4a78327466640f3a992e258633494695b66ba29c9416aaaff200f4bb1c3959 SHA512 f0e27e2caa92c0e6e3c81dc61630bc149885d9d9c919eb77a35bbb57e0bf0476202423c9c2326635ecf7c52688ec8103212b4710576307123274e39f6991e491 EBUILD gnuchess-6.2.8.ebuild 385 BLAKE2B e1afa7629659877190c8a0b1e06abe8b79eb85a9f9c510128298258bf65ed92e9f37010cc06934a4716a5fff24e977defdaf1385012f7a38a570cf07f1fac1bd SHA512 97639646920219246b1e733ea9930af989054267a3ef15c81ff2237419701bc1845e7ac118b479c8c38a80261b434a3a0b40bab6037a68df18cdba3da115727f MISC metadata.xml 249 BLAKE2B 7113a758d7abc93accec998a8843d8ef51ca8b72d72e659e224d5cec2a1a6a63e6c0605958091532ac6e51fa0d501ca4fd9f3f4a9e55baeb31519a02971b465f SHA512 895577c3a805c40581da03057b94e3f28f05f23012bf350c1e3575847d1a0fe40bb044a46f909012a200d991a400f6389358a60e9c2b5bef0da01fb26f846118 diff --git a/games-board/gnuchess/files/gnuchess-6.2.8-cve-2021-30184.patch b/games-board/gnuchess/files/gnuchess-6.2.8-cve-2021-30184.patch new file mode 100644 index 000000000000..dfa89a0e17c3 --- /dev/null +++ b/games-board/gnuchess/files/gnuchess-6.2.8-cve-2021-30184.patch @@ -0,0 +1,72 @@ +From 7059e40c7a487b17886e1d345b52fc0cfca8df72 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Wed, 2 Jun 2021 13:15:29 +0200 +Subject: [PATCH] frontend/cmd.cc: Fix buffer overflow CVE-2021-30184 + +Based on prior work by Michael Vaughan, +with "break;" replaced by "return;" and +magic number 9 resolved by strlen("setboard "). + +Mimics close-to-identical existing code from +elsewhere in the the same file. +--- + src/frontend/cmd.cc | 30 ++++++++++++++++++++++-------- + 1 file changed, 22 insertions(+), 8 deletions(-) + +diff --git a/src/frontend/cmd.cc b/src/frontend/cmd.cc +index a321fc2..394d03f 100644 +--- a/src/frontend/cmd.cc ++++ b/src/frontend/cmd.cc +@@ -477,13 +477,20 @@ void cmd_pgnload(void) + return; + } + +- strcpy( data, "setboard " ); ++ const char setboardCmd[] = "setboard "; ++ unsigned int setboardLen = strlen(setboardCmd); ++ strcpy( data, setboardCmd ); + int i=0; + while ( epdline[i] != '\n' ) { +- data[i+9] = epdline[i]; +- ++i; ++ if (i + setboardLen < MAXSTR - 1) { ++ data[i+setboardLen] = epdline[i]; ++ ++i; ++ } else { ++ printf( _("Error reading contents of file '%s'.\n"), token[1] ); ++ return; ++ } + } +- data[i+9] = '\0'; ++ data[i+setboardLen] = '\0'; + SetDataToEngine( data ); + SetAutoGo( true ); + pgnloaded = 0; +@@ -501,13 +508,20 @@ void cmd_pgnreplay(void) + return; + } + +- strcpy( data, "setboard " ); ++ const char setboardCmd[] = "setboard "; ++ unsigned int setboardLen = strlen(setboardCmd); ++ strcpy( data, setboardCmd ); + int i=0; + while ( epdline[i] != '\n' ) { +- data[i+9] = epdline[i]; +- ++i; ++ if (i + setboardLen < MAXSTR - 1) { ++ data[i+setboardLen] = epdline[i]; ++ ++i; ++ } else { ++ printf( _("Error reading contents of file '%s'.\n"), token[1] ); ++ return; ++ } + } +- data[i+9] = '\0'; ++ data[i+setboardLen] = '\0'; + + SetDataToEngine( data ); + SetAutoGo( true ); +-- +2.31.1 + diff --git a/games-board/gnuchess/gnuchess-6.2.8-r1.ebuild b/games-board/gnuchess/gnuchess-6.2.8-r1.ebuild new file mode 100644 index 000000000000..1c78b6b397c9 --- /dev/null +++ b/games-board/gnuchess/gnuchess-6.2.8-r1.ebuild @@ -0,0 +1,21 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Console based chess interface" +HOMEPAGE="https://www.gnu.org/software/chess/chess.html" +SRC_URI="mirror://gnu/chess/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ppc64 x86" + +PATCHES=( + "${FILESDIR}"/${P}-cve-2021-30184.patch # bug 780855 +) + +src_configure() { + # bug #491088 + econf --without-readline +} diff --git a/games-board/pychess/Manifest b/games-board/pychess/Manifest index 891c3c7df1fe..40b58c8579c6 100644 --- a/games-board/pychess/Manifest +++ b/games-board/pychess/Manifest @@ -1,5 +1,3 @@ -AUX pychess-gtk-compat.patch 1802 BLAKE2B 9c073b28c9dc2cbfc3e9bc1acce5b091ae6d77869c23a21d06e84fde2e7190ec412aa7d1f4e3a24698816a843ca8525be4f2114c046774ba6daa6aec6765edc7 SHA512 54db9fd66bcbf2e5c4a0d761b72fb461450a75ac32338fc7a7a097bd8e14667bae682a0ecb9e0ad63f9d0ff04892f3b37afe7041c0582bab57f36e64e6d7d65c -AUX pychess-setup-no-display.patch 5165 BLAKE2B 897e1b5d01b9192ca969c1d4603a1597a3c3ebbc91783c66f8f8067ef6e1064c5011faeca5684dcb3ad472860ea9c256882f35546d3582837957f3d3c53fec17 SHA512 bc7a975b8069e9a96d8f56e54bb3f7b8e2d1c1eddf89615ad2a45292b5bb1926bbb17341f565129a868787120e501b7c2f6cbe3e059249030ec9dc218a2e320a DIST pychess-1.0.2.tar.gz 14571480 BLAKE2B 01ca5d802f651a1f371b32dfbc97ac5c05f3b3fad3c6394209423cdb0fca995ea12254ad98fa94885e3b31a2deb72f63c2df5d0d97258a208c41ff3aab6a8dde SHA512 434f511ead51f1e90381172c894ed8b34fc5fae63e3714395285f6c55aa77dfe2f763e97febd93a3abcbc105f0e7591a9a84276eaae70c80f065a24040bfb083 DIST pychess-1.0.3.tar.gz 14898032 BLAKE2B 0993bcf26d3284847815b37f570b7482c5359595f9649f9546ed090b6c090c3686d71478c9ecdaacde4bdf56f8f57da89623023d25809b46fe4e2800beeba91d SHA512 ca69555b1d952274fc4850f20bc66569e2f08120109908489c584231c754345b16fc1b1e9fa5b44a10582590145cf472604e5f5bd22522037666414418f5fda5 EBUILD pychess-1.0.2.ebuild 1193 BLAKE2B d15cf16cdbbf1a55f96540f988c9dc4f0401a36fdb326334c2ff4df44a85c8389af6ef45218150963ac06795a5b97ab48a68c7a30106cdab2097f7150e25df70 SHA512 b8c03be70ff01f7220ffc779032d6ca8a74efe5d7398df772c01dc32a173400fe8a586de6d57dd3c7ee33edc31ba798001d085dd98e5052db072ca15ab7b5286 diff --git a/games-board/pychess/files/pychess-gtk-compat.patch b/games-board/pychess/files/pychess-gtk-compat.patch deleted file mode 100644 index fa7f2fc61033..000000000000 --- a/games-board/pychess/files/pychess-gtk-compat.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 6c840c9981f2077d0fa4436b30a2f2f6650e55fb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= -Date: Mon, 13 Apr 2020 14:48:40 +0200 -Subject: [PATCH] Fix missing TreeModelFilter.sort_new_with_model() on some Gtk - versions -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This is due to API changes, but let's keep compatibility with older versions. -That should fix #1811. - -Signed-off-by: Mickaƫl Schoentgen ---- - lib/pychess/perspectives/fics/__init__.py | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/lib/pychess/perspectives/fics/__init__.py b/lib/pychess/perspectives/fics/__init__.py -index 4f956b695..1518c21e0 100644 ---- a/lib/pychess/perspectives/fics/__init__.py -+++ b/lib/pychess/perspectives/fics/__init__.py -@@ -27,6 +27,24 @@ - from pychess.perspectives import Perspective, perspective_manager, panel_name - - -+if not hasattr(Gtk.TreeModelFilter, "new_with_model"): -+ # Fix #1811: TreeModelFilter.sort_new_with_model() is missing on some Gtk versions -+ # due to API changes. Let's keep compatibility with older versions. -+ -+ def sort_new_with_model(self): -+ super_object = super(Gtk.TreeModel, self) -+ if hasattr(super_object, "sort_new_with_model"): -+ return super_object.sort_new_with_model() -+ return Gtk.TreeModelSort.new_with_model(self) -+ -+ @classmethod -+ def new_with_model(self, child_model): -+ return Gtk.TreeModel.sort_new_with_model(child_model) -+ -+ Gtk.TreeModel.sort_new_with_model = sort_new_with_model -+ Gtk.TreeModelFilter.new_with_model = new_with_model -+ -+ - class PlayerNotificationMessage(InfoBarMessage): - - def __init__(self, message_type, content, callback, player, text): diff --git a/games-board/pychess/files/pychess-setup-no-display.patch b/games-board/pychess/files/pychess-setup-no-display.patch deleted file mode 100644 index 29b06bd93fe8..000000000000 --- a/games-board/pychess/files/pychess-setup-no-display.patch +++ /dev/null @@ -1,136 +0,0 @@ -From faf456bf2d081aa3cff52d0f9f714748a04628b1 Mon Sep 17 00:00:00 2001 -From: gbtami -Date: Sat, 18 May 2019 18:50:17 +0200 -Subject: [PATCH] Fix bdist_rpm. Prevent importing GLib from setup.py - ---- - lib/pychess/Savers/pgn.py | 8 ++++---- - lib/pychess/Utils/__init__.py | 18 ++++++++++++++++++ - lib/pychess/widgets/ChessClock.py | 20 ++------------------ - 3 files changed, 24 insertions(+), 22 deletions(-) - -diff --git a/lib/pychess/Savers/pgn.py b/lib/pychess/Savers/pgn.py -index ac4238471..2b089e1d1 100644 ---- a/lib/pychess/Savers/pgn.py -+++ b/lib/pychess/Savers/pgn.py -@@ -10,8 +10,6 @@ - import sys - import textwrap - --from gi.repository import GLib -- - import pexpect - - from sqlalchemy import String -@@ -23,7 +21,6 @@ - WON_RESIGN, DRAW, BLACKWON, WHITEWON, NORMALCHESS, DRAW_AGREE, FIRST_PAGE, PREV_PAGE, NEXT_PAGE, \ - ABORTED_REASONS, ADJOURNED_REASONS, WON_CALLFLAG, DRAW_ADJUDICATION, WON_ADJUDICATION, \ - WHITE_ENGINE_DIED, BLACK_ENGINE_DIED, RUNNING, TOOL_NONE, TOOL_CHESSDB, TOOL_SCOUTFISH -- - from pychess.System import conf - from pychess.System.Log import log - from pychess.System.protoopen import PGN_ENCODING -@@ -35,7 +32,7 @@ - from pychess.Utils.elo import get_elo_rating_change_pgn - from pychess.Utils.logic import getStatus - from pychess.Variants import name2variant, NormalBoard, variants --from pychess.widgets.ChessClock import formatTime -+from pychess.Utils import formatTime - from pychess.Savers.ChessFile import ChessFile, LoadingError - from pychess.Savers.database import col2label, TagDatabase, parseDateTag - from pychess.Database import model as dbmodel -@@ -460,6 +457,7 @@ def init_tag_database(self, importer=None): - if size > 10000000: - drop_indexes(self.engine) - if self.progressbar is not None: -+ from gi.repository import GLib - GLib.idle_add(self.progressbar.set_text, _("Importing game headers...")) - if importer is None: - importer = PgnImport(self) -@@ -477,6 +475,7 @@ def init_chess_db(self): - if chess_db_path is not None and self.path and self.size > 0: - try: - if self.progressbar is not None: -+ from gi.repository import GLib - GLib.idle_add(self.progressbar.set_text, _("Creating .bin index file...")) - self.chess_db = Parser(engine=(chess_db_path, )) - self.chess_db.open(self.path) -@@ -503,6 +502,7 @@ def init_scoutfish(self): - if scoutfish_path is not None and self.path and self.size > 0: - try: - if self.progressbar is not None: -+ from gi.repository import GLib - GLib.idle_add(self.progressbar.set_text, _("Creating .scout index file...")) - self.scoutfish = Scoutfish(engine=(scoutfish_path, )) - self.scoutfish.open(self.path) -diff --git a/lib/pychess/Utils/__init__.py b/lib/pychess/Utils/__init__.py -index 481273854..038c798da 100755 ---- a/lib/pychess/Utils/__init__.py -+++ b/lib/pychess/Utils/__init__.py -@@ -1,9 +1,27 @@ - import asyncio - import weakref -+from math import ceil - - from pychess.Utils.lutils.ldata import MATE_VALUE, MATE_DEPTH - - -+def formatTime(seconds, clk2pgn=False): -+ minus = "" -+ if seconds <= -10 or seconds >= 10: -+ seconds = ceil(seconds) -+ if seconds < 0: -+ minus = "-" -+ seconds = -seconds -+ hours, remainder = divmod(seconds, 3600) -+ minutes, seconds = divmod(remainder, 60) -+ if hours or clk2pgn: -+ return minus + "%d:%02d:%02d" % (hours, minutes, seconds) -+ elif not minutes and seconds < 10: -+ return minus + "%.1f" % seconds -+ else: -+ return minus + "%d:%02d" % (minutes, seconds) -+ -+ - def prettyPrintScore(s, depth, format_mate=False): - """The score parameter is an eval value from White point of view""" - -diff --git a/lib/pychess/widgets/ChessClock.py b/lib/pychess/widgets/ChessClock.py -index 8811d13db..740e0828a 100644 ---- a/lib/pychess/widgets/ChessClock.py -+++ b/lib/pychess/widgets/ChessClock.py -@@ -1,32 +1,16 @@ - # -*- coding: UTF-8 -*- - --from math import ceil, pi, cos, sin -+from math import pi, cos, sin - - import cairo - from gi.repository import GLib, Gtk, Gdk, Pango, PangoCairo, GObject - - from pychess.System import conf -+from pychess.Utils import formatTime - from pychess.Utils.const import BLACK, WHITE, LOCAL, UNFINISHED_STATES, DRAW, WHITEWON, BLACKWON, UNKNOWN_STATE - from . import preferencesDialog - - --def formatTime(seconds, clk2pgn=False): -- minus = "" -- if seconds <= -10 or seconds >= 10: -- seconds = ceil(seconds) -- if seconds < 0: -- minus = "-" -- seconds = -seconds -- hours, remainder = divmod(seconds, 3600) -- minutes, seconds = divmod(remainder, 60) -- if hours or clk2pgn: -- return minus + "%d:%02d:%02d" % (hours, minutes, seconds) -- elif not minutes and seconds < 10: -- return minus + "%.1f" % seconds -- else: -- return minus + "%d:%02d" % (minutes, seconds) -- -- - class ChessClock(Gtk.DrawingArea): - def __init__(self): - GObject.GObject.__init__(self) -- cgit v1.2.3