mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 00:09:53 -05:00
Merge branch 'develop' into feature/yubikey
This commit is contained in:
commit
5df7b9aa85
12
CHANGELOG
12
CHANGELOG
@ -1,3 +1,15 @@
|
||||
2.1.3 (2017-03-03)
|
||||
=========================
|
||||
|
||||
- Fix possible overflow in zxcvbn library [#363]
|
||||
- Revert HiDPI setting to avoid problems on laptop screens [#332]
|
||||
- Set file meta properties in Windows executable [#330]
|
||||
- Suppress error message when auto-reloading a locked database [#345]
|
||||
- Improve usability of question dialog when database is already locked by a different instance [#346]
|
||||
- Fix compiler warnings in QHttp library [#351]
|
||||
- Use unified toolbar on Mac OS X [#361]
|
||||
- Fix an issue on X11 where the main window would be raised instead of closed on Alt+F4 [#362]
|
||||
|
||||
2.1.2 (2017-02-17)
|
||||
=========================
|
||||
|
||||
|
@ -34,12 +34,12 @@ option(WITH_GUI_TESTS "Enable building of GUI tests" OFF)
|
||||
option(WITH_DEV_BUILD "Use only for development. Disables/warns about deprecated methods." OFF)
|
||||
option(WITH_COVERAGE "Use to build with coverage tests. (GCC ONLY)." OFF)
|
||||
|
||||
option(WITH_XC_AUTOTYPE "Include Auto-Type." OFF)
|
||||
option(WITH_XC_HTTP "Include KeePassHTTP support." OFF)
|
||||
option(WITH_XC_AUTOTYPE "Include Auto-Type." ON)
|
||||
option(WITH_XC_HTTP "Include KeePassHTTP and Custom Icon Downloads." OFF)
|
||||
option(WITH_XC_YUBIKEY "Include YubiKey support." OFF)
|
||||
|
||||
set(KEEPASSXC_VERSION "2.1.2")
|
||||
set(KEEPASSXC_VERSION_NUM "2.1.2")
|
||||
set(KEEPASSXC_VERSION "2.1.3")
|
||||
set(KEEPASSXC_VERSION_NUM "2.1.3")
|
||||
|
||||
if("${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_COMPILER_IS_CLANG 1)
|
||||
|
@ -388,11 +388,6 @@ Discard changes and close anyway?</source>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to open is locked by another instance of KeePassXC.
|
||||
Do you want to open it anyway? Alternatively the database is opened read-only.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Merge database</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@ -406,6 +401,20 @@ Do you want to save it anyway?</source>
|
||||
<source>Passwords</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database already opened</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to open is locked by another instance of KeePassXC.
|
||||
|
||||
Do you want to open it anyway?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open read-only</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseWidget</name>
|
||||
@ -516,10 +525,6 @@ Do you want to save it anyway?</source>
|
||||
<source>Autoreload Failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Could not parse or unlock the new database file while attempting to autoreload this database.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Could not open the new database file while attempting to autoreload this database.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -13,16 +13,16 @@
|
||||
<source>About KeePassXC</source>
|
||||
<translation>Apie KeePassXC</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePassXC is distributed under the term of the GNU General Public License (GPL) version 2 or (at your option) version 3.</source>
|
||||
<translation>KeePassXC yra platinama GNU Bendrosios Viešosios Licencijos (GPL) versijos 2 arba (jūsų pasirinkimu) versijos 3 sąlygomis.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Extensions:
|
||||
</source>
|
||||
<translation>Plėtiniai:
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePassXC is distributed under the terms of the GNU General Public License (GPL) version 2 or (at your option) version 3.</source>
|
||||
<translation>KeePassXC yra platinama GNU Bendrosios Viešosios Licencijos (GPL) versijos 2 arba (jūsų pasirinkimu) versijos 3 sąlygomis.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AccessControlDialog</name>
|
||||
@ -100,10 +100,6 @@ Pasirinkite, ar norite leisti prieigą.</translation>
|
||||
<source>Repeat password:</source>
|
||||
<translation>Pakartokite slaptažodį:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Key file</source>
|
||||
<translation>Rakto failas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Browse</source>
|
||||
<translation>Naršyti</translation>
|
||||
@ -158,6 +154,10 @@ Pasirinkite, ar norite leisti prieigą.</translation>
|
||||
<translation>Nepavyko nustatyti %1 kaip rakto failą:
|
||||
%2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Key file</source>
|
||||
<translation>&Rakto failas</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseOpenWidget</name>
|
||||
@ -257,10 +257,6 @@ Dabar galite ją įrašyti.</translation>
|
||||
<source>Default username:</source>
|
||||
<translation>Numatytasis naudotojo vardas:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use recycle bin:</source>
|
||||
<translation>Naudoti šiukšlinę:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source> MiB</source>
|
||||
<translation> MiB</translation>
|
||||
@ -277,6 +273,10 @@ Dabar galite ją įrašyti.</translation>
|
||||
<source>Max. history size:</source>
|
||||
<translation>Didžiausias istorijos dydis:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use recycle bin</source>
|
||||
<translation>Naudoti šiukšlinę</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseTabWidget</name>
|
||||
@ -396,12 +396,6 @@ Vis tiek atmesti pakeitimus ir užverti?</translation>
|
||||
<source>Unable to open the database.</source>
|
||||
<translation>Nepavyko atverti duomenų bazės.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to open is locked by another instance of KeePassXC.
|
||||
Do you want to open it anyway? Alternatively the database is opened read-only.</source>
|
||||
<translation>Duomenų bazė, kurią bandote atverti, yra užrakinta kito KeePassXC egzemplioriaus.
|
||||
Ar vis tiek norite ją atverti? Tokiu atveju duomenų bazė bus atverta tik skaitymui.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Merge database</source>
|
||||
<translation>Sulieti duomenų bazę</translation>
|
||||
@ -412,6 +406,25 @@ Do you want to save it anyway?</source>
|
||||
<translation>Duomenų bazė, kurią bandote įrašyti yra užrakinta kito KeePassXC programos egzemplioriaus.
|
||||
Ar vis tiek norite ją įrašyti?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Passwords</source>
|
||||
<translation>Slaptažodžiai</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Database already opened</source>
|
||||
<translation>Duomenų bazė jau atverta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The database you are trying to open is locked by another instance of KeePassXC.
|
||||
|
||||
Do you want to open it anyway?</source>
|
||||
<translation>Duomenų bazė, kurią bandote atverti yra užrakinta kito KeePassXC programos egzemplioriaus.
|
||||
Ar vis tiek norite ją atverti?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open read-only</source>
|
||||
<translation>Atverti tik skaitymui</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DatabaseWidget</name>
|
||||
@ -519,10 +532,6 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
<source>Autoreload Failed</source>
|
||||
<translation>Automatinis įkėlimas iš naujo nepavyko</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Could not parse or unlock the new database file while attempting to autoreload this database.</source>
|
||||
<translation>Nepavyko išanalizuoti ar atrakinti naujos duomenų bazės failo, bandant automatiškai iš naujo įkelti šią duomenų bazę.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Could not open the new database file while attempting to autoreload this database.</source>
|
||||
<translation>Nepavyko atverti naujos duomenų bazės failo, bandant automatiškai iš naujo įkelti šią duomenų bazę.</translation>
|
||||
@ -650,14 +659,6 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
<source>Enable Auto-Type for this entry</source>
|
||||
<translation>Įjungti šiam įrašui automatinį rinkimą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Inherit default Auto-Type sequence from the group</source>
|
||||
<translation>Paveldėti numatytąją automatinio rinkimo seką iš grupės</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use custom Auto-Type sequence:</source>
|
||||
<translation>Naudoti tinkintą automatinio rinkimo seka:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>+</source>
|
||||
<translation>+</translation>
|
||||
@ -671,12 +672,20 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
<translation>Lango antraštė:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use default sequence</source>
|
||||
<translation>Naudoti numatytąją seką</translation>
|
||||
<source>Inherit default Auto-Type sequence from the &group</source>
|
||||
<translation>Paveldėti numatytąją automatinio rinkimo seką iš &grupės</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Set custom sequence:</source>
|
||||
<translation>Nustatyti tinkintą seką:</translation>
|
||||
<source>&Use custom Auto-Type sequence:</source>
|
||||
<translation>Na&udoti tinkintą automatinio rinkimo seka:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use default se&quence</source>
|
||||
<translation>Naudoti numatytąją se&ką</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Set custo&m sequence:</source>
|
||||
<translation>Nustatyti tinkintą s&eką:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -801,14 +810,6 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditWidgetIcons</name>
|
||||
<message>
|
||||
<source>Use default icon</source>
|
||||
<translation>Naudoti numatytąją piktogramą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use custom icon</source>
|
||||
<translation>Naudoti tinkintą piktogramą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add custom icon</source>
|
||||
<translation>Pridėti tinkintą piktogramą</translation>
|
||||
@ -853,6 +854,14 @@ Ar vis tiek norite ją įrašyti?</translation>
|
||||
<source>Can't delete icon. Still used by %1 items.</source>
|
||||
<translation>Nepavyksta ištrinti piktogramos. Vis dar naudojama %1 elementų.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Use default icon</source>
|
||||
<translation>Na&udoti numatytąją piktogramą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use custo&m icon</source>
|
||||
<translation>Naudoti tinkintą piktogra&mą</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditWidgetProperties</name>
|
||||
@ -1298,12 +1307,6 @@ Tai yra vienakryptis perkėlimas. Jūs negalėsite atverti importuotos duomenų
|
||||
<source>Sh&ow a notification when credentials are requested</source>
|
||||
<translation>R&odyti pranešimą, kai reikalaujama prisijungimo duomenų</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Return only best matching entries for an URL instead
|
||||
of all entries for the whole domain</source>
|
||||
<translation>&Vietoj visų įrašų, skirtų visai sričiai,
|
||||
grąžinti tik geriausiai atitinkančius įrašus, skirtus URL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Match URL schemes
|
||||
Only entries with the same scheme (http://, https://, ftp://, ...) are returned</source>
|
||||
@ -1314,10 +1317,6 @@ Bus grąžinami įrašai tik su ta pačia schema (http://, https://, ftp://, ...
|
||||
<source>Sort matching entries by &username</source>
|
||||
<translation>Rikiuoti atitinkančius įrašus pagal na&udotojo vardą</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>R&emove all shared encryption-keys from active database</source>
|
||||
<translation>Ša&linti iš aktyvios duomenų bazės visus bendrinamus šifravimo raktus</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Re&move all stored permissions from entries in active database</source>
|
||||
<translation>Šal&inti iš įrašų aktyvioje duomenų bazėje visus saugomus leidimus</translation>
|
||||
@ -1330,10 +1329,6 @@ Bus grąžinami įrašai tik su ta pačia schema (http://, https://, ftp://, ...
|
||||
<source>Advanced</source>
|
||||
<translation>Išplėstiniai</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Activate the following only, if you know what you are doing!</source>
|
||||
<translation>Aktyvuokite tai tik tuo atveju, jeigu žinote ką darote!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Always allow &access to entries</source>
|
||||
<translation>Visada leisti &prieigą prie įrašų</translation>
|
||||
@ -1350,14 +1345,6 @@ Bus grąžinami įrašai tik su ta pačia schema (http://, https://, ftp://, ...
|
||||
<source>Only the selected database has to be connected with a client!</source>
|
||||
<translation>Su klientu turi būti sujungta tik pasirinkta duomenų bazė!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Return also advanced string fields which start with "KPH: "</source>
|
||||
<translation>&Taip pat grąžinti ir išplėstines eilutes, kurios prasideda "KPH: "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Automatic creates or updates are not supported for string fields!</source>
|
||||
<translation>Šiems eilutės laukams automatiniai kūrimai ir atnaujinimai neprieinami!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HTTP Port:</source>
|
||||
<translation>HTTP prievadas:</translation>
|
||||
@ -1394,6 +1381,28 @@ Using default port 19455.</source>
|
||||
<translation>Nepavyksta susieti su privilegijuotais prievadais žemiau 1024!
|
||||
Naudojamas numatytasis prievadas 19455.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Return only best matching entries for a URL instead
|
||||
of all entries for the whole domain</source>
|
||||
<translation>&Vietoj visų įrašų, skirtų visai sričiai,
|
||||
grąžinti tik geriausiai atitinkančius įrašus, skirtus URL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>R&emove all shared encryption keys from active database</source>
|
||||
<translation>Ša&linti iš aktyvios duomenų bazės visus bendrinamus šifravimo raktus</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The following options can be dangerous. Change them only if you know what you are doing.</source>
|
||||
<translation>Šios parinktys gali būti pavojingos. Keiskite jas tik tuo atveju, jeigu žinote ką darote!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Return advanced string fields which start with "KPH: "</source>
|
||||
<translation>&Grąžinti išplėstines eilutes, kurios prasideda "KPH: "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Automatically creating or updating string fields is not supported.</source>
|
||||
<translation>Automatinis eilutės laukų kūrimas ar atnaujinimas nėra palaikomas.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PasswordGeneratorWidget</name>
|
||||
@ -1463,7 +1472,7 @@ Naudojamas numatytasis prievadas 19455.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Entropy: %1 bit</source>
|
||||
<translation>Entropija: %1 bit</translation>
|
||||
<translation>Entropija: %1 bitų</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password Quality: %1</source>
|
||||
@ -1535,7 +1544,7 @@ Naudojamas numatytasis prievadas 19455.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Search</source>
|
||||
<translation>Ieškoti</translation>
|
||||
<translation>Paieška</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Find</source>
|
||||
@ -1771,10 +1780,6 @@ ir priimtumėte jį.</translation>
|
||||
<source>key file of the database</source>
|
||||
<translation>duomenų bazės rakto failas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>filename(s) of the password database(s) to open (*.kdbx)</source>
|
||||
<translation>norimos atverti slaptažodžių duomenų bazės(-ių) failo pavadinimas(-ai) (*.kdbx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>KeePassXC - cross-platform password manager</source>
|
||||
<translation>KeePassXC - daugiaplatformė slaptažodžių tvarkytuvė</translation>
|
||||
@ -1783,5 +1788,9 @@ ir priimtumėte jį.</translation>
|
||||
<source>read password of the database from stdin</source>
|
||||
<translation>nuskaityti duomenų bazės slaptažodį iš stdin</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>filenames of the password databases to open (*.kdbx)</source>
|
||||
<translation>norimų atverti slaptažodžių duomenų bazių failų pavadinimai (*.kdbx)</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
File diff suppressed because it is too large
Load Diff
@ -158,7 +158,7 @@ add_feature_info(YubiKey WITH_XC_YUBIKEY "YubiKey HMAC-SHA1 challenge-response")
|
||||
|
||||
add_subdirectory(http)
|
||||
if(WITH_XC_HTTP)
|
||||
set(keepasshttp_LIB keepasshttp)
|
||||
set(keepasshttp_LIB keepasshttp qhttp Qt5::Network)
|
||||
endif()
|
||||
|
||||
add_subdirectory(autotype)
|
||||
@ -205,11 +205,9 @@ target_link_libraries(keepassx_core
|
||||
${keepasshttp_LIB}
|
||||
${autotype_LIB}
|
||||
zxcvbn
|
||||
qhttp
|
||||
Qt5::Core
|
||||
Qt5::Concurrent
|
||||
Qt5::Widgets
|
||||
Qt5::Network
|
||||
${GCRYPT_LIBRARIES}
|
||||
${GPGERROR_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
||||
* Copyright (C) 2017 Lennart Glauer <mail@lennart-glauer.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -26,7 +27,8 @@
|
||||
#include <QElapsedTimer>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h> // for Sleep(), SetDllDirectoryA() and SetSearchPathMode()
|
||||
#include <windows.h> // for Sleep(), SetDllDirectoryA(), SetSearchPathMode(), ...
|
||||
#include <aclapi.h> // for SetSecurityInfo()
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
@ -226,6 +228,10 @@ void disableCoreDumps()
|
||||
success = success && (ptrace(PT_DENY_ATTACH, 0, 0, 0) == 0);
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
success = success && createWindowsDACL();
|
||||
#endif
|
||||
|
||||
if (!success) {
|
||||
qWarning("Unable to disable core dumps.");
|
||||
}
|
||||
@ -240,4 +246,114 @@ void setupSearchPaths()
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// This function grants the user associated with the process token minimal access rights and
|
||||
// denies everything else on Windows. This includes PROCESS_QUERY_INFORMATION and
|
||||
// PROCESS_VM_READ access rights that are required for MiniDumpWriteDump() or ReadProcessMemory().
|
||||
// We do this using a discretionary access control list (DACL). Effectively this prevents
|
||||
// crash dumps and disallows other processes from accessing our memory. This works as long
|
||||
// as you do not have admin privileges, since then you are able to grant yourself the
|
||||
// SeDebugPrivilege or SeTakeOwnershipPrivilege and circumvent the DACL.
|
||||
//
|
||||
bool createWindowsDACL()
|
||||
{
|
||||
bool bSuccess = false;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// Process token and user
|
||||
HANDLE hToken = nullptr;
|
||||
PTOKEN_USER pTokenUser = nullptr;
|
||||
DWORD cbBufferSize = 0;
|
||||
|
||||
// Access control list
|
||||
PACL pACL = nullptr;
|
||||
DWORD cbACL = 0;
|
||||
|
||||
// Open the access token associated with the calling process
|
||||
if (!OpenProcessToken(
|
||||
GetCurrentProcess(),
|
||||
TOKEN_QUERY,
|
||||
&hToken
|
||||
)) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// Retrieve the token information in a TOKEN_USER structure
|
||||
GetTokenInformation(
|
||||
hToken,
|
||||
TokenUser,
|
||||
nullptr,
|
||||
0,
|
||||
&cbBufferSize
|
||||
);
|
||||
|
||||
pTokenUser = static_cast<PTOKEN_USER>(HeapAlloc(GetProcessHeap(), 0, cbBufferSize));
|
||||
if (pTokenUser == nullptr) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
if (!GetTokenInformation(
|
||||
hToken,
|
||||
TokenUser,
|
||||
pTokenUser,
|
||||
cbBufferSize,
|
||||
&cbBufferSize
|
||||
)) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
if (!IsValidSid(pTokenUser->User.Sid)) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// Calculate the amount of memory that must be allocated for the DACL
|
||||
cbACL = sizeof(ACL)
|
||||
+ sizeof(ACCESS_ALLOWED_ACE) + GetLengthSid(pTokenUser->User.Sid);
|
||||
|
||||
// Create and initialize an ACL
|
||||
pACL = static_cast<PACL>(HeapAlloc(GetProcessHeap(), 0, cbACL));
|
||||
if (pACL == nullptr) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
if (!InitializeAcl(pACL, cbACL, ACL_REVISION)) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// Add allowed access control entries, everything else is denied
|
||||
if (!AddAccessAllowedAce(
|
||||
pACL,
|
||||
ACL_REVISION,
|
||||
SYNCHRONIZE | PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_TERMINATE, // same as protected process
|
||||
pTokenUser->User.Sid // pointer to the trustee's SID
|
||||
)) {
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// Set discretionary access control list
|
||||
bSuccess = ERROR_SUCCESS == SetSecurityInfo(
|
||||
GetCurrentProcess(), // object handle
|
||||
SE_KERNEL_OBJECT, // type of object
|
||||
DACL_SECURITY_INFORMATION, // change only the objects DACL
|
||||
nullptr, nullptr, // do not change owner or group
|
||||
pACL, // DACL specified
|
||||
nullptr // do not change SACL
|
||||
);
|
||||
|
||||
Cleanup:
|
||||
|
||||
if (pACL != nullptr) {
|
||||
HeapFree(GetProcessHeap(), 0, pACL);
|
||||
}
|
||||
if (pTokenUser != nullptr) {
|
||||
HeapFree(GetProcessHeap(), 0, pTokenUser);
|
||||
}
|
||||
if (hToken != nullptr) {
|
||||
CloseHandle(hToken);
|
||||
}
|
||||
#endif
|
||||
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
} // namespace Tools
|
||||
|
@ -41,6 +41,7 @@ void sleep(int ms);
|
||||
void wait(int ms);
|
||||
void disableCoreDumps();
|
||||
void setupSearchPaths();
|
||||
bool createWindowsDACL();
|
||||
|
||||
template <typename RandomAccessIterator, typename T>
|
||||
RandomAccessIterator binaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T& value)
|
||||
|
@ -28,10 +28,12 @@
|
||||
#include "gui/IconModels.h"
|
||||
#include "gui/MessageBox.h"
|
||||
|
||||
#ifdef WITH_XC_HTTP
|
||||
#include "http/qhttp/qhttpclient.hpp"
|
||||
#include "http/qhttp/qhttpclientresponse.hpp"
|
||||
|
||||
using namespace qhttp::client;
|
||||
#endif
|
||||
|
||||
IconStruct::IconStruct()
|
||||
: uuid(Uuid())
|
||||
@ -45,7 +47,11 @@ EditWidgetIcons::EditWidgetIcons(QWidget* parent)
|
||||
, m_database(nullptr)
|
||||
, m_defaultIconModel(new DefaultIconModel(this))
|
||||
, m_customIconModel(new CustomIconModel(this))
|
||||
#ifdef WITH_XC_HTTP
|
||||
, m_httpClient(nullptr)
|
||||
, m_fallbackToGoogle(true)
|
||||
, m_redirectCount(0)
|
||||
#endif
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@ -138,18 +144,25 @@ void EditWidgetIcons::load(const Uuid& currentUuid, Database* database, const Ic
|
||||
|
||||
void EditWidgetIcons::setUrl(const QString& url)
|
||||
{
|
||||
#ifdef WITH_XC_HTTP
|
||||
m_url = url;
|
||||
m_ui->faviconButton->setVisible(!url.isEmpty());
|
||||
resetFaviconDownload();
|
||||
#else
|
||||
m_ui->faviconButton->setVisible(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
void EditWidgetIcons::downloadFavicon()
|
||||
{
|
||||
#ifdef WITH_XC_HTTP
|
||||
QUrl url = QUrl(m_url);
|
||||
url.setPath("/favicon.ico");
|
||||
fetchFavicon(url);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WITH_XC_HTTP
|
||||
void EditWidgetIcons::fetchFavicon(const QUrl& url)
|
||||
{
|
||||
if (nullptr == m_httpClient) {
|
||||
@ -241,6 +254,7 @@ void EditWidgetIcons::resetFaviconDownload(bool clearRedirect)
|
||||
m_fallbackToGoogle = true;
|
||||
m_ui->faviconButton->setDisabled(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
void EditWidgetIcons::addCustomIcon()
|
||||
{
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <QSet>
|
||||
#include <QUrl>
|
||||
|
||||
#include "config-keepassx.h"
|
||||
#include "core/Global.h"
|
||||
#include "core/Uuid.h"
|
||||
#include "gui/MessageWidget.h"
|
||||
@ -30,11 +31,14 @@ class Database;
|
||||
class DefaultIconModel;
|
||||
class CustomIconModel;
|
||||
|
||||
#ifdef WITH_XC_HTTP
|
||||
namespace qhttp {
|
||||
namespace client {
|
||||
class QHttpClient;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace Ui {
|
||||
class EditWidgetIcons;
|
||||
}
|
||||
@ -68,9 +72,11 @@ Q_SIGNALS:
|
||||
|
||||
private Q_SLOTS:
|
||||
void downloadFavicon();
|
||||
#ifdef WITH_XC_HTTP
|
||||
void fetchFavicon(const QUrl& url);
|
||||
void fetchFaviconFromGoogle(const QString& domain);
|
||||
void resetFaviconDownload(bool clearRedirect = true);
|
||||
#endif
|
||||
void addCustomIcon();
|
||||
void removeCustomIcon();
|
||||
void updateWidgetsDefaultIcons(bool checked);
|
||||
@ -83,12 +89,14 @@ private:
|
||||
Database* m_database;
|
||||
Uuid m_currentUuid;
|
||||
QString m_url;
|
||||
QUrl m_redirectUrl;
|
||||
bool m_fallbackToGoogle = true;
|
||||
unsigned short m_redirectCount = 0;
|
||||
DefaultIconModel* const m_defaultIconModel;
|
||||
CustomIconModel* const m_customIconModel;
|
||||
#ifdef WITH_XC_HTTP
|
||||
QUrl m_redirectUrl;
|
||||
bool m_fallbackToGoogle;
|
||||
unsigned short m_redirectCount;
|
||||
qhttp::client::QHttpClient* m_httpClient;
|
||||
#endif
|
||||
|
||||
Q_DISABLE_COPY(EditWidgetIcons)
|
||||
};
|
||||
|
@ -301,7 +301,7 @@ MainWindow::MainWindow()
|
||||
connect(m_ui->welcomeWidget, SIGNAL(importKeePass1Database()), SLOT(switchToKeePass1Database()));
|
||||
|
||||
connect(m_ui->actionAbout, SIGNAL(triggered()), SLOT(showAboutDialog()));
|
||||
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
#endif
|
||||
@ -612,7 +612,7 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||
if (minimizeOnClose && !appExitCalled)
|
||||
{
|
||||
event->ignore();
|
||||
toggleWindow();
|
||||
hideWindow();
|
||||
|
||||
if (config()->get("security/lockdatabaseminimize").toBool()) {
|
||||
m_ui->tabWidget->lockDatabases();
|
||||
@ -777,22 +777,27 @@ void MainWindow::trayIconTriggered(QSystemTrayIcon::ActivationReason reason)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::hideWindow()
|
||||
{
|
||||
setWindowState(windowState() | Qt::WindowMinimized);
|
||||
QTimer::singleShot(0, this, SLOT(hide()));
|
||||
|
||||
if (config()->get("security/lockdatabaseminimize").toBool()) {
|
||||
m_ui->tabWidget->lockDatabases();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::toggleWindow()
|
||||
{
|
||||
if ((QApplication::activeWindow() == this) && isVisible() && !isMinimized()) {
|
||||
setWindowState(windowState() | Qt::WindowMinimized);
|
||||
QTimer::singleShot(0, this, SLOT(hide()));
|
||||
|
||||
if (config()->get("security/lockdatabaseminimize").toBool()) {
|
||||
m_ui->tabWidget->lockDatabases();
|
||||
}
|
||||
hideWindow();
|
||||
} else {
|
||||
ensurePolished();
|
||||
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||
show();
|
||||
raise();
|
||||
activateWindow();
|
||||
|
||||
|
||||
#if defined(Q_OS_LINUX) && ! defined(QT_NO_DBUS)
|
||||
// re-register global D-Bus menu (needed on Ubuntu with Unity)
|
||||
// see https://github.com/keepassxreboot/keepassxc/issues/271
|
||||
@ -832,7 +837,7 @@ void MainWindow::repairDatabase()
|
||||
if (fileName.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QScopedPointer<QDialog> dialog(new QDialog(this));
|
||||
DatabaseRepairWidget* dbRepairWidget = new DatabaseRepairWidget(dialog.data());
|
||||
connect(dbRepairWidget, SIGNAL(success()), dialog.data(), SLOT(accept()));
|
||||
|
@ -78,6 +78,7 @@ private Q_SLOTS:
|
||||
void rememberOpenDatabases(const QString& filePath);
|
||||
void applySettingsChanges();
|
||||
void trayIconTriggered(QSystemTrayIcon::ActivationReason reason);
|
||||
void hideWindow();
|
||||
void toggleWindow();
|
||||
void lockDatabasesAfterInactivity();
|
||||
void repairDatabase();
|
||||
|
@ -496,7 +496,7 @@ typedef struct
|
||||
uint8_t LeetCnv[sizeof L33TCnv / LEET_NORM_MAP_SIZE + 1];
|
||||
/* uint8_t LeetChr[3]; */
|
||||
uint8_t First;
|
||||
uint8_t PossChars[48];
|
||||
uint8_t PossChars[49];
|
||||
} DictWork_t;
|
||||
|
||||
/**********************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user