File tree 3 files changed +21
-3
lines changed
platform/utilityProcess/electron-main
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;
23
23
* path validation.
24
24
*/
25
25
export 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 117
117
process . enableUNCAccessChecks = false ;
118
118
}
119
119
120
+ function isUNCAccessRestrictionsDisabled ( ) {
121
+ if ( process . platform !== 'win32' ) {
122
+ return true ;
123
+ }
124
+
125
+ return process . enableUNCAccessChecks === false ;
126
+ }
127
+
120
128
return {
121
129
getUNCHostAllowlist,
122
130
addUNCHostToAllowlist,
123
131
getUNCHost,
124
- disableUNCAccessRestrictions
132
+ disableUNCAccessRestrictions,
133
+ isUNCAccessRestrictionsDisabled
125
134
} ;
126
135
}
127
136
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifec
17
17
import { removeDangerousEnvVariables } from 'vs/base/common/processes' ;
18
18
import { deepClone } from 'vs/base/common/objects' ;
19
19
import { isWindows } from 'vs/base/common/platform' ;
20
- import { getUNCHostAllowlist } from 'vs/base/node/unc' ;
20
+ import { isUNCAccessRestrictionsDisabled , getUNCHostAllowlist } from 'vs/base/node/unc' ;
21
21
22
22
export interface IUtilityProcessConfiguration {
23
23
@@ -259,7 +259,11 @@ export class UtilityProcess extends Disposable {
259
259
}
260
260
env [ 'VSCODE_CRASH_REPORTER_PROCESS_TYPE' ] = configuration . type ;
261
261
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
+ }
263
267
}
264
268
265
269
// Remove any environment variables that are not allowed
You can’t perform that action at this time.
0 commit comments