From 081287fc0a9494ac45c6ca5efdf164c77f835117 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Thu, 20 Sep 2018 10:06:04 +0200 Subject: Windows: add /nosizecheck switch to VeraCrypt Format that allows disabling check on file container size against available free space on target disk. This enables to workaround a bug in Microsoft Distributed File System (DFS) that report wrong free disk space (https://support.microsoft.com/en-us/help/177127/incorrect-disk-free-space-information-for-a-dfs-client-share) --- src/Format/Tcformat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 46ad2083..4274e377 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -178,6 +178,7 @@ int SysEncDetectHiddenSectors = -1; /* Whether the user wants us to detect and int SysEncDriveAnalysisStart; BOOL bDontVerifyRescueDisk = FALSE; BOOL bFirstSysEncResumeDone = FALSE; +BOOL bDontCheckFileContainerSize = FALSE; /* If true, we don't check if the given size of file container is smaller than the available size on the hosting disk */ int nMultiBoot = 0; /* The number of operating systems installed on the computer, according to the user. 0: undetermined, 1: one, 2: two or more */ volatile BOOL bHiddenVol = FALSE; /* If true, we are (or will be) creating a hidden volume. */ volatile BOOL bHiddenVolHost = FALSE; /* If true, we are (or will be) creating the host volume (called "outer") for a hidden volume. */ @@ -1541,7 +1542,7 @@ static void VerifySizeAndUpdate (HWND hwndDlg, BOOL bUpdate) { if (lTmp * i > (bHiddenVolHost ? TC_MAX_HIDDEN_VOLUME_HOST_SIZE : TC_MAX_VOLUME_SIZE)) bEnable = FALSE; - else if (!bDevice && (lTmp * i > nAvailableFreeSpace) && (!bIsSparseFilesSupportedByHost || bHiddenVolHost)) + else if (!bDevice && (lTmp * i > nAvailableFreeSpace) && !bDontCheckFileContainerSize && (!bIsSparseFilesSupportedByHost || bHiddenVolHost)) { // we check container size against available free space only when creating dynamic volume is not possible // which is the case if filesystem doesn't allow sparce file or if we are creating outer volume of a hidden volume @@ -8945,6 +8946,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) OptionSilent, OptionDynamic, OptionForce, + OptionNoSizeCheck, }; argument args[]= @@ -8965,6 +8967,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) { OptionSilent, L"/silent", NULL, FALSE }, { OptionDynamic, L"/dynamic", NULL, FALSE }, { OptionForce, L"/force", NULL, FALSE }, + { OptionNoSizeCheck, L"/nosizecheck", NULL, FALSE }, // Internal { CommandResumeSysEncLogOn, L"/acsysenc", L"/a", TRUE }, @@ -9313,6 +9316,10 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) bDontVerifyRescueDisk = TRUE; break; + case OptionNoSizeCheck: + bDontCheckFileContainerSize = TRUE; + break; + case OptionHistory: { wchar_t szTmp[8] = {0}; -- cgit v1.2.3