Allow to disable UNC access restrictions (fix #182055) (#182755)

This commit is contained in:
Benjamin Pasero
2023-05-17 22:32:43 +09:00
committed by GitHub
parent 578c3f0037
commit b4a2a006a3
7 changed files with 48 additions and 9 deletions
+6 -2
View File
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { app, BrowserWindow, dialog, protocol, session, Session, systemPreferences, WebFrameMain } from 'electron';
import { addUNCHostToAllowlist } from 'vs/base/node/unc';
import { addUNCHostToAllowlist, disableUNCAccessRestrictions } from 'vs/base/node/unc';
import { validatedIpcMain } from 'vs/base/parts/ipc/electron-main/ipcMain';
import { hostname, release } from 'os';
import { VSBuffer } from 'vs/base/common/buffer';
@@ -320,7 +320,11 @@ export class CodeApplication extends Disposable {
//#region UNC Host Allowlist (Windows)
if (isWindows) {
addUNCHostToAllowlist(this.configurationService.getValue('security.allowedUNCHosts'));
if (this.configurationService.getValue('security.restrictUNCAccess') === false) {
disableUNCAccessRestrictions();
} else {
addUNCHostToAllowlist(this.configurationService.getValue('security.allowedUNCHosts'));
}
}
//#endregion