mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user