diff options
author | Marcus Brinkmann <mb@g10code.com> | 2008-02-27 18:32:47 +0100 |
---|---|---|
committer | Marcus Brinkmann <mb@g10code.com> | 2008-02-27 18:32:47 +0100 |
commit | a33b6677ff6a120018f277ca228aaecdf055de5c (patch) | |
tree | 5eaaa8ab3186438dd7a546d298d2e628feca9af0 | |
parent | 2008-02-27 Marcus Brinkmann <marcus@g10code.de> (diff) | |
download | gnupg2-a33b6677ff6a120018f277ca228aaecdf055de5c.tar.xz gnupg2-a33b6677ff6a120018f277ca228aaecdf055de5c.zip |
2008-02-27 Marcus Brinkmann <marcus@g10code.de>
* gpgconf-comp.c (option_check_validity): For now, error out on
empty strings.
(enum): Add GC_ARG_TYPE_PUB_KEY and GC_ARG_TYPE_SEC_KEY.
-rw-r--r-- | tools/ChangeLog | 6 | ||||
-rw-r--r-- | tools/gpgconf-comp.c | 17 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog index 1539490a2..0f3ebd4be 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,3 +1,9 @@ +2008-02-27 Marcus Brinkmann <marcus@g10code.de> + + * gpgconf-comp.c (option_check_validity): For now, error out on + empty strings. + (enum): Add GC_ARG_TYPE_PUB_KEY and GC_ARG_TYPE_SEC_KEY. + 2008-02-01 Marcus Brinkmann <marcus@g10code.de> * gpgconf-comp.c (gc_component_list_options): Fix memcpy. diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index 86590eed2..7a56c5b74 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -228,6 +228,12 @@ typedef enum /* A 40 character fingerprint. */ GC_ARG_TYPE_KEY_FPR = 34, + /* A user ID or key ID or fingerprint for a certificate. */ + GC_ARG_TYPE_PUB_KEY = 35, + + /* A user ID or key ID or fingerprint for a certificate with a key. */ + GC_ARG_TYPE_SEC_KEY = 36, + /* ADD NEW COMPLEX TYPE ENTRIES HERE. */ /* The number of the above entries. */ @@ -273,6 +279,8 @@ static struct { GC_ARG_TYPE_STRING, "pathname" }, { GC_ARG_TYPE_STRING, "ldap server" }, { GC_ARG_TYPE_STRING, "key fpr" }, + { GC_ARG_TYPE_STRING, "pub key" }, + { GC_ARG_TYPE_STRING, "sec key" }, }; @@ -2059,6 +2067,15 @@ option_check_validity (gc_option_t *option, unsigned long flags, if (*arg != '"') gc_error (1, 0, "string argument for option %s must begin " "with a quote (\") character", option->name); + + /* FIXME: We do not allow empty string arguments for now, as + we do not quote arguments in configuration files, and + thus no argument is indistinguishable from the empty + string. */ + if (arg[1] == '\0' || arg[1] == ',') + gc_error (1, 0, "empty string argument for option %s is " + "currently not allowed. Please report this!", + option->name); } else if (gc_arg_type[option->arg_type].fallback == GC_ARG_TYPE_INT32) { |