Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement clean shutdown after receiving Unix signals, resolves #169 #170

Merged
merged 4 commits into from
Jan 25, 2017

Conversation

phoerious
Copy link
Member

@phoerious phoerious commented Jan 17, 2017

Description

The database wasn't saved properly and lockfiles were not removed when receiving the signals SIGINT, SIGTERM, SIGQUIT or SIGHUP. This patch implements signal handling and performs a clean shutdown after receiving SIGINT SIGTERM or SIGQUIT and ignores SIGHUP.

Since this uses POSIX syscalls for signal and socket handling, there is no Windows implementation at the moment.

This resolves issue #169.

Motivation and Context

This patch makes sure the database is properly saved when closing KeePassXC using Ctrl+C on the terminal or when logging out of the desktop session. It also removes the lock file and therefore prevents cluttering the file system.

How Has This Been Tested?

For testing a clean shutdown, a SIGINT was sent to the application via Ctrl+C and killall -INT keepassxc. When there were unsaved changes, KeePassXC asked the user whether to save or discard the changes and then shut down and removed the lock file.
The same behavior was tested with killall for SIGQUIT and SIGTERM as well as SIGHUP which is ignored as intended.

Types of changes

  • ✅ Bug fix (non-breaking change which fixes an issue)

Checklist:

  • ✅ I have read the CONTRIBUTING document. [REQUIRED]
  • ✅ My code follows the code style of this project. [REQUIRED]
  • ✅ All new and existing tests passed. [REQUIRED]

@phoerious phoerious added this to the v2.2.0 milestone Jan 17, 2017
@phoerious phoerious force-pushed the feature/169-signal-handlers branch from d132cb4 to b4bb32b Compare January 17, 2017 23:50
The database wasn't saved properly and lockfiles were not removed when receiving the signals SIGINT, SIGTERM, SIGQUIT or SIGHUP. This patch implements signal handling and performs a clean shutdown after receiving SIGINT SIGTERM or SIGQUIT and ignores SIGHUP.

Since this uses POSIX syscalls for signal and socket handling, there is no Windows implementation at the moment.
@phoerious phoerious force-pushed the feature/169-signal-handlers branch from b4bb32b to 4eb39dc Compare January 23, 2017 21:33
@droidmonkey droidmonkey merged commit a3f189f into develop Jan 25, 2017
@droidmonkey droidmonkey deleted the feature/169-signal-handlers branch January 25, 2017 03:33
droidmonkey added a commit that referenced this pull request Jun 25, 2017
- Added YubiKey 2FA integration for unlocking databases [#127]
- Added TOTP support [#519]
- Added CSV import tool [#146, #490]
- Added KeePassXC CLI tool [#254]
- Added diceware password generator [#373]
- Added support for entry references [#370, #378]
- Added support for Twofish encryption [#167]
- Enabled DEP and ASLR for in-memory protection [#371]
- Enabled single instance mode [#510]
- Enabled portable mode [#645]
- Enabled database lock on screensaver and session lock [#545]
- Redesigned welcome screen with common features and recent databases [#292]
- Multiple updates to search behavior [#168, #213, #374, #471, #603, #654]
- Added auto-type fields {CLEARFIELD}, {SPACE}, {{}, {}} [#267, #427, #480]
- Fixed auto-type errors on Linux [#550]
- Prompt user prior to executing a cmd:// URL [#235]
- Entry attributes can be protected (hidden) [#220]
- Added extended ascii to password generator [#538]
- Added new database icon to toolbar [#289]
- Added context menu entry to empty recycle bin in databases [#520]
- Added "apply" button to entry and group edit windows [#624]
- Added macOS tray icon and enabled minimize on close [#583]
- Fixed issues with unclean shutdowns [#170, #580]
- Changed keyboard shortcut to create new database to CTRL+SHIFT+N [#515]
- Compare window title to entry URLs [#556]
- Implemented inline error messages [#162]
- Ignore group expansion and other minor changes when making database "dirty" [#464]
- Updated license and copyright information on souce files [#632]
- Added contributors list to about dialog [#629]
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants