Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/commands/install/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function mockConstants(base: Config, mocks: Object, cb: (config: Config) =
// the Yarn environment.

const opts = {};

opts.binLinks = base.binLinks;
opts.cwd = base.cwd;
opts.globalFolder = base.globalFolder;
Expand Down
1 change: 1 addition & 0 deletions __tests__/commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export async function getFilesFromArchive(source, destination): Promise<Array<st
strip: 1,
dmode: 0o555, // all dirs should be readable
fmode: 0o444, // all files should be readable
chown: false, // don't chown. just leave as it is
}))
.on('finish', resolve)
.on('error', reject);
Expand Down
3 changes: 3 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ test:
- yarn build-dist
- node ./scripts/build-webpack.js
- ./scripts/build-deb.sh
# Test that installing as root works and that it also works
# behind a user namespace which Circle CI tests are run under
- sudo env "PATH=$PATH" bin/yarn install --force

deployment:
release:
Expand Down
1 change: 1 addition & 0 deletions src/fetchers/git-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default class GitFetcher extends BaseFetcher {
const untarStream = tarFs.extract(this.dest, {
dmode: 0o555, // all dirs should be readable
fmode: 0o444, // all files should be readable
chown: false, // don't chown. just leave as it is
});

const hashStream = new crypto.HashStream();
Expand Down
8 changes: 1 addition & 7 deletions src/fetchers/tarball-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as constants from '../constants.js';
import * as crypto from '../util/crypto.js';
import BaseFetcher from './base-fetcher.js';
import * as fsUtil from '../util/fs.js';
import ROOT_USER from '../util/root-user.js';

const invariant = require('invariant');
const path = require('path');
Expand Down Expand Up @@ -82,17 +81,12 @@ export default class TarballFetcher extends BaseFetcher {
strip: 1,
dmode: 0o555, // all dirs should be readable
fmode: 0o444, // all files should be readable
chown: false, // don't chown. just leave as it is
});

extractorStream
.pipe(untarStream)
.on('error', reject)
.on('entry', (entry: Object) => {
if (ROOT_USER) {
entry.props.uid = entry.uid = 0;
entry.props.gid = entry.gid = 0;
}
})
.on('finish', () => {
const expectHash = this.hash;
const actualHash = validateStream.getHash();
Expand Down