diff options
author | Werner Koch <[email protected]> | 2020-09-24 14:38:21 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-09-24 14:38:21 +0000 |
commit | c2b14f5d6852fb9efaca8aeec7961e9d036203e8 (patch) | |
tree | 615bb6204f18f68b1c13fa58d6cac20acda9a834 /kbx/keyboxd.h | |
parent | tests: Integrate --use-keyboxd into the OpenPGP test suite. (diff) | |
download | gnupg-c2b14f5d6852fb9efaca8aeec7961e9d036203e8.tar.gz gnupg-c2b14f5d6852fb9efaca8aeec7961e9d036203e8.zip |
keyboxd: New command TRANSACTION.
* kbx/backend-sqlite.c (be_sqlite_rollback): New.
(be_sqlite_commit): New.
(be_sqlite_search): Take care of global transactions.
(be_sqlite_store): Ditto.
(be_sqlite_delete): Ditto.
* kbx/frontend.c (kbxd_rollback, kbxd_commit): New.
* kbx/keyboxd.h (opt): Add vars for transactions.
* kbx/kbxserver.c (struct server_local_s): Add fields next_session and
client_pid.
(session_list): New var.
(cmd_transaction): New.
(register_commands): Register command.
(kbxd_start_command_handler): Store pids and track sessions. Do a
final rollback.
--
This command is currently an experiment to allow a client to run
everything in one session.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'kbx/keyboxd.h')
-rw-r--r-- | kbx/keyboxd.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kbx/keyboxd.h b/kbx/keyboxd.h index 22988bf1b..9cc2c23a6 100644 --- a/kbx/keyboxd.h +++ b/kbx/keyboxd.h @@ -45,6 +45,15 @@ struct /* True if we are running detached from the tty. */ int running_detached; + /* + * Global state variables. + */ + + /* Whether a global transaction has been requested along with the + * caller's pid and whether a transaction is active. */ + pid_t transaction_pid; + unsigned int in_transaction : 1; + unsigned int active_transaction : 1; } opt; @@ -118,6 +127,7 @@ struct server_control_s unsigned int filter_x509 : 1; /* Used by SEARCH and NEXT. */ unsigned int no_data_return : 1; + }; |