diff options
author | Werner Koch <[email protected]> | 2016-01-13 09:16:27 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-01-13 09:43:34 +0000 |
commit | 160862978628b07ed5150ec2c8abad6af1656bc3 (patch) | |
tree | f46606887c7aa112f56354337c533fcbeb9e30ee /kbx/keybox-defs.h | |
parent | gpg: Make sure to mark a duplicate registered keybox as primary. (diff) | |
download | gnupg-160862978628b07ed5150ec2c8abad6af1656bc3.tar.gz gnupg-160862978628b07ed5150ec2c8abad6af1656bc3.zip |
kbx: Implement keybox_lock for use by gpg.
* kbx/keybox-defs.h: Include dotlock.h and logging.h.
(CONST_KB_NAME): Remove. Replace usage by KB_NAME.
(struct keybox_name): Add field "lockhd".
* kbx/keybox-init.c (keybox_register_file): Init LOCKHD.
(keybox_lock): Chnage to return gpg_error_t. Implement locking.
--
The keybox locking for gpg was not implemented - This needs to be
fixed of course.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'kbx/keybox-defs.h')
-rw-r--r-- | kbx/keybox-defs.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kbx/keybox-defs.h b/kbx/keybox-defs.h index 6fe984762..6af544810 100644 --- a/kbx/keybox-defs.h +++ b/kbx/keybox-defs.h @@ -40,6 +40,8 @@ fixme: Better use the LIBOBJ mechnism. */ #include "../common/types.h" #include "../common/stringhelp.h" +#include "../common/dotlock.h" +#include "../common/logging.h" #include "keybox.h" @@ -48,7 +50,6 @@ typedef struct keyboxblob *KEYBOXBLOB; typedef struct keybox_name *KB_NAME; -typedef struct keybox_name const *CONST_KB_NAME; struct keybox_name { /* Link to the next resources, so that we can walk all @@ -58,14 +59,15 @@ struct keybox_name /* True if this is a keybox with secret keys. */ int secret; - /*DOTLOCK lockhd;*/ - /* A table with all the handles accessing this resources. HANDLE_TABLE_SIZE gives the allocated length of this table unused entrues are set to NULL. HANDLE_TABLE may be NULL. */ KEYBOX_HANDLE *handle_table; size_t handle_table_size; + /* The lock handle or NULL it not yet initialized. */ + dotlock_t lockhd; + /* Not yet used. */ int is_locked; @@ -85,7 +87,7 @@ struct keybox_found_s }; struct keybox_handle { - CONST_KB_NAME kb; + KB_NAME kb; int secret; /* this is for a secret keybox */ FILE *fp; int eof; |