From 1f9bdb1024edbb892df97d757814646edf6a3459 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Wed, 22 Feb 2023 15:54:13 +0000 Subject: [PATCH] - sysctl.patch: unit test fixes OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs18?expand=0&rev=49 --- nodejs18.changes | 1 + nodejs18.spec | 4 ++++ sysctl.patch | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 sysctl.patch diff --git a/nodejs18.changes b/nodejs18.changes index a84d7c0..f428211 100644 --- a/nodejs18.changes +++ b/nodejs18.changes @@ -18,6 +18,7 @@ Wed Feb 22 13:59:45 UTC 2023 - Adam Majer (bsc#1208413, bsc#1208485, CVE-2023-24807, CVE-2023-23936) - versioned.patch: refreshed +- sysctl.patch: unit test fixes ------------------------------------------------------------------- Fri Feb 3 11:43:02 UTC 2023 - Adam Majer diff --git a/nodejs18.spec b/nodejs18.spec index 4177918..f1bd3f0 100644 --- a/nodejs18.spec +++ b/nodejs18.spec @@ -172,6 +172,7 @@ Patch200: versioned.patch Patch305: qemu_timeouts_arches.patch Patch307: s390.patch +Patch309: sysctl.patch BuildRequires: pkg-config BuildRequires: fdupes @@ -378,6 +379,8 @@ Provides: bundled(llhttp) = 6.0.10 Provides: bundled(ngtcp2) = 0.8.1 Provides: bundled(base64) = 0.5.0 Provides: bundled(simdutf) = 3.1.0 +# bundled url-ada parser, not ada + Provides: bundled(node-acorn) = 8.8.1 Provides: bundled(node-acorn-walk) = 8.2.0 @@ -706,6 +709,7 @@ popd %patch305 -p1 %patch307 -p1 +%patch309 -p1 %if %{node_version_number} == 12 # minimist security update - patch50 diff --git a/sysctl.patch b/sysctl.patch new file mode 100644 index 0000000..c2029b9 --- /dev/null +++ b/sysctl.patch @@ -0,0 +1,18 @@ +Index: node-v19.5.0/test/parallel/test-cluster-bind-privileged-port.js +=================================================================== +--- node-v19.5.0.orig/test/parallel/test-cluster-bind-privileged-port.js ++++ node-v19.5.0/test/parallel/test-cluster-bind-privileged-port.js +@@ -24,11 +24,10 @@ const common = require('../common'); + const assert = require('assert'); + const cluster = require('cluster'); + const net = require('net'); +-const { execSync } = require('child_process'); ++const { readFileSync } = require('fs'); + + if (common.isLinux) { +- const sysctlOutput = execSync('sysctl net.ipv4.ip_unprivileged_port_start').toString(); +- const unprivilegedPortStart = parseInt(sysctlOutput.split(' ')[2], 10); ++ const unprivilegedPortStart = parseInt(readFileSync('/proc/sys/net/ipv4/ip_unprivileged_port_start')); + if (unprivilegedPortStart <= 42) { + common.skip('Port 42 is unprivileged'); + }