From c7f69062db99ec454146753276957b017c1943cb Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 31 May 2025 16:06:30 +0200 Subject: [PATCH] =?UTF-8?q?Use=20=E2=80=9Cunmount=E2=80=9D=20instead=20of?= =?UTF-8?q?=20=E2=80=9Cdismount=E2=80=9D=20in=20scripts=20and=20in=20text?= =?UTF-8?q?=20shown=20to=20the=20user.=20(#1548)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tests/bench.bat | 2 +- contrib/EncryptData.ps1 | 14 +++++++------- src/Build/Packaging/debian-control/prerm | 2 +- src/Build/Packaging/rpm-control/prerm.sh | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/bench.bat b/Tests/bench.bat index 8725d7f6..778037b7 100644 --- a/Tests/bench.bat +++ b/Tests/bench.bat @@ -61,7 +61,7 @@ if not exist !mydriveletter!:\ ( goto :exit ) -"!VERACRYPT_PATH!" /dismount !mydriveletter! /silent /q +"!VERACRYPT_PATH!" /unmount !mydriveletter! /silent /q exit /b :: Subroutine to measure the time taken for a command to execute diff --git a/contrib/EncryptData.ps1 b/contrib/EncryptData.ps1 index c39311b1..a2ff55ab 100644 --- a/contrib/EncryptData.ps1 +++ b/contrib/EncryptData.ps1 @@ -6,7 +6,7 @@ .DESCRIPTION • Chooses an exFAT cluster size (auto or explicit). • Calculates the minimum container size using an iterative approach for FAT/Bitmap sizing, plus safety margin. - • Creates, mounts, copies, verifies, and dismounts – all guarded by -WhatIf/-Confirm (SupportsShouldProcess). + • Creates, mounts, copies, verifies, and unmounts – all guarded by -WhatIf/-Confirm (SupportsShouldProcess). • Finds VeraCrypt automatically or takes a -VeraCryptDir override. • Encryption and hash algorithms are parameters. • Password can be passed via SecureString prompt or pipeline. @@ -420,13 +420,13 @@ try { } finally { if (Test-Path variable:plainPassword) { Clear-Variable plainPassword -ErrorAction SilentlyContinue } if ($mounted) { - if ($PSCmdlet.ShouldProcess("Drive $driveLetter", "Dismount VeraCrypt volume")) { - Write-Verbose "Dismounting drive $driveLetter..." - $dismountArgs = @('/dismount', $driveLetter, '/force', '/quit', '/silent') - Start-Process -FilePath $VeraCryptExe -ArgumentList $dismountArgs -NoNewWindow -Wait -ErrorAction SilentlyContinue - Write-Verbose "Dismount command issued." + if ($PSCmdlet.ShouldProcess("Drive $driveLetter", "Unmount VeraCrypt volume")) { + Write-Verbose "Unmounting drive $driveLetter..." + $unmountArgs = @('/unmount', $driveLetter, '/force', '/quit', '/silent') + Start-Process -FilePath $VeraCryptExe -ArgumentList $unmountArgs -NoNewWindow -Wait -ErrorAction SilentlyContinue + Write-Verbose "Unmount command issued." } else { - Write-Host "Dismount skipped due to -WhatIf." + Write-Host "Unmount skipped due to -WhatIf." } } foreach($f in @($errFile,$mountFile) | Where-Object { $_ }) { diff --git a/src/Build/Packaging/debian-control/prerm b/src/Build/Packaging/debian-control/prerm index d2e3894e..532fd48a 100644 --- a/src/Build/Packaging/debian-control/prerm +++ b/src/Build/Packaging/debian-control/prerm @@ -2,7 +2,7 @@ V="$(mount | grep veracrypt_aux_mnt)" if [ ! -z "$V" ] then - echo "Error: All VeraCrypt volumes must be dismounted first." >&2 + echo "Error: All VeraCrypt volumes must be unmounted first." >&2 exit 1 else exit 0 diff --git a/src/Build/Packaging/rpm-control/prerm.sh b/src/Build/Packaging/rpm-control/prerm.sh index d2e3894e..532fd48a 100644 --- a/src/Build/Packaging/rpm-control/prerm.sh +++ b/src/Build/Packaging/rpm-control/prerm.sh @@ -2,7 +2,7 @@ V="$(mount | grep veracrypt_aux_mnt)" if [ ! -z "$V" ] then - echo "Error: All VeraCrypt volumes must be dismounted first." >&2 + echo "Error: All VeraCrypt volumes must be unmounted first." >&2 exit 1 else exit 0