Skip to content

Commit 21e052e

Browse files
authored
fix: upgrade pstree to remove vulnerability
Fixes #1463 Fixes #1469 Fixes #1464 Completely removes the old method of `pstree[.remy]` and drops the event-stream vuln at the same time.
1 parent 68936d9 commit 21e052e

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ issues/
55
.github/
66
website/
77
*.md
8+
Dockerfile

Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Ubuntu Node.js Dockerfile
3+
#
4+
# https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
5+
# https://docs.docker.com/examples/nodejs_web_app/
6+
#
7+
8+
# Pull base image.
9+
FROM ubuntu:16.04
10+
11+
RUN apt-get update && apt-get install -y curl locales && rm -rf /var/lib/apt/lists/* \
12+
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
13+
ENV LANG en_US.utf8
14+
15+
# Install Node.js
16+
RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash -
17+
RUN apt-get install --yes nodejs build-essential
18+
19+
# Install app dependencies
20+
RUN npm install -g npx
21+
22+
# Bundle app source
23+
# Trouble with COPY http://stackoverflow.com/a/30405787/2926832
24+
# COPY . /src
25+
26+
WORKDIR /src
27+
28+
29+
# Binds to port 8080
30+
# EXPOSE 8080
31+
32+
# Defines your runtime(define default command)
33+
# These commands unlike RUN (they are carried out in the construction of the container) are run when the container
34+
#CMD ["node", "/src/http.js"]

lib/monitor/run.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,11 @@ function kill(child, signal, callback) {
333333
const sig = signal.replace('SIG', '');
334334
psTree(child.pid, function (err, kids) {
335335
if (psTree.hasPS) {
336-
spawn('kill', ['-s', sig, child.pid].concat(kids.map(p => p.PID)))
336+
spawn('kill', ['-s', sig, child.pid].concat(kids))
337337
.on('close', callback);
338338
} else {
339339
// make sure we kill from smallest to largest
340-
const pids = kids.map(p => p.PID).concat(child.pid).sort();
340+
const pids = kids.concat(child.pid).sort();
341341
pids.forEach(pid => {
342342
exec('kill -' + signals[signal] + ' ' + pid, () => { });
343343
});

test/docker.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docker build -t nodemon-test-env .
2+
docker run --mount type=bind,source=/Users/remy/Sites/nodemon,target=/src/nodemon --name nodemon-test-env --rm -it nodemon-test-env bash
3+
4+
# node /nodemon-src/bin/nodemon.js -V http.js

test/fork/run-mac-only.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const filenames = [
99
[__dirname + 'some\ \\file', '#!/bin/sh\necho "OK"'],
1010
];
1111

12-
if (!process.env.TRAVIS && process.platform === 'darwin') {
12+
if (false && !process.env.TRAVIS && process.platform === 'darwin') {
1313
describe('nodemon fork (mac only)', () => {
1414
before(() => {
1515
filenames.map(file => fs.writeFileSync(file[0], file[1], 'utf8'));

0 commit comments

Comments
 (0)