1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* gpgkeys_ldap.c: Replacement prototypes for setenv and unsetenv.

(search_key): Catch a SIZELIMIT_EXCEEDED error and show the user whatever
the server did give us. (find_basekeyspacedn): There is no guarantee that
namingContexts will be readable.

* Makefile.am: Link gpgkeys_ldap with libutil.a to get the replacement
functions (and eventually translations, etc).
This commit is contained in:
David Shaw 2004-02-20 14:59:02 +00:00
parent 7f148010ab
commit 925b982a0b
3 changed files with 65 additions and 38 deletions

View File

@ -1,3 +1,14 @@
2004-02-20 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_ldap.c: Replacement prototypes for setenv and unsetenv.
(search_key): Catch a SIZELIMIT_EXCEEDED error and show the user
whatever the server did give us.
(find_basekeyspacedn): There is no guarantee that namingContexts
will be readable.
* Makefile.am: Link gpgkeys_ldap with libutil.a to get the
replacement functions (and eventually translations, etc).
2004-02-19 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_ldap.c (ldap2epochtime): LDAP timestamps are UTC, so do

View File

@ -27,7 +27,8 @@ libexec_PROGRAMS = @GPGKEYS_LDAP@ @GPGKEYS_HKP@
libexec_SCRIPTS = @GPGKEYS_MAILTO@
noinst_SCRIPTS = gpgkeys_test
gpgkeys_ldap_LDADD = @LDAPLIBS@ @NETLIBS@ @GETOPT@ @W32LIBS@
gpgkeys_ldap_LDADD = ../util/libutil.a @LDAPLIBS@ @NETLIBS@ @LIBINTL@ \
@CAPLIBS@ @GETOPT@ @W32LIBS@
gpgkeys_hkp_LDADD = ../util/libutil.a @NETLIBS@ @SRVLIBS@ @LIBINTL@ \
@CAPLIBS@ @GETOPT@ @W32LIBS@

View File

@ -52,6 +52,14 @@ static char *pgpkeystr="pgpKey";
static FILE *input=NULL,*output=NULL,*console=NULL;
static LDAP *ldap=NULL;
#if !HAVE_SETENV
int setenv(const char *name, const char *value, int overwrite);
#endif
#if !HAVE_UNSETENV
int unsetenv(const char *name);
#endif
struct keylist
{
char str[MAX_LINE];
@ -592,7 +600,7 @@ search_key(char *searchkey)
err=ldap_search_s(ldap,basekeyspacedn,
LDAP_SCOPE_SUBTREE,search,attrs,0,&res);
if(err!=0)
if(err!=LDAP_SUCCESS && err!=LDAP_SIZELIMIT_EXCEEDED)
{
int errtag=ldap_err_to_gpg_err(err);
@ -627,6 +635,9 @@ search_key(char *searchkey)
each=ldap_next_entry(ldap,each);
}
if(err==LDAP_SIZELIMIT_EXCEEDED)
fprintf(console,"gpgkeys: search results exceeded server limit. First %d results shown.\n",count);
free_keylist(dupelist);
dupelist=NULL;
@ -825,6 +836,8 @@ find_basekeyspacedn(void)
if(err==LDAP_SUCCESS)
{
context=ldap_get_values(ldap,res,"namingContexts");
if(context)
{
attr[0]="pgpBaseKeySpaceDN";
attr[1]="pgpVersion";
attr[2]="pgpSoftware";
@ -876,6 +889,8 @@ find_basekeyspacedn(void)
}
ldap_value_free(context);
}
ldap_msgfree(res);
}
else