From a33b6677ff6a120018f277ca228aaecdf055de5c Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Wed, 27 Feb 2008 17:32:47 +0000 Subject: [PATCH] 2008-02-27 Marcus Brinkmann * 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. --- tools/ChangeLog | 6 ++++++ tools/gpgconf-comp.c | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) 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 + + * 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 * 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) {