Skip to content

Commit

Permalink
Linux: fix crash when displaying Admin password dialog. Fix failure o…
Browse files Browse the repository at this point in the history
…f Github action by using builtin GITHUB_TOKEN
  • Loading branch information
idrassi committed Jul 10, 2024
1 parent 82b9eef commit 1312c53
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
uses: actions/github-script@v6
if: always()
with:
github-token: ${{ secrets.WORKFLOW_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
Expand Down
53 changes: 26 additions & 27 deletions src/Main/GraphicUserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,6 @@

namespace VeraCrypt
{
class AdminPasswordRequestHandler : public GetStringFunctor
{
public:
virtual void operator() (string &passwordStr)
{

wxString sValue;
if (Gui->GetWaitDialog())
{
Gui->GetWaitDialog()->RequestAdminPassword(sValue);
if (sValue.IsEmpty())
throw UserAbort (SRC_POS);
}
else
{
wxPasswordEntryDialog dialog (Gui->GetActiveWindow(), LangString["LINUX_ADMIN_PW_QUERY"], LangString["LINUX_ADMIN_PW_QUERY_TITLE"]);
if (dialog.ShowModal() != wxID_OK)
throw UserAbort (SRC_POS);
sValue = dialog.GetValue();
}
wstring wPassword (sValue); // A copy of the password is created here by wxWidgets, which cannot be erased
finally_do_arg (wstring *, &wPassword, { StringConverter::Erase (*finally_arg); });

StringConverter::ToSingle (wPassword, passwordStr);
}
};

#ifdef TC_MACOSX
int GraphicUserInterface::g_customIdCmdV = 0;
int GraphicUserInterface::g_customIdCmdA = 0;
Expand Down Expand Up @@ -479,6 +452,32 @@ namespace VeraCrypt

shared_ptr <GetStringFunctor> GraphicUserInterface::GetAdminPasswordRequestHandler ()
{
class AdminPasswordRequestHandler : public GetStringFunctor
{
public;
virtual void operator() (string &passwordStr)
{

wxString sValue;
if (Gui->GetWaitDialog())
{
Gui->GetWaitDialog()->RequestAdminPassword(sValue);
if (sValue.IsEmpty())
throw UserAbort (SRC_POS);
}
else
{
wxPasswordEntryDialog dialog (Gui->GetActiveWindow(), LangString["LINUX_ADMIN_PW_QUERY"], LangString["LINUX_ADMIN_PW_QUERY_TITLE"]);
if (dialog.ShowModal() != wxID_OK)
throw UserAbort (SRC_POS);
sValue = dialog.GetValue();
}
wstring wPassword (sValue); // A copy of the password is created here by wxWidgets, which cannot be erased
finally_do_arg (wstring *, &wPassword, { StringConverter::Erase (*finally_arg); });

StringConverter::ToSingle (wPassword, passwordStr);
}
};
return shared_ptr <GetStringFunctor> (new AdminPasswordRequestHandler);
}

Expand Down

0 comments on commit 1312c53

Please sign in to comment.