Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Commit 6f46cad

Browse files
lachiehgregberge
authored andcommitted
fix(security): use which instead of whereis (#220)
1 parent 6ba6f00 commit 6f46cad

File tree

6 files changed

+879
-155
lines changed

6 files changed

+879
-155
lines changed
File renamed without changes.

packages/ssh-pool/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"dependencies": {
1111
"stream-line-wrapper": "^0.1.1",
1212
"tmp": "^0.0.33",
13-
"whereis": "^0.4.0"
13+
"which": "^1.3.1"
1414
}
1515
}

packages/ssh-pool/src/Connection.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22
import stdMocks from 'std-mocks'
33
import { exec } from 'child_process'
4-
import { __setPaths__ } from 'whereis'
4+
import { __setPaths__ } from 'which'
55
import * as util from './util'
66
import Connection from './Connection'
77

88
jest.mock('child_process')
9-
jest.mock('whereis')
9+
jest.mock('which')
1010
jest.mock('tmp')
1111

1212
describe('Connection', () => {

packages/ssh-pool/src/ConnectionPool.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { __setPaths__ } from 'whereis'
1+
import { __setPaths__ } from 'which'
22
import { exec } from 'child_process'
33
import * as util from './util'
44
import Connection from './Connection'
55
import ConnectionPool from './ConnectionPool'
66

7-
jest.mock('whereis')
7+
jest.mock('which')
88
jest.mock('child_process')
99

1010
describe('ConnectionPool', () => {

packages/ssh-pool/src/commands/rsync.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import whereis from 'whereis'
1+
import which from 'which'
22
import { wrapCommand, joinCommandArgs, requireArgs } from './util'
33

44
export async function isRsyncSupported() {
5-
return new Promise(resolve => whereis('rsync', err => resolve(!err)))
5+
return new Promise(resolve => which('rsync', err => resolve(!err)))
66
}
77

88
function formatExcludes(excludes) {

0 commit comments

Comments
 (0)