Skip to content

Commit 1312c53

Browse files
committed
Linux: fix crash when displaying Admin password dialog. Fix failure of Github action by using builtin GITHUB_TOKEN
1 parent 82b9eef commit 1312c53

File tree

2 files changed

+27
-28
lines changed

2 files changed

+27
-28
lines changed

.github/workflows/build-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190
uses: actions/github-script@v6
191191
if: always()
192192
with:
193-
github-token: ${{ secrets.WORKFLOW_TOKEN }}
193+
github-token: ${{ secrets.GITHUB_TOKEN }}
194194
script: |
195195
const caches = await github.rest.actions.getActionsCacheList({
196196
owner: context.repo.owner,

src/Main/GraphicUserInterface.cpp

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,6 @@
3737

3838
namespace VeraCrypt
3939
{
40-
class AdminPasswordRequestHandler : public GetStringFunctor
41-
{
42-
public:
43-
virtual void operator() (string &passwordStr)
44-
{
45-
46-
wxString sValue;
47-
if (Gui->GetWaitDialog())
48-
{
49-
Gui->GetWaitDialog()->RequestAdminPassword(sValue);
50-
if (sValue.IsEmpty())
51-
throw UserAbort (SRC_POS);
52-
}
53-
else
54-
{
55-
wxPasswordEntryDialog dialog (Gui->GetActiveWindow(), LangString["LINUX_ADMIN_PW_QUERY"], LangString["LINUX_ADMIN_PW_QUERY_TITLE"]);
56-
if (dialog.ShowModal() != wxID_OK)
57-
throw UserAbort (SRC_POS);
58-
sValue = dialog.GetValue();
59-
}
60-
wstring wPassword (sValue); // A copy of the password is created here by wxWidgets, which cannot be erased
61-
finally_do_arg (wstring *, &wPassword, { StringConverter::Erase (*finally_arg); });
62-
63-
StringConverter::ToSingle (wPassword, passwordStr);
64-
}
65-
};
66-
6740
#ifdef TC_MACOSX
6841
int GraphicUserInterface::g_customIdCmdV = 0;
6942
int GraphicUserInterface::g_customIdCmdA = 0;
@@ -479,6 +452,32 @@ namespace VeraCrypt
479452

480453
shared_ptr <GetStringFunctor> GraphicUserInterface::GetAdminPasswordRequestHandler ()
481454
{
455+
class AdminPasswordRequestHandler : public GetStringFunctor
456+
{
457+
public;
458+
virtual void operator() (string &passwordStr)
459+
{
460+
461+
wxString sValue;
462+
if (Gui->GetWaitDialog())
463+
{
464+
Gui->GetWaitDialog()->RequestAdminPassword(sValue);
465+
if (sValue.IsEmpty())
466+
throw UserAbort (SRC_POS);
467+
}
468+
else
469+
{
470+
wxPasswordEntryDialog dialog (Gui->GetActiveWindow(), LangString["LINUX_ADMIN_PW_QUERY"], LangString["LINUX_ADMIN_PW_QUERY_TITLE"]);
471+
if (dialog.ShowModal() != wxID_OK)
472+
throw UserAbort (SRC_POS);
473+
sValue = dialog.GetValue();
474+
}
475+
wstring wPassword (sValue); // A copy of the password is created here by wxWidgets, which cannot be erased
476+
finally_do_arg (wstring *, &wPassword, { StringConverter::Erase (*finally_arg); });
477+
478+
StringConverter::ToSingle (wPassword, passwordStr);
479+
}
480+
};
482481
return shared_ptr <GetStringFunctor> (new AdminPasswordRequestHandler);
483482
}
484483

0 commit comments

Comments
 (0)