diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2024-07-10 11:09:10 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2024-07-10 11:09:10 +0200 |
commit | 1312c537f5592d01c5195b9c17fcca97678bc5ad (patch) | |
tree | fa43c30e5a9970afe56bf99708c880f28bd2d162 | |
parent | 82b9eef880195c1163356a52ab57bdaa9a5897c5 (diff) | |
download | VeraCrypt-1312c537f5592d01c5195b9c17fcca97678bc5ad.tar.gz VeraCrypt-1312c537f5592d01c5195b9c17fcca97678bc5ad.zip |
Linux: fix crash when displaying Admin password dialog. Fix failure of Github action by using builtin GITHUB_TOKEN
-rw-r--r-- | .github/workflows/build-linux.yml | 2 | ||||
-rw-r--r-- | src/Main/GraphicUserInterface.cpp | 53 |
2 files changed, 27 insertions, 28 deletions
diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 6bab9e4a..87dc0b45 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -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, diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp index 0fd756a3..6a2ac9fe 100644 --- a/src/Main/GraphicUserInterface.cpp +++ b/src/Main/GraphicUserInterface.cpp @@ -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; @@ -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); } |