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)

This commit is contained in:
Mounir IDRASSI 2018-09-20 10:06:04 +02:00
parent 2455c03e0d
commit 081287fc0a
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC
1 changed files with 8 additions and 1 deletions

View File

@ -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};