[gentoo-commits] repo/gentoo:master commit in: dev-cpp/yaml-cpp/, dev-cpp/yaml-cpp/files/

2020-03-20 Thread Johannes Huber
commit: f506b95e837aebf001b41ed1bcd19bda82d3ee47
Author: Johannes Huber  gentoo  org>
AuthorDate: Fri Mar 20 11:35:37 2020 +
Commit: Johannes Huber  gentoo  org>
CommitDate: Fri Mar 20 11:36:48 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f506b95e

dev-cpp/yaml-cpp: Fix CVE-2017-11692

Bug: https://bugs.gentoo.org/626662
Thanks-to: sam_c (Security Padawan)  cmpct.info>
Package-Manager: Portage-2.3.94, Repoman-2.3.21
Signed-off-by: Johannes Huber  gentoo.org>

 .../files/yaml-cpp-0.6.3-CVE-2017-11692.patch  | 44 
 dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r2.ebuild  | 48 ++
 2 files changed, 92 insertions(+)

diff --git a/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-CVE-2017-11692.patch 
b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-CVE-2017-11692.patch
new file mode 100644
index 000..fd7a7198c1c
--- /dev/null
+++ b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-CVE-2017-11692.patch
@@ -0,0 +1,44 @@
+From c9460110e072df84b7dee3eb651f2ec5df75fb18 Mon Sep 17 00:00:00 2001
+From: Jesse Beder 
+Date: Mon, 20 Jan 2020 18:05:15 -0600
+Subject: [PATCH] Fix reading empty token stack with a node with properties but
+ no scalar.
+
+E.g. `!2`.
+---
+ src/singledocparser.cpp | 6 ++
+ test/integration/load_node_test.cpp | 5 +
+ 2 files changed, 11 insertions(+)
+
+diff --git a/src/singledocparser.cpp b/src/singledocparser.cpp
+index 52544dd6..47e9e047 100644
+--- a/src/singledocparser.cpp
 b/src/singledocparser.cpp
+@@ -79,6 +79,12 @@ void SingleDocParser::HandleNode(EventHandler& 
eventHandler) {
+   if (!anchor_name.empty())
+ eventHandler.OnAnchor(mark, anchor_name);
+ 
++  // after parsing properties, an empty node is again a possibility
++  if (m_scanner.empty()) {
++eventHandler.OnNull(mark, anchor);
++return;
++  }
++
+   const Token& token = m_scanner.peek();
+ 
+   if (token.type == Token::PLAIN_SCALAR && IsNullString(token.value)) {
+diff --git a/test/integration/load_node_test.cpp 
b/test/integration/load_node_test.cpp
+index 4f4f28e8..0e0dd6bc 100644
+--- a/test/integration/load_node_test.cpp
 b/test/integration/load_node_test.cpp
+@@ -257,5 +257,10 @@ TEST(NodeTest, LoadTagWithParenthesis) {
+ EXPECT_EQ(node.as(), "foo");
+ }
+ 
++TEST(NodeTest, LoadTagWithNullScalar) {
++  Node node = Load("!2");
++  EXPECT_TRUE(node.IsNull());
++}
++
+ }  // namespace
+ }  // namespace YAML

diff --git a/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r2.ebuild 
b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r2.ebuild
new file mode 100644
index 000..db3c4f6dd2d
--- /dev/null
+++ b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS="cmake"
+inherit cmake-multilib
+
+DESCRIPTION="YAML parser and emitter in C++"
+HOMEPAGE="https://github.com/jbeder/yaml-cpp;
+SRC_URI="https://github.com/jbeder/${PN}/archive/${P}.tar.gz;
+
+LICENSE="MIT"
+SLOT="0/0.6"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux 
~x86-linux"
+IUSE="test"
+
+# test breaks build
+# RESTRICT="!test? ( test )"
+RESTRICT+="test"
+
+DEPEND="test? ( dev-cpp/gtest )"
+
+S="${WORKDIR}/${PN}-${P}"
+
+PATCHES=(
+   "${FILESDIR}/${P}-abi-breakage.patch"
+   "${FILESDIR}/${P}-CVE-2017-11692.patch"
+)
+
+src_prepare() {
+   sed -i \
+   -e 's:INCLUDE_INSTALL_ROOT_DIR:INCLUDE_INSTALL_DIR:g' \
+   yaml-cpp.pc.cmake || die
+
+   cmake_src_prepare
+}
+
+src_configure() {
+   local mycmakeargs=(
+   -DBUILD_SHARED_LIBS=ON
+   -DYAML_BUILD_SHARED_LIBS=ON
+   -DYAML_CPP_BUILD_TOOLS=OFF # Don't have install rule
+   -DYAML_CPP_BUILD_TESTS=$(usex test)
+   )
+
+   cmake-multilib_src_configure
+}



[gentoo-commits] repo/gentoo:master commit in: dev-cpp/yaml-cpp/, dev-cpp/yaml-cpp/files/

2020-01-07 Thread Johannes Huber
commit: 4f0b8303610a5eeefa5e4aa1127a27c1993372df
Author: Johannes Huber  gentoo  org>
AuthorDate: Tue Jan  7 21:40:11 2020 +
Commit: Johannes Huber  gentoo  org>
CommitDate: Tue Jan  7 21:41:23 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f0b8303

dev-cpp/yaml-cpp: fix ABI breakage

Adds a patch used in fedora to fix ABI breakage. Patch and issue spotted
by Attila Tóth  atoth.sote.hu>.

Bug: https://bugs.gentoo.org/704948
Thanks-to: Attila Tóth  atoth.sote.hu>
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Johannes Huber  gentoo.org>

 .../files/yaml-cpp-0.6.3-abi-breakage.patch| 57 ++
 dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild  | 45 +
 2 files changed, 102 insertions(+)

diff --git a/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-abi-breakage.patch 
b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-abi-breakage.patch
new file mode 100644
index 000..d9160856c47
--- /dev/null
+++ b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-abi-breakage.patch
@@ -0,0 +1,57 @@
+commit f5f288c7622d3547c29a8355b8ccda0155483b79
+Author: Till Hofmann 
+Date:   Sun Nov 17 22:43:20 2019 +0100
+
+Revert "fix up static, so works as DLL (#559)"
+
+This reverts commit 774f25800e6f19f4b927023c85d1389af322da5e.
+
+diff --git a/include/yaml-cpp/node/detail/node_data.h 
b/include/yaml-cpp/node/detail/node_data.h
+index 82fb79a..50bcd74 100644
+--- a/include/yaml-cpp/node/detail/node_data.h
 b/include/yaml-cpp/node/detail/node_data.h
+@@ -81,7 +81,7 @@ class YAML_CPP_API node_data {
+ shared_memory_holder pMemory);
+ 
+  public:
+-  static const std::string& empty_scalar();
++  static std::string empty_scalar;
+ 
+  private:
+   void compute_seq_size() const;
+diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h
+index 7a3deac..b363f86 100644
+--- a/include/yaml-cpp/node/impl.h
 b/include/yaml-cpp/node/impl.h
+@@ -166,13 +166,13 @@ inline T Node::as(const S& fallback) const {
+ inline const std::string& Node::Scalar() const {
+   if (!m_isValid)
+ throw InvalidNode(m_invalidKey);
+-  return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar();
++  return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar;
+ }
+ 
+ inline const std::string& Node::Tag() const {
+   if (!m_isValid)
+ throw InvalidNode(m_invalidKey);
+-  return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar();
++  return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar;
+ }
+ 
+ inline void Node::SetTag(const std::string& tag) {
+diff --git a/src/node_data.cpp b/src/node_data.cpp
+index 6cfedfc..eba1ae4 100644
+--- a/src/node_data.cpp
 b/src/node_data.cpp
+@@ -13,10 +13,7 @@
+ namespace YAML {
+ namespace detail {
+ 
+-const std::string& node_data::empty_scalar() {
+-  static const std::string svalue;
+-  return svalue;
+-}
++std::string node_data::empty_scalar;
+ 
+ node_data::node_data()
+ : m_isDefined(false),

diff --git a/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild 
b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild
new file mode 100644
index 000..8a579eada7c
--- /dev/null
+++ b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS="cmake"
+inherit cmake-multilib
+
+DESCRIPTION="YAML parser and emitter in C++"
+HOMEPAGE="https://github.com/jbeder/yaml-cpp;
+SRC_URI="https://github.com/jbeder/${PN}/archive/${P}.tar.gz;
+
+LICENSE="MIT"
+SLOT="0/0.6"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux 
~x86-linux"
+IUSE="test"
+
+# test breaks build
+# RESTRICT="!test? ( test )"
+RESTRICT+="test"
+
+DEPEND="test? ( dev-cpp/gtest )"
+
+S="${WORKDIR}/${PN}-${P}"
+
+PATCHES=( "${FILESDIR}/${P}-abi-breakage.patch" )
+
+src_prepare() {
+   sed -i \
+   -e 's:INCLUDE_INSTALL_ROOT_DIR:INCLUDE_INSTALL_DIR:g' \
+   yaml-cpp.pc.cmake || die
+
+   cmake_src_prepare
+}
+
+src_configure() {
+   local mycmakeargs=(
+   -DBUILD_SHARED_LIBS=ON
+   -DYAML_BUILD_SHARED_LIBS=ON
+   -DYAML_CPP_BUILD_TOOLS=OFF # Don't have install rule
+   -DYAML_CPP_BUILD_TESTS=$(usex test)
+   )
+
+   cmake-multilib_src_configure
+}



[gentoo-commits] repo/gentoo:master commit in: dev-cpp/yaml-cpp/, dev-cpp/yaml-cpp/files/

2018-06-02 Thread Johannes Huber
commit: ee604746b688a9631001dff1618b97dd4ad1aa46
Author: Johannes Huber  gentoo  org>
AuthorDate: Sat Jun  2 15:52:51 2018 +
Commit: Johannes Huber  gentoo  org>
CommitDate: Sat Jun  2 15:52:51 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee604746

dev-cpp/yaml-cpp: Remove 0.5.3-r1

Bug: https://bugs.gentoo.org/614850
Package-Manager: Portage-2.3.40, Repoman-2.3.9

 dev-cpp/yaml-cpp/Manifest|  1 -
 dev-cpp/yaml-cpp/files/yaml-cpp-0.5.3-gcc6.patch | 44 
 dev-cpp/yaml-cpp/yaml-cpp-0.5.3-r1.ebuild| 37 
 3 files changed, 82 deletions(-)

diff --git a/dev-cpp/yaml-cpp/Manifest b/dev-cpp/yaml-cpp/Manifest
index bac72aa90f8..4a2a21dbeb9 100644
--- a/dev-cpp/yaml-cpp/Manifest
+++ b/dev-cpp/yaml-cpp/Manifest
@@ -1,2 +1 @@
-DIST yaml-cpp-0.5.3.tar.gz 2016737 BLAKE2B 
6c10d44fe04fdd81cd61c909acdb576834f5358dd44353723b04d8a42bf8a1312cfa752e445c84f93c6ce76358b2d42dee5263f6fbd47a1f928d1cd28aedef07
 SHA512 
5ed15fee3c6455c08e6bd8f74256b230f274ef18f8e144491e940640e41626517c7eaaf4a1f380c4179066a2a757c8a0f61878df9dc3caa15e37c4954be47fe0
 DIST yaml-cpp-0.6.2.tar.gz 1396250 BLAKE2B 
be342c212c980cdb03349dbafbe1db0bb581123b4dd6909393d3cdc86145b997a9d2f9b57a5e9d7c8cc60cdfd03f1c37e9db610d8784f2d29fdeada5ab322894
 SHA512 
fea8ce0a20a00cbc75023d1db442edfcd32d0ac57a3c41b32ec8d56f87cc1d85d7dd7a923ce662f5d3a315f91a736d6be0d649997acd190915c1d68cc93795e4

diff --git a/dev-cpp/yaml-cpp/files/yaml-cpp-0.5.3-gcc6.patch 
b/dev-cpp/yaml-cpp/files/yaml-cpp-0.5.3-gcc6.patch
deleted file mode 100644
index 88ee25fa0ac..000
--- a/dev-cpp/yaml-cpp/files/yaml-cpp-0.5.3-gcc6.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Bug: https://bugs.gentoo.org/609176
-Upstream PR: https://github.com/jbeder/yaml-cpp/pull/514
-
-From a83a1b3a7bd0a5a4eb458d898b057f6a8d409b7e Mon Sep 17 00:00:00 2001
-From: Peter-Levine 
-Date: Mon, 24 Jul 2017 02:00:24 -0400
-Subject: [PATCH] Fix segfault in gmock when running tests
-
-Taken from 
https://github.com/google/googletest/issues/705#issuecomment-235067917

- test/gmock-1.7.0/include/gmock/gmock-spec-builders.h | 6 --
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/test/gmock-1.7.0/include/gmock/gmock-spec-builders.h 
b/test/gmock-1.7.0/include/gmock/gmock-spec-builders.h
-index 312fbe87..2dd733b6 100644
 a/test/gmock-1.7.0/include/gmock/gmock-spec-builders.h
-+++ b/test/gmock-1.7.0/include/gmock/gmock-spec-builders.h
-@@ -1370,6 +1370,8 @@ class ActionResultHolder : public 
UntypedActionResultHolderBase {
- template <>
- class ActionResultHolder : public UntypedActionResultHolderBase {
-  public:
-+  explicit ActionResultHolder() {}
-+
-   void GetValueAndDelete() const { delete this; }
- 
-   virtual void PrintAsActionResult(::std::ostream* /* os */) const {}
-@@ -1381,7 +1383,7 @@ class ActionResultHolder : public 
UntypedActionResultHolderBase {
-   const typename Function::ArgumentTuple& args,
-   const string& call_description) {
- func_mocker->PerformDefaultAction(args, call_description);
--return NULL;
-+return new ActionResultHolder();
-   }
- 
-   // Performs the given action and returns NULL.
-@@ -1390,7 +1392,7 @@ class ActionResultHolder : public 
UntypedActionResultHolderBase {
-   const Action& action,
-   const typename Function::ArgumentTuple& args) {
- action.Perform(args);
--return NULL;
-+return new ActionResultHolder();
-   }
- };
- 

diff --git a/dev-cpp/yaml-cpp/yaml-cpp-0.5.3-r1.ebuild 
b/dev-cpp/yaml-cpp/yaml-cpp-0.5.3-r1.ebuild
deleted file mode 100644
index 6bf29f127ca..000
--- a/dev-cpp/yaml-cpp/yaml-cpp-0.5.3-r1.ebuild
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit cmake-utils
-
-DESCRIPTION="YAML parser and emitter in C++"
-HOMEPAGE="https://github.com/jbeder/yaml-cpp;
-SRC_URI="https://github.com/jbeder/${PN}/archive/release-${PV}.tar.gz -> 
${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
-IUSE=""
-
-DEPEND=">=dev-libs/boost-1.49.0-r2:="
-RDEPEND="${DEPEND}"
-
-S="${WORKDIR}/${PN}-release-${PV}"
-
-PATCHES=( "${FILESDIR}"/${P}-gcc6.patch )
-
-src_prepare() {
-   sed -i \
-   -e 's:INCLUDE_INSTALL_ROOT_DIR:INCLUDE_INSTALL_DIR:g' \
-   yaml-cpp.pc.cmake || die
-
-   cmake-utils_src_prepare
-}
-
-src_configure() {
-   local mycmakeargs=(
-   -DBUILD_SHARED_LIBS=ON
-   )
-   cmake-utils_src_configure
-}