[svn] dirmngr - r249 - in trunk: . src tests
svn author marcus
cvs at cvs.gnupg.org
Thu Jul 26 02:24:54 CEST 2007
Author: marcus
Date: 2007-07-26 02:24:24 +0200 (Thu, 26 Jul 2007)
New Revision: 249
Added:
trunk/src/ldap-url.h
Modified:
trunk/ChangeLog
trunk/Makefile.am
trunk/src/ChangeLog
trunk/src/Makefile.am
trunk/src/dirmngr_ldap.c
trunk/src/ldap-url.c
trunk/src/ldap.c
trunk/tests/test-dirmngr.c
Log:
2007-07-26 Marcus Brinkmann <marcus at g10code.de>
* Makefile.am (tests): New variable.
(SUBDIRS): Replace tests with $(tests).
* tests/test-dirmngr.c: Include <config.h> and undefine
_ASSUAN_ONLY_GPG_ERRORS.
src/
2007-07-26 Marcus Brinkmann <marcus at g10code.de>
* dirmngr_ldap.c [HAVE_W32_SYSTEM]: Do not include <ldap.h>, but
<winsock2.h>, <winldap.h> and "ldap-url.h".
* ldap.c [HAVE_W32_SYSTEM]: Do not include <ldap.h>, but
<winsock2.h> and <winldap.h>.
* ldap-url.c: Do not include <ldap.h>, but <winsock2.h>,
<winldap.h> and "ldap-url.h".
(LDAP_P): New macro.
* ldap-url.h: New file.
* Makefile.am (ldap_url): Add ldap-url.h.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/ChangeLog 2007-07-26 00:24:24 UTC (rev 249)
@@ -1,10 +1,15 @@
2007-07-26 Marcus Brinkmann <marcus at g10code.de>
+ * Makefile.am (tests): New variable.
+ (SUBDIRS): Replace tests with $(tests).
+ * tests/test-dirmngr.c: Include <config.h> and undefine
+ _ASSUAN_ONLY_GPG_ERRORS.
+
* acinclude.m4 (GNUPG_PTH_VERSION_CHECK): Remove macro.
(GNUPG_CHECK_VA_COPY): Add macro.
* configure.ac: Call AM_ICONV and add vasprintf as a replacement
function (checking GNUPG_CHECK_VA_COPY if necessary).
-
+
2007-07-20 Marcus Brinkmann <marcus at g10code.de>
* acinclude.m4 (GNUPG_FUNC_MKDIR_TAKES_ONE_ARG): New.
Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/Makefile.am 2007-07-26 00:24:24 UTC (rev 249)
@@ -24,5 +24,10 @@
EXTRA_DIST = config.rpath autogen.sh
-SUBDIRS = m4 jnlib src po doc tests
+if HAVE_W32_SYSTEM
+tests =
+else
+tests = tests
+endif
+SUBDIRS = m4 jnlib src po doc $(tests)
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/src/ChangeLog 2007-07-26 00:24:24 UTC (rev 249)
@@ -1,5 +1,15 @@
2007-07-26 Marcus Brinkmann <marcus at g10code.de>
+ * dirmngr_ldap.c [HAVE_W32_SYSTEM]: Do not include <ldap.h>, but
+ <winsock2.h>, <winldap.h> and "ldap-url.h".
+ * ldap.c [HAVE_W32_SYSTEM]: Do not include <ldap.h>, but
+ <winsock2.h> and <winldap.h>.
+ * ldap-url.c: Do not include <ldap.h>, but <winsock2.h>,
+ <winldap.h> and "ldap-url.h".
+ (LDAP_P): New macro.
+ * ldap-url.h: New file.
+ * Makefile.am (ldap_url): Add ldap-url.h.
+
* Makefile.am (ldap_url): New variable.
(dirmngr_ldap_SOURCES): Add $(ldap_url).
(dirmngr_ldap_LDADD): Add $(LIBOBJS).
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/src/Makefile.am 2007-07-26 00:24:24 UTC (rev 249)
@@ -50,7 +50,7 @@
$(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(PTH_LIBS) $(LIBINTL)
if HAVE_W32_SYSTEM
-ldap_url = ldap-url.c
+ldap_url = ldap-url.h ldap-url.c
else
ldap_url =
endif
Modified: trunk/src/dirmngr_ldap.c
===================================================================
--- trunk/src/dirmngr_ldap.c 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/src/dirmngr_ldap.c 2007-07-26 00:24:24 UTC (rev 249)
@@ -30,10 +30,16 @@
#include <assert.h>
#include <sys/time.h>
#include <unistd.h>
+
+#ifdef HAVE_W32_SYSTEM
+#include <winsock2.h>
+#include <winldap.h>
+#include "ldap-url.h"
+#else
#include <ldap.h>
+#endif
-
#define JNLIB_NEED_LOG_LOGV
#include "../jnlib/logging.h"
#include "../jnlib/argparse.h"
Modified: trunk/src/ldap-url.c
===================================================================
--- trunk/src/ldap-url.c 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/src/ldap-url.c 2007-07-26 00:24:24 UTC (rev 249)
@@ -71,13 +71,16 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include <ldap.h>
-#define LDAP_URL_URLCOLON "URL:"
+#include <winsock2.h>
+#include <winldap.h>
+#include "ldap-url.h"
+#define LDAP_P(protos) protos
+#define LDAP_URL_URLCOLON "URL:"
#define LDAP_URL_URLCOLON_LEN (sizeof(LDAP_URL_URLCOLON)-1)
#define LDAP_URL_PREFIX "ldap://"
#define LDAP_URL_PREFIX_LEN (sizeof(LDAP_URL_PREFIX)-1)
-#define LDAPS_URL_PREFIX "ldaps://"
+#define LDAPS_URL_PREFIX "ldaps://"
#define LDAPS_URL_PREFIX_LEN (sizeof(LDAPS_URL_PREFIX)-1)
#define LDAPI_URL_PREFIX "ldapi://"
#define LDAPI_URL_PREFIX_LEN (sizeof(LDAPI_URL_PREFIX)-1)
@@ -92,6 +95,7 @@
#define Debug(a,b,c,d,e)
void ldap_pvt_hex_unescape( char *s );
+
/* $OpenLDAP: pkg/ldap/libraries/libldap/charray.c,v 1.9.2.2 2003/03/03 17:10:04 kurt Exp $ */
/*
Added: trunk/src/ldap-url.h
===================================================================
--- trunk/src/ldap-url.h 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/src/ldap-url.h 2007-07-26 00:24:24 UTC (rev 249)
@@ -0,0 +1,50 @@
+/* Copyright 2007 g10 Code GmbH
+
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications, as long as this notice is preserved.
+
+ This file is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, to the extent permitted by law; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. */
+
+#ifndef LDAP_URL_H
+#define LDAP_URL_H 1
+
+#define LDAP_CONST const
+
+typedef struct ldap_url_desc
+{
+ struct ldap_url_desc *lud_next;
+ char *lud_scheme;
+ char *lud_host;
+ int lud_port;
+ char *lud_dn;
+ char **lud_attrs;
+ int lud_scope;
+ char *lud_filter;
+ char **lud_exts;
+ int lud_crit_exts;
+} LDAPURLDesc;
+
+#define LDAP_URL_SUCCESS 0x00
+#define LDAP_URL_ERR_MEM 0x01
+#define LDAP_URL_ERR_PARAM 0x02
+
+#define LDAP_URL_ERR_BADSCHEME 0x03
+#define LDAP_URL_ERR_BADENCLOSURE 0x04
+#define LDAP_URL_ERR_BADURL 0x05
+#define LDAP_URL_ERR_BADHOST 0x06
+#define LDAP_URL_ERR_BADATTRS 0x07
+#define LDAP_URL_ERR_BADSCOPE 0x08
+#define LDAP_URL_ERR_BADFILTER 0x09
+#define LDAP_URL_ERR_BADEXTS 0x0a
+
+#define LDAPS_PORT 636
+
+int ldap_is_ldap_url (LDAP_CONST char *url);
+int ldap_url_parse (LDAP_CONST char *url_in, LDAPURLDesc **ludpp);
+void ldap_free_urldesc (LDAPURLDesc *ludp);
+
+#endif /* !LDAP_URL_H */
Modified: trunk/src/ldap.c
===================================================================
--- trunk/src/ldap.c 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/src/ldap.c 2007-07-26 00:24:24 UTC (rev 249)
@@ -28,7 +28,12 @@
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
+#ifdef HAVE_W32_SYSTEM
+#include <winsock2.h>
+#include <winldap.h>
+#else
#include <ldap.h> /* fixme: remove it */
+#endif
#include <pth.h>
#include <ksba.h>
Modified: trunk/tests/test-dirmngr.c
===================================================================
--- trunk/tests/test-dirmngr.c 2007-07-25 23:20:23 UTC (rev 248)
+++ trunk/tests/test-dirmngr.c 2007-07-26 00:24:24 UTC (rev 249)
@@ -1,3 +1,6 @@
+#include <config.h>
+#undef _ASSUAN_ONLY_GPG_ERRORS
+
#include <errno.h>
#include <string.h>
#include <stdio.h>
More information about the Gnupg-commits
mailing list