diff --git a/.gitignore b/.gitignore index 5529c49..09a0bd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ SOURCES/icu4c-67_1-src.tgz -SOURCES/node-v12.18.2-stripped.tar.gz +SOURCES/node-v12.18.4-stripped.tar.gz diff --git a/.nodejs.metadata b/.nodejs.metadata index b816f66..76a9a3f 100644 --- a/.nodejs.metadata +++ b/.nodejs.metadata @@ -1,2 +1,2 @@ 6822a4a94324d1ba591b3e8ef084e4491af253c1 SOURCES/icu4c-67_1-src.tgz -b8955ce8e33b4c1cfdd4c5be22f70f3419ce63df SOURCES/node-v12.18.2-stripped.tar.gz +31bb163dc0d11a30767ce9b71f1283d9b8d93903 SOURCES/node-v12.18.4-stripped.tar.gz diff --git a/SOURCES/0001-Disable-running-gyp-on-shared-deps.patch b/SOURCES/0001-Disable-running-gyp-on-shared-deps.patch index 79dc997..4d59d71 100644 --- a/SOURCES/0001-Disable-running-gyp-on-shared-deps.patch +++ b/SOURCES/0001-Disable-running-gyp-on-shared-deps.patch @@ -1,25 +1,26 @@ -From 4509b10cbe5d22216a7880cc7fb6bd5f92b18018 Mon Sep 17 00:00:00 2001 +From 641730c7d1322dacd8e1020ec0753795d01200f0 Mon Sep 17 00:00:00 2001 From: Zuzana Svetlikova Date: Thu, 27 Apr 2017 14:25:42 +0200 -Subject: [PATCH 1/5] Disable running gyp on shared deps +Subject: [PATCH] Disable running gyp on shared deps +Signed-off-by: rpm-build --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile -index 56f5358..f289f25 100644 +index 32a8a6c..f44f88a 100644 --- a/Makefile +++ b/Makefile @@ -141,7 +141,7 @@ test-code-cache: with-code-cache echo "'test-code-cache' target is a noop" - + out/Makefile: config.gypi common.gypi node.gyp \ - deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp \ + deps/http_parser/http_parser.gyp \ tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \ tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp $(PYTHON) tools/gyp_node.py -f make --- -2.24.1 +-- +2.26.2 diff --git a/SOURCES/0003-dot-prop-patch-4.2.0-with-fixes-for-CVE-2020-8116.patch b/SOURCES/0003-dot-prop-patch-4.2.0-with-fixes-for-CVE-2020-8116.patch new file mode 100644 index 0000000..b078f92 --- /dev/null +++ b/SOURCES/0003-dot-prop-patch-4.2.0-with-fixes-for-CVE-2020-8116.patch @@ -0,0 +1,106 @@ +From 9473adba9cba6767e8e506f8f19e0ff8f66920be Mon Sep 17 00:00:00 2001 +From: Marco Carini +Date: Mon, 3 Aug 2020 17:16:07 -0500 +Subject: [PATCH] dot-prop: patch 4.2.0 with fixes for CVE-2020-8116 + +Adjusted from +https://github.com/sindresorhus/dot-prop/commit/c914124f418f55edea27928e89c94d931babe587.patch + +Signed-off-by: rpm-build +--- + deps/npm/node_modules/dot-prop/index.js | 18 ++++++++++++++++++ + deps/npm/node_modules/dot-prop/package.json | 6 +++--- + deps/npm/node_modules/dot-prop/readme.md | 2 ++ + 3 files changed, 23 insertions(+), 3 deletions(-) + +diff --git a/deps/npm/node_modules/dot-prop/index.js b/deps/npm/node_modules/dot-prop/index.js +index 15282bb..189831c 100644 +--- a/deps/npm/node_modules/dot-prop/index.js ++++ b/deps/npm/node_modules/dot-prop/index.js +@@ -1,6 +1,14 @@ + 'use strict'; + const isObj = require('is-obj'); + ++const disallowedKeys = [ ++ '__proto__', ++ 'prototype', ++ 'constructor' ++]; ++ ++const isValidPath = pathSegments => !pathSegments.some(segment => disallowedKeys.includes(segment)); ++ + function getPathSegments(path) { + const pathArr = path.split('.'); + const parts = []; +@@ -16,6 +24,10 @@ function getPathSegments(path) { + parts.push(p); + } + ++ if (!isValidPath(parts)) { ++ return []; ++ } ++ + return parts; + } + +@@ -26,6 +38,9 @@ module.exports = { + } + + const pathArr = getPathSegments(path); ++ if (pathArr.length === 0) { ++ return; ++ } + + for (let i = 0; i < pathArr.length; i++) { + if (!Object.prototype.propertyIsEnumerable.call(obj, pathArr[i])) { +@@ -58,6 +73,9 @@ module.exports = { + + const root = obj; + const pathArr = getPathSegments(path); ++ if (pathArr.length === 0) { ++ return; ++ } + + for (let i = 0; i < pathArr.length; i++) { + const p = pathArr[i]; +diff --git a/deps/npm/node_modules/dot-prop/package.json b/deps/npm/node_modules/dot-prop/package.json +index 40fefa3..93daf7d 100644 +--- a/deps/npm/node_modules/dot-prop/package.json ++++ b/deps/npm/node_modules/dot-prop/package.json +@@ -37,9 +37,9 @@ + "deprecated": false, + "description": "Get, set, or delete a property from a nested object using a dot path", + "devDependencies": { +- "ava": "*", ++ "ava": "1.4.1", + "matcha": "^0.7.0", +- "xo": "*" ++ "xo": "0.24.0" + }, + "engines": { + "node": ">=4" +@@ -73,7 +73,7 @@ + "bench": "matcha bench.js", + "test": "xo && ava" + }, +- "version": "4.2.0", ++ "version": "4.2.1", + "xo": { + "esnext": true + } +diff --git a/deps/npm/node_modules/dot-prop/readme.md b/deps/npm/node_modules/dot-prop/readme.md +index fab3b7a..0e18f78 100644 +--- a/deps/npm/node_modules/dot-prop/readme.md ++++ b/deps/npm/node_modules/dot-prop/readme.md +@@ -85,6 +85,8 @@ Path of the property in the object, using `.` to separate each nested key. + + Use `\\.` if you have a `.` in the key. + ++The following path components are invalid and results in `undefined` being returned: `__proto__`, `prototype`, `constructor`. ++ + #### value + + Type: `any` +-- +2.26.2 + diff --git a/SPECS/nodejs.spec b/SPECS/nodejs.spec index a45a691..bbaa92f 100644 --- a/SPECS/nodejs.spec +++ b/SPECS/nodejs.spec @@ -1,6 +1,10 @@ %global with_debug 0 %global with_libs 0 +# set to 1 for RHEL >= 8.3 +# RHBZ#1856776 - brotli needed for nodejs-devel is not available +%bcond_with shared_brotli + # PowerPC, s390x and aarch64 segfault during Debug builds # https://github.com/nodejs/node/issues/20642 %ifarch %{power64} s390x aarch64 @@ -14,7 +18,7 @@ # This is used by both the nodejs package and the npm subpackage thar # has a separate version - the name is special so that rpmdev-bumpspec # will bump this rather than adding .1 to the end. -%global baserelease 1 +%global baserelease 2 %{?!_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -26,7 +30,7 @@ %global nodejs_epoch 1 %global nodejs_major 12 %global nodejs_minor 18 -%global nodejs_patch 2 +%global nodejs_patch 4 %global nodejs_abi %{nodejs_major}.%{nodejs_minor} %if %{?with_libs} == 1 # nodejs_soversion - from NODE_MODULE_VERSION in src/node_version.h @@ -65,8 +69,8 @@ # llhttp - from deps/llhttp/include/llhttp.h %global llhttp_major 2 -%global llhttp_minor 0 -%global llhttp_patch 4 +%global llhttp_minor 1 +%global llhttp_patch 2 %global llhttp_version %{llhttp_major}.%{llhttp_minor}.%{llhttp_patch} # libuv - from deps/uv/include/uv/version.h @@ -102,7 +106,7 @@ %global npm_epoch 1 %global npm_major 6 %global npm_minor 14 -%global npm_patch 5 +%global npm_patch 6 %global npm_version %{npm_major}.%{npm_minor}.%{npm_patch} # uvwasi - from deps/uvwasi/include/uvwasi.h @@ -117,6 +121,12 @@ %global histogram_patch 7 %global histogram_version %{histogram_major}.%{histogram_minor}.%{histogram_patch} +# brotli - from deps/brotli/c/common/version.h +%global brotli_major 1 +%global brotli_minor 0 +%global brotli_patch 7 +%global brotli_version %{brotli_major}.%{brotli_minor}.%{brotli_patch} + # In order to avoid needing to keep incrementing the release version for the # main package forever, we will just construct one for npm that is guaranteed # to increment safely. Changing this can only be done during an update when the @@ -157,10 +167,12 @@ Patch1: 0001-Disable-running-gyp-on-shared-deps.patch Patch2: 0002-Install-both-binaries-and-use-libdir.patch %endif +# Fix for CVE-2020-8116 +Patch3: 0003-dot-prop-patch-4.2.0-with-fixes-for-CVE-2020-8116.patch + BuildRequires: python2-devel BuildRequires: python3-devel BuildRequires: zlib-devel -BuildRequires: brotli-devel BuildRequires: gcc >= 6.3.0 BuildRequires: gcc-c++ >= 6.3.0 # needed to generate bundled provides for npm dependencies @@ -180,12 +192,18 @@ BuildRequires: libuv-devel >= 1:%{libuv_version} Requires: libuv >= 1:%{libuv_version} BuildRequires: libnghttp2-devel >= %{nghttp2_version} Requires: libnghttp2 >= %{nghttp2_version} +%endif # Temporarily bundle http-parser and llhttp because the latter # isn't packaged yet and they are controlled by the same # configure flag. Provides: bundled(http-parser) = %{http_parser_version} Provides: bundled(llhttp) = %{llhttp_version} + +%if %{with shared_brotli} +BuildRequires: brotli-devel +%else +Provides: bundled(brotli) = %{brotli_version} %endif BuildRequires: openssl-devel @@ -272,7 +290,9 @@ Group: Development/Languages Requires: %{name}%{?_isa} = %{epoch}:%{nodejs_version}-%{nodejs_release}%{?dist} Requires: openssl-devel%{?_isa} Requires: zlib-devel%{?_isa} +%if %{with shared_brotli} Requires: brotli-devel%{?_isa} +%endif Requires: nodejs-packaging %if %{with bootstrap} @@ -373,7 +393,9 @@ The API documentation for the Node.js JavaScript runtime. # remove bundled dependencies that we aren't building rm -rf deps/zlib +%if %{with shared_brotli} rm -rf deps/brotli +%endif # Replace any instances of unversioned python' with python2 pathfix.py -i %{__python2} -pn $(find -type f ! -name "*.js") @@ -417,11 +439,40 @@ export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" export LDFLAGS="%{build_ldflags}" -%if %{?with_libs} == 1 +# we're not building with libs in RHEL, so let's comment this out +# for the sake of readability +#%if %{?with_libs} == 1 +#%if %{with bootstrap} +#./configure --prefix=%{_prefix} \ +# --shared \ +# --libdir=%{_lib} \ +# --shared-openssl \ +# --shared-zlib \ +# --shared-brotli \ +# --without-dtrace \ +# --with-intl=small-icu \ +# --debug-nghttp2 \ +# --openssl-use-def-ca-store +#%else +#./configure --prefix=%{_prefix} \ +# --shared \ +# --libdir=%{_lib} \ +# --shared-openssl \ +# --shared-zlib \ +# --shared-brotli \ +# --shared-libuv \ +# --shared-nghttp2 \ +# --with-dtrace \ +# --with-intl=%{icu_flag} \ +# --with-icu-default-data-dir=%{icudatadir} \ +# --debug-nghttp2 \ +# --openssl-use-def-ca-store +#%endif + +%if %{with shared_brotli} + %if %{with bootstrap} ./configure --prefix=%{_prefix} \ - --shared \ - --libdir=%{_lib} \ --shared-openssl \ --shared-zlib \ --shared-brotli \ @@ -431,8 +482,6 @@ export LDFLAGS="%{build_ldflags}" --openssl-use-def-ca-store %else ./configure --prefix=%{_prefix} \ - --shared \ - --libdir=%{_lib} \ --shared-openssl \ --shared-zlib \ --shared-brotli \ @@ -443,13 +492,14 @@ export LDFLAGS="%{build_ldflags}" --with-icu-default-data-dir=%{icudatadir} \ --debug-nghttp2 \ --openssl-use-def-ca-store -%endif -%else +%endif # if bootstrap + +%else # if shared_brotli == 0 + %if %{with bootstrap} ./configure --prefix=%{_prefix} \ --shared-openssl \ --shared-zlib \ - --shared-brotli \ --without-dtrace \ --with-intl=small-icu \ --debug-nghttp2 \ @@ -458,7 +508,6 @@ export LDFLAGS="%{build_ldflags}" ./configure --prefix=%{_prefix} \ --shared-openssl \ --shared-zlib \ - --shared-brotli \ --shared-libuv \ --shared-nghttp2 \ --with-dtrace \ @@ -466,7 +515,8 @@ export LDFLAGS="%{build_ldflags}" --with-icu-default-data-dir=%{icudatadir} \ --debug-nghttp2 \ --openssl-use-def-ca-store -%endif +%endif # if bootstrap + %endif %if %{?with_debug} == 1 @@ -817,6 +867,13 @@ end %changelog +* Mon Oct 05 2020 Zuzana Svetlikova - 1:12.18.4-2 +- Resolves: RHBZ#1883966 - nodejs-devel not installable due to missing brotli +- Some spec fixes + +* Tue Sep 22 2020 Jan Staněk - 12.18.4-1 +- Rebase to 12.18.4 + * Tue Jun 30 2020 Jan Staněk - 12.18.2-1 - Rebase to 12.18.2