diff options
author | Jertzukka <Jertzukka@gmail.com> | 2023-06-01 10:01:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 09:01:53 +0200 |
commit | 6ced991d98da9645b97ed6cf2556ae2a76085116 (patch) | |
tree | c822b6f81231aaf422d21ac6954e390e07a9c069 /src/Core/Unix | |
parent | 5efda52d516846274b695a8986090bd28b302ce0 (diff) | |
download | VeraCrypt-6ced991d98da9645b97ed6cf2556ae2a76085116.tar.gz VeraCrypt-6ced991d98da9645b97ed6cf2556ae2a76085116.zip |
Fix issues launching fsck via terminal on Linux (#1086)
Currently on a system without xterm or konsole (like fresh
Ubuntu install) the fsck check will not launch. Added
gnome-terminal as an alternative and fixed an issue where
konsole will always error out as --title and --caption are
no longer valid arguments.
Previously the error message was simply "xterm not found", so
new LangString LINUX_EX2MSG_TERMINALNOTFOUND was added to let the
user knows which programs they need to get the feature working.
Diffstat (limited to 'src/Core/Unix')
-rw-r--r-- | src/Core/Unix/CoreUnix.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/Core/Unix/CoreUnix.cpp b/src/Core/Unix/CoreUnix.cpp index 2dac4cb5..56382c18 100644 --- a/src/Core/Unix/CoreUnix.cpp +++ b/src/Core/Unix/CoreUnix.cpp @@ -78,10 +78,8 @@ namespace VeraCrypt if (stat("/usr/bin/konsole", &sb) == 0) { args.clear (); - args.push_back ("--title"); - args.push_back ("fsck"); - args.push_back ("--caption"); - args.push_back ("fsck"); + args.push_back ("-p"); + args.push_back ("tabtitle=fsck"); args.push_back ("-e"); args.push_back ("sh"); args.push_back ("-c"); @@ -91,8 +89,22 @@ namespace VeraCrypt Process::Execute ("konsole", args, 1000); } catch (TimeOut&) { } } + else if (stat("/usr/bin/gnome-terminal", &sb) == 0 && stat("/usr/bin/dbus-launch", &sb) == 0) + { + args.clear (); + args.push_back ("--title"); + args.push_back ("fsck"); + args.push_back ("--"); + args.push_back ("sh"); + args.push_back ("-c"); + args.push_back (xargs); + try + { + Process::Execute ("gnome-terminal", args, 1000); + } catch (TimeOut&) { } + } else - throw; + throw TerminalNotFound(); } #endif } |