Files
nodejs14/nodejs-libpath.patch
Adam Majer e682f4f498 - update to 14.19.0:
* crypto: make FIPS related options always available
  * deps: deps: upgrade npm to 6.14.16
    + CVE-2021-23343 - ReDoS via splitDeviceRe, splitTailRe and
      splitPathRe (bsc#1192153)
    + CVE-2021-23343 - node-tar: Insufficient symlink protection
      allowing arbitrary file creation and overwrite (bsc#1191963)
    + CVE-2021-32804 - node-tar: Insufficient absolute path sanitization
      allowing arbitrary file creation and overwrite (bsc#1191962)
    + CVE-2021-3918 - json-schema is vulnerable to Improperly
      Controlled Modification of Object Prototype Attributes (bsc#1192696)
  * module: support pattern trailers
  * src: make napi_create_reference accept symbol
- CVE-2021-3807.patch: node-ansi-regex: Regular expression
  denial of service (ReDoS) matching ANSI escape codes
  (bsc#1192154, CVE-2021-3807)
- versioned.patch, nodejs-libpath.patch: refreshed

OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs14?expand=0&rev=89
2022-02-16 16:28:10 +00:00

65 lines
2.4 KiB
Diff

Index: node-v14.19.0/tools/install.py
===================================================================
--- node-v14.19.0.orig/tools/install.py
+++ node-v14.19.0/tools/install.py
@@ -7,6 +7,8 @@ import errno
import os
import shutil
import sys
+from distutils import sysconfig
+import re
# set at init time
node_prefix = '/usr/local' # PREFIX variable from Makefile
@@ -65,6 +67,10 @@ def try_copy(path, dst):
try_unlink(target_path) # prevent ETXTBSY errors
return shutil.copy2(source_path, target_path)
+def libdir():
+ libdir_fq = sysconfig.get_config_var("LIBDIR")
+ return re.sub("^" + re.escape(node_prefix + "/"), "", libdir_fq)
+
def try_remove(path, dst):
source_path, target_path = mkpaths(path, dst)
print('removing %s' % target_path)
@@ -80,7 +86,7 @@ def uninstall(paths, dst):
try_remove(path, dst)
def package_files(action, name, bins):
- target_path = 'lib/node_modules/' + name + '/'
+ target_path = libdir() + '/node_modules/' + name + '/'
# don't install npm if the target path is a symlink, it probably means
# that a dev version of npm is installed there
@@ -100,7 +106,7 @@ def package_files(action, name, bins):
if action == uninstall:
action([link_path], 'bin/' + bin_name)
elif action == install:
- try_symlink('../lib/node_modules/' + name + '/' + bin_target, link_path)
+ try_symlink('../' + libdir() + '/node_modules/' + name + '/' + bin_target, link_path)
else:
assert 0 # unhandled action type
@@ -148,7 +154,7 @@ def files(action):
action([output_prefix + output_file], 'lib/' + output_file)
if 'true' == variables.get('node_use_dtrace'):
- action(['out/Release/node.d'], 'lib/dtrace/node.d')
+ action(['out/Release/node.d'], sysconfig.get_config_var("LIB") + '/dtrace/node.d')
# behave similarly for systemtap
action(['src/node.stp'], 'share/systemtap/tapset/')
Index: node-v14.19.0/lib/internal/modules/cjs/loader.js
===================================================================
--- node-v14.19.0.orig/lib/internal/modules/cjs/loader.js
+++ node-v14.19.0/lib/internal/modules/cjs/loader.js
@@ -1202,7 +1202,7 @@ Module._initPaths = function() {
path.resolve(process.execPath, '..') :
path.resolve(process.execPath, '..', '..');
- let paths = [path.resolve(prefixDir, 'lib', 'node')];
+ let paths = ['/usr/lib/node'];
if (homeDir) {
ArrayPrototypeUnshift(paths, path.resolve(homeDir, '.node_libraries'));