summaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-12-15 12:03:17 +0100
committerWerner Koch <wk@gnupg.org>2009-12-15 12:03:17 +0100
commit34baa18187d51ff54bd44e46cea8c997046f58ff (patch)
tree9f67c94a59d6aeff040a2f84a40ad75488dd50ba /g10
parentFix bug#1162: error creating home directory (diff)
downloadgnupg2-34baa18187d51ff54bd44e46cea8c997046f58ff.tar.xz
gnupg2-34baa18187d51ff54bd44e46cea8c997046f58ff.zip
Do not use the VMC C reserved word readonly.
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog3
-rw-r--r--g10/keydb.c8
-rw-r--r--g10/keyring.c20
-rw-r--r--g10/keyring.h2
4 files changed, 18 insertions, 15 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 734a00bb4..a19ee313e 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,5 +1,8 @@
2009-12-15 Werner Koch <wk@g10code.com>
+ * keydb.c (keydb_add_resource): s/readonly/read_only/g.
+ * keyring.c (keyring_register_filename): Ditto.
+
* tdbio.c (tdbio_set_dbname): Do not call log_fatal after creating
the directory. Fixes bug#1169. Reported by Daniel Leidert.
diff --git a/g10/keydb.c b/g10/keydb.c
index 55727ff5d..41b8c1d33 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -219,12 +219,12 @@ keydb_add_resource (const char *url, int flags, int secret)
const char *resname = url;
char *filename = NULL;
int force = (flags&1);
- int readonly = !!(flags&8);
+ int read_only = !!(flags&8);
int rc = 0;
KeydbResourceType rt = KEYDB_RESOURCE_TYPE_NONE;
void *token;
- if (readonly)
+ if (read_only)
force = 0;
/* Do we have an URL?
@@ -254,7 +254,7 @@ keydb_add_resource (const char *url, int flags, int secret)
else
filename = xstrdup (resname);
- if (!force && !readonly)
+ if (!force && !read_only)
force = secret? !any_secret : !any_public;
/* See whether we can determine the filetype. */
@@ -289,7 +289,7 @@ keydb_add_resource (const char *url, int flags, int secret)
if (rc)
goto leave;
- if(keyring_register_filename (filename, secret, readonly, &token))
+ if(keyring_register_filename (filename, secret, read_only, &token))
{
if (used_resources >= MAX_KEYDB_RESOURCES)
rc = G10ERR_RESOURCE_LIMIT;
diff --git a/g10/keyring.c b/g10/keyring.c
index e5a87746e..fd0dc2d89 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -54,7 +54,7 @@ struct keyring_name
{
struct keyring_name *next;
int secret;
- int readonly;
+ int read_only;
dotlock_t lockhd;
int is_locked;
int did_full_scan;
@@ -201,7 +201,7 @@ update_offset_hash_table_from_kb (OffsetHashTable tbl, KBNODE node, off_t off)
* if a new keyring was registered.
*/
int
-keyring_register_filename (const char *fname, int secret, int readonly,
+keyring_register_filename (const char *fname, int secret, int read_only,
void **ptr)
{
KR_NAME kr;
@@ -214,8 +214,8 @@ keyring_register_filename (const char *fname, int secret, int readonly,
if (same_file_p (kr->fname, fname))
{
/* Already registered. */
- if (readonly)
- kr->readonly = 1;
+ if (read_only)
+ kr->read_only = 1;
*ptr=kr;
return 0;
}
@@ -227,7 +227,7 @@ keyring_register_filename (const char *fname, int secret, int readonly,
kr = xmalloc (sizeof *kr + strlen (fname));
strcpy (kr->fname, fname);
kr->secret = !!secret;
- kr->readonly = readonly;
+ kr->read_only = read_only;
kr->lockhd = NULL;
kr->is_locked = 0;
kr->did_full_scan = 0;
@@ -249,7 +249,7 @@ keyring_is_writable (void *token)
{
KR_NAME r = token;
- return r? (r->readonly || !access (r->fname, W_OK)) : 0;
+ return r? (r->read_only || !access (r->fname, W_OK)) : 0;
}
@@ -516,7 +516,7 @@ keyring_update_keyblock (KEYRING_HANDLE hd, KBNODE kb)
if (!hd->found.kr)
return -1; /* no successful prior search */
- if (hd->found.kr->readonly)
+ if (hd->found.kr->read_only)
return gpg_error (GPG_ERR_EACCES);
if (!hd->found.n_packets) {
@@ -562,13 +562,13 @@ keyring_insert_keyblock (KEYRING_HANDLE hd, KBNODE kb)
else if (hd->found.kr)
{
fname = hd->found.kr->fname;
- if (hd->found.kr->readonly)
+ if (hd->found.kr->read_only)
return gpg_error (GPG_ERR_EACCES);
}
else if (hd->current.kr)
{
fname = hd->current.kr->fname;
- if (hd->current.kr->readonly)
+ if (hd->current.kr->read_only)
return gpg_error (GPG_ERR_EACCES);
}
else
@@ -603,7 +603,7 @@ keyring_delete_keyblock (KEYRING_HANDLE hd)
if (!hd->found.kr)
return -1; /* no successful prior search */
- if (hd->found.kr->readonly)
+ if (hd->found.kr->read_only)
return gpg_error (GPG_ERR_EACCES);
if (!hd->found.n_packets) {
diff --git a/g10/keyring.h b/g10/keyring.h
index 420e1792e..122d2ddae 100644
--- a/g10/keyring.h
+++ b/g10/keyring.h
@@ -24,7 +24,7 @@
typedef struct keyring_handle *KEYRING_HANDLE;
-int keyring_register_filename (const char *fname, int secret, int readonly,
+int keyring_register_filename (const char *fname, int secret, int read_only,
void **ptr);
int keyring_is_writable (void *token);