File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
platform/utilityProcess/electron-main Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,8 @@ export function addUNCHostToAllowlist(allowedHost: string | string[]): void;
2323 * path validation.
2424 */
2525export function disableUNCAccessRestrictions ( ) : void ;
26+
27+ /**
28+ * Whether UNC Host allow list in node.js is disabled.
29+ */
30+ export function isUNCAccessRestrictionsDisabled ( ) : boolean ;
Original file line number Diff line number Diff line change 117117 process . enableUNCAccessChecks = false ;
118118 }
119119
120+ function isUNCAccessRestrictionsDisabled ( ) {
121+ if ( process . platform !== 'win32' ) {
122+ return true ;
123+ }
124+
125+ return process . enableUNCAccessChecks === false ;
126+ }
127+
120128 return {
121129 getUNCHostAllowlist,
122130 addUNCHostToAllowlist,
123131 getUNCHost,
124- disableUNCAccessRestrictions
132+ disableUNCAccessRestrictions,
133+ isUNCAccessRestrictionsDisabled
125134 } ;
126135 }
127136
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifec
1717import { removeDangerousEnvVariables } from 'vs/base/common/processes' ;
1818import { deepClone } from 'vs/base/common/objects' ;
1919import { isWindows } from 'vs/base/common/platform' ;
20- import { getUNCHostAllowlist } from 'vs/base/node/unc' ;
20+ import { isUNCAccessRestrictionsDisabled , getUNCHostAllowlist } from 'vs/base/node/unc' ;
2121
2222export interface IUtilityProcessConfiguration {
2323
@@ -259,7 +259,11 @@ export class UtilityProcess extends Disposable {
259259 }
260260 env [ 'VSCODE_CRASH_REPORTER_PROCESS_TYPE' ] = configuration . type ;
261261 if ( isWindows ) {
262- env [ 'NODE_UNC_HOST_ALLOWLIST' ] = getUNCHostAllowlist ( ) . join ( '\\' ) ;
262+ if ( isUNCAccessRestrictionsDisabled ( ) ) {
263+ env [ 'NODE_DISABLE_UNC_ACCESS_CHECKS' ] = '1' ;
264+ } else {
265+ env [ 'NODE_UNC_HOST_ALLOWLIST' ] = getUNCHostAllowlist ( ) . join ( '\\' ) ;
266+ }
263267 }
264268
265269 // Remove any environment variables that are not allowed
You can’t perform that action at this time.
0 commit comments