unc - adopt setting and handling of allow list (#181916)

* unc - adopt setting and handling of allow list (#5)

* unc - adopt setting and handling of allow list

* unc - set allow list on server too

* unc - pick our patched node.js for now

* bump electron

* unc - ignore sync is not needed with machine scope

* unc - use process set directly

* 🆙 22.5.1

* fix compile

---------

Co-authored-by: Benjamin Pasero <Benjamin.Pasero@microsoft.com>
This commit is contained in:
Sandeep Somavarapu
2023-05-09 19:52:08 +02:00
committed by GitHub
co-authored by Benjamin Pasero
parent 1f8d8e965a
commit d4632bb740
17 changed files with 199 additions and 18 deletions
+13 -1
View File
@@ -21,10 +21,12 @@ import { getStdinFilePath, hasStdinWithoutTty, readFromStdin, stdinDataListener
import { createWaitMarkerFileSync } from 'vs/platform/environment/node/wait';
import product from 'vs/platform/product/common/product';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { randomPath } from 'vs/base/common/extpath';
import { isUNC, randomPath } from 'vs/base/common/extpath';
import { Utils } from 'vs/platform/profiling/common/profiling';
import { FileAccess } from 'vs/base/common/network';
import { cwd } from 'vs/base/common/process';
import { addUNCHostToAllowlist } from 'vs/base/node/unc';
import { URI } from 'vs/base/common/uri';
function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean {
return !!argv['install-source']
@@ -117,6 +119,16 @@ export async function main(argv: string[]): Promise<any> {
const source = args._[0];
const target = args._[1];
// Windows: set the paths as allowed UNC paths given
// they are explicitly provided by the user as arguments
if (isWindows) {
for (const path of [source, target]) {
if (isUNC(path)) {
addUNCHostToAllowlist(URI.file(path).authority);
}
}
}
// Validate
if (
!source || !target || source === target || // make sure source and target are provided and are not the same