diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Core/Unix/CoreService.cpp | 6 | ||||
-rw-r--r-- | src/ExpandVolume/ExpandVolume.vcxproj | 2 | ||||
-rw-r--r-- | src/SetupDLL/SetupDLL.vcxproj | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/Core/Unix/CoreService.cpp b/src/Core/Unix/CoreService.cpp index dc2f4e6b..9531069a 100644 --- a/src/Core/Unix/CoreService.cpp +++ b/src/Core/Unix/CoreService.cpp @@ -297,41 +297,45 @@ namespace VeraCrypt if (request.RequiresElevation()) { request.ElevateUserPrivileges = true; request.FastElevation = !ElevatedServiceAvailable; while (!ElevatedServiceAvailable) { // Test if the user has an active "sudo" session. bool authCheckDone = false; if (!Core->GetUseDummySudoPassword ()) { // We are using -n to avoid prompting the user for a password. // We are redirecting stderr to stdout and discarding both to avoid any output. // This approach also works on newer macOS versions (12.0 and later). std::string errorMsg; string sudoAbsolutePath = Process::FindSystemBinary("sudo", errorMsg); if (sudoAbsolutePath.empty()) throw SystemException(SRC_POS, errorMsg); - std::string popenCommand = sudoAbsolutePath + " -n true > /dev/null 2>&1"; // We redirect stderr to stdout (2>&1) to be able to catch the result of the command + string trueAbsolutePath = Process::FindSystemBinary("true", errorMsg); + if (trueAbsolutePath.empty()) + throw SystemException(SRC_POS, errorMsg); + + std::string popenCommand = sudoAbsolutePath + " -n " + trueAbsolutePath + " > /dev/null 2>&1"; // We redirect stderr to stdout (2>&1) to be able to catch the result of the command FILE* pipe = popen(popenCommand.c_str(), "r"); if (pipe) { // We only care about the exit code char buf[128]; while (!feof(pipe)) { if (fgets(buf, sizeof(buf), pipe) == NULL) break; } int status = pclose(pipe); pipe = NULL; authCheckDone = true; // If exit code != 0, user does NOT have an active session => request password if (status != 0) { (*AdminPasswordCallback)(request.AdminPassword); } diff --git a/src/ExpandVolume/ExpandVolume.vcxproj b/src/ExpandVolume/ExpandVolume.vcxproj index fa553e62..2f06870e 100644 --- a/src/ExpandVolume/ExpandVolume.vcxproj +++ b/src/ExpandVolume/ExpandVolume.vcxproj @@ -392,41 +392,41 @@ copy $(TargetPath) "..\Debug\Setup Files\VeraCryptExpander-arm64.exe" >NUL: <TypeLibraryName>$(SolutionDir)/Mount/$(ProjectName).tlb</TypeLibraryName> <OutputDirectory> </OutputDirectory> </Midl> <ClCompile> <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\pkcs11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>VCEXPANDER;VC_EFI_CUSTOM_MODE;TCMOUNT;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <BufferSecurityCheck>true</BufferSecurityCheck> <PrecompiledHeader> </PrecompiledHeader> <AssemblerOutput>All</AssemblerOutput> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4311;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> </ClCompile> <Link> - <AdditionalDependencies>..\Crypto\AMD64\Release\crypto.lib;..\Common\AMD64\Release\Zip.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>..\Crypto\ARM64\Release\crypto.lib;..\Common\ARM64\Release\Zip.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)VeraCryptExpander.exe</OutputFile> <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> <DelayLoadDLLs>mpr.dll;bcrypt.dll;user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;shlwapi.dll;setupapi.dll;wintrust.dll;comctl32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <GenerateDebugInformation>true</GenerateDebugInformation> <GenerateMapFile>true</GenerateMapFile> <SubSystem>Windows</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> <RandomizedBaseAddress>true</RandomizedBaseAddress> <DataExecutionPrevention>true</DataExecutionPrevention> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> </Link> <Manifest> <AdditionalManifestFiles>VeraCryptExpander.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> </Manifest> <PostBuildEvent> <Command>copy $(TargetPath) "..\Release\Setup Files\VeraCryptExpander-arm64.exe"</Command> </PostBuildEvent> <ResourceCompile> <PreprocessorDefinitions>VC_EFI_CUSTOM_MODE;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions> diff --git a/src/SetupDLL/SetupDLL.vcxproj b/src/SetupDLL/SetupDLL.vcxproj index af0d6fb8..576738d4 100644 --- a/src/SetupDLL/SetupDLL.vcxproj +++ b/src/SetupDLL/SetupDLL.vcxproj @@ -139,55 +139,55 @@ copy Debug\VeraCryptSetup.dll "..\Debug\Setup Files\VeraCryptSetup.dll" >NUL: <SubSystem>Windows</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> <RandomizedBaseAddress>true</RandomizedBaseAddress> <DataExecutionPrevention>true</DataExecutionPrevention> <TargetMachine>MachineX86</TargetMachine> <ModuleDefinitionFile>SetupDLL.def</ModuleDefinitionFile> </Link> <Manifest> <AdditionalManifestFiles>Setup.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> </Manifest> <PostBuildEvent> <Command>copy Release\VeraCryptSetup.dll "..\Release\Setup Files\VeraCryptSetup.dll"</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCustomEFI|Win32'"> <ClCompile> <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions> <Optimization>MaxSpeed</Optimization> <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>SETUP;VC_EFI_CUSTOM_MODE;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>SETUP_DLL;SETUP;VC_EFI_CUSTOM_MODE;WIN32;HAVE_CONFIG_H;ZIP_STATIC;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <BufferSecurityCheck>true</BufferSecurityCheck> <PrecompiledHeader> </PrecompiledHeader> <AssemblerOutput>All</AssemblerOutput> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <WarningLevel>Level4</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4057;4100;4127;4201;4505;4701;4706;4131;%(DisableSpecificWarnings)</DisableSpecificWarnings> </ClCompile> <Link> <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions> <AdditionalDependencies>version.lib;msi.lib;mpr.lib;..\Common\Release\Zip.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies)</AdditionalDependencies> - <OutputFile>$(OutDir)VeraCryptSetup.exe</OutputFile> + <OutputFile>$(OutDir)VeraCryptSetup.dll</OutputFile> <UACExecutionLevel>RequireAdministrator</UACExecutionLevel> <DelayLoadDLLs>mpr.dll;bcrypt.dll;user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;shlwapi.dll;setupapi.dll;wintrust.dll;comctl32.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <GenerateDebugInformation>true</GenerateDebugInformation> <GenerateMapFile>true</GenerateMapFile> <SubSystem>Windows</SubSystem> <OptimizeReferences>true</OptimizeReferences> <EnableCOMDATFolding>true</EnableCOMDATFolding> <RandomizedBaseAddress>true</RandomizedBaseAddress> <DataExecutionPrevention>true</DataExecutionPrevention> <TargetMachine>MachineX86</TargetMachine> </Link> <Manifest> <AdditionalManifestFiles>Setup.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles> </Manifest> <PostBuildEvent> <Command>copy Release\VeraCryptSetup.dll "..\Release\Setup Files\VeraCryptSetup.dll"</Command> </PostBuildEvent> <ResourceCompile> <PreprocessorDefinitions>VC_EFI_CUSTOM_MODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> </ResourceCompile> |