diff options
author | David Shaw <[email protected]> | 2005-08-18 21:14:16 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2005-08-18 21:14:16 +0000 |
commit | 70bf6d92046033e3ac66b8daf1f11a6478b0563c (patch) | |
tree | adb4cafce8430c589a9b26a6df702ec177f6c772 /keyserver/gpgkeys_ldap.c | |
parent | * gpgkeys_ldap.c (ldap_quote): \-quote a string for LDAP. (diff) | |
download | gnupg-70bf6d92046033e3ac66b8daf1f11a6478b0563c.tar.gz gnupg-70bf6d92046033e3ac66b8daf1f11a6478b0563c.zip |
* ksutil.h, ksutil.c (parse_ks_options): New keyserver-option exact-name.
The last of exact-name and exact-email overrides the earlier.
* gpgkeys_ldap.c (search_key), gpgkeys_hkp.c (search_key): Use it here to
do a name-only search.
Diffstat (limited to 'keyserver/gpgkeys_ldap.c')
-rw-r--r-- | keyserver/gpgkeys_ldap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/keyserver/gpgkeys_ldap.c b/keyserver/gpgkeys_ldap.c index eb40fabaf..a64d460c8 100644 --- a/keyserver/gpgkeys_ldap.c +++ b/keyserver/gpgkeys_ldap.c @@ -1158,6 +1158,9 @@ ldap_quote(char *buffer,const char *string) } } + if(buffer) + *buffer='\0'; + return count; } @@ -1173,7 +1176,7 @@ search_key(char *searchkey) /* The maximum size of the search, including the optional stuff and the trailing \0 */ char *expanded_search; - char search[2+12+1+MAX_LINE+1+2+15+14+1+1]; + char search[2+12+1+1+MAX_LINE+1+2+2+15+14+1+1]; char *attrs[]={"pgpcertid","pgpuserid","pgprevoked","pgpdisabled", "pgpkeycreatetime","pgpkeyexpiretime","modifytimestamp", "pgpkeysize","pgpkeytype",NULL}; @@ -1192,11 +1195,13 @@ search_key(char *searchkey) /* Build the search string */ - sprintf(search,"%s(pgpuserid=*%s%s%s*)%s%s%s", + sprintf(search,"%s(pgpuserid=%s%s%s%s%s*)%s%s%s", (!(opt->flags.include_disabled&&opt->flags.include_revoked))?"(&":"", + opt->flags.exact_name?"":"*", opt->flags.exact_email?"<":"", expanded_search, opt->flags.exact_email?">":"", + opt->flags.exact_name?" <":"", opt->flags.include_disabled?"":"(pgpdisabled=0)", opt->flags.include_revoked?"":"(pgprevoked=0)", !(opt->flags.include_disabled&&opt->flags.include_revoked)?")":""); |