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

Commit

Permalink
fix(security): use which instead of whereis (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachieh authored and gregberge committed Nov 4, 2018
1 parent 6ba6f00 commit 6f46cad
Show file tree
Hide file tree
Showing 6 changed files with 879 additions and 155 deletions.
2 changes: 1 addition & 1 deletion packages/ssh-pool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"dependencies": {
"stream-line-wrapper": "^0.1.1",
"tmp": "^0.0.33",
"whereis": "^0.4.0"
"which": "^1.3.1"
}
}
4 changes: 2 additions & 2 deletions packages/ssh-pool/src/Connection.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable import/no-extraneous-dependencies */
import stdMocks from 'std-mocks'
import { exec } from 'child_process'
import { __setPaths__ } from 'whereis'
import { __setPaths__ } from 'which'
import * as util from './util'
import Connection from './Connection'

jest.mock('child_process')
jest.mock('whereis')
jest.mock('which')
jest.mock('tmp')

describe('Connection', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/ssh-pool/src/ConnectionPool.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { __setPaths__ } from 'whereis'
import { __setPaths__ } from 'which'
import { exec } from 'child_process'
import * as util from './util'
import Connection from './Connection'
import ConnectionPool from './ConnectionPool'

jest.mock('whereis')
jest.mock('which')
jest.mock('child_process')

describe('ConnectionPool', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/ssh-pool/src/commands/rsync.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import whereis from 'whereis'
import which from 'which'
import { wrapCommand, joinCommandArgs, requireArgs } from './util'

export async function isRsyncSupported() {
return new Promise(resolve => whereis('rsync', err => resolve(!err)))
return new Promise(resolve => which('rsync', err => resolve(!err)))
}

function formatExcludes(excludes) {
Expand Down
Loading

0 comments on commit 6f46cad

Please sign in to comment.