Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 2e21f61

Browse files
committed
Merge branch 'MiguelCastillo-master' (PR #5919)
2 parents 88dd296 + 552af74 commit 2e21f61

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/extensibility/node/package-validator.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,10 @@ function extractAndValidateFiles(zipPath, extractDir, options, callback) {
309309
});
310310

311311
unzipper.extract({
312-
path: extractDir
312+
path: extractDir,
313+
filter: function (file) {
314+
return file.type !== "SymbolicLink";
315+
}
313316
});
314317
}
315318

src/extensibility/node/spec/Installation.spec.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ var basicValidExtension = path.join(testFilesDirectory, "basic-valid-exten
5555
invalidZip = path.join(testFilesDirectory, "invalid-zip-file.zip"),
5656
missingPackageJSON = path.join(testFilesDirectory, "missing-package-json.zip"),
5757
missingPackageJSONUpdate = path.join(testFilesDirectory, "missing-package-json-update.zip"),
58-
missingPackageJSONRenamed = path.join(testFilesDirectory, "added-package-json-test", "missing-package-json.zip");
58+
missingPackageJSONRenamed = path.join(testFilesDirectory, "added-package-json-test", "missing-package-json.zip"),
59+
withSymlink = path.join(testFilesDirectory, "with-symlink.zip");
60+
5961

6062
describe("Package Installation", function () {
6163

@@ -315,4 +317,14 @@ describe("Package Installation", function () {
315317
});
316318
});
317319
});
320+
321+
it("should strip out symlinks in the zipfile", function (done) {
322+
ExtensionsDomain._cmdInstall(withSymlink, installDirectory, standardOptions, function (err, result) {
323+
expect(err).toBeNull();
324+
expect(result.errors.length).toEqual(0);
325+
expect(fs.existsSync(result.installedTo)).toBe(true);
326+
expect(fs.existsSync(path.join(result.installedTo, "bin", "foo"))).toBe(false);
327+
done();
328+
});
329+
});
318330
});
939 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)