2010-12-17 [colin] 3.7.8cvs6
authorColin Leroy <colin@colino.net>
Fri, 17 Dec 2010 00:26:23 +0000 (00:26 +0000)
committerColin Leroy <colin@colino.net>
Fri, 17 Dec 2010 00:26:23 +0000 (00:26 +0000)
* src/addressadd.c
* src/addressbook.c
* src/addrindex.c
* src/ldapquery.c
* src/ldapquery.h
* src/ldapserver.c
* src/ldapserver.h
* src/ldapupdate.c
* src/ldaputil.c
* src/ldaputil.h
Windows build fixes (w32 LDAP completely untested!)

13 files changed:
ChangeLog
PATCHSETS
configure.ac
src/addressadd.c
src/addressbook.c
src/addrindex.c
src/ldapquery.c
src/ldapquery.h
src/ldapserver.c
src/ldapserver.h
src/ldapupdate.c
src/ldaputil.c
src/ldaputil.h

index ded6784..8dac12d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-12-17 [colin]     3.7.8cvs6
+
+       * src/addressadd.c
+       * src/addressbook.c
+       * src/addrindex.c
+       * src/ldapquery.c
+       * src/ldapquery.h
+       * src/ldapserver.c
+       * src/ldapserver.h
+       * src/ldapupdate.c
+       * src/ldaputil.c
+       * src/ldaputil.h
+               Windows build fixes (w32 LDAP completely untested!)
+
 2010-12-16 [colin]     3.7.8cvs5
 
        * src/addrindex.c
index d73656e..7a4bc18 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.43.2.85 -r 1.43.2.86 src/prefs_matcher.c;  ) > 3.7.8cvs3.patchset
 ( cvs diff -u -r 1.5.2.40 -r 1.5.2.41 src/prefs_spelling.c;  cvs diff -u -r 1.9.2.49 -r 1.9.2.50 src/common/defs.h;  ) > 3.7.8cvs4.patchset
 ( cvs diff -u -r 1.28.2.44 -r 1.28.2.45 src/addrindex.c;  cvs diff -u -r 1.8.2.37 -r 1.8.2.38 src/editldap.c;  cvs diff -u -r 1.2.2.21 -r 1.2.2.22 src/ldapctrl.c;  cvs diff -u -r 1.3.2.34 -r 1.3.2.35 src/ldapquery.c;  cvs diff -u -r 1.4.2.18 -r 1.4.2.19 src/ldapserver.c;  cvs diff -u -r 1.2.2.11 -r 1.2.2.12 src/ldapserver.h;  cvs diff -u -r 1.1.2.24 -r 1.1.2.25 src/ldapupdate.c;  cvs diff -u -r 1.1.4.16 -r 1.1.4.17 src/ldaputil.c;  ) > 3.7.8cvs5.patchset
+( cvs diff -u -r 1.9.2.30 -r 1.9.2.31 src/addressadd.c;  cvs diff -u -r 1.60.2.138 -r 1.60.2.139 src/addressbook.c;  cvs diff -u -r 1.28.2.45 -r 1.28.2.46 src/addrindex.c;  cvs diff -u -r 1.3.2.35 -r 1.3.2.36 src/ldapquery.c;  cvs diff -u -r 1.4.2.13 -r 1.4.2.14 src/ldapquery.h;  cvs diff -u -r 1.4.2.19 -r 1.4.2.20 src/ldapserver.c;  cvs diff -u -r 1.2.2.12 -r 1.2.2.13 src/ldapserver.h;  cvs diff -u -r 1.1.2.25 -r 1.1.2.26 src/ldapupdate.c;  cvs diff -u -r 1.1.4.17 -r 1.1.4.18 src/ldaputil.c;  cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/ldaputil.h;  ) > 3.7.8cvs6.patchset
index 8928365..12a35cb 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=5
+EXTRA_VERSION=6
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
@@ -666,6 +666,12 @@ elif test x"$ac_cv_enable_ldap" = xyes -a x"$ac_cv_enable_pthread" = xno; then
        AC_MSG_RESULT(no - LDAP support needs pthread support)
 
        ac_cv_enable_ldap=no
+elif test x"$platform_win32" = xyes; then
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(USE_LDAP, 1, Define if you want LDAP support in addressbook.)
+       AC_DEFINE(USE_LDAP_TLS, 1, Define if you want LDAP TLS support in addressbook.)
+       LDAP_LIBS="-lwldap32"
+       AC_SUBST(LDAP_LIBS)
 else
        AC_MSG_RESULT(yes)
 
index afd7438..13328b2 100644 (file)
@@ -332,10 +332,10 @@ static void addressadd_load_data( AddressIndex *addrIndex ) {
        gtk_cmclist_clear( GTK_CMCLIST( tree ) );
        list = addrindex_get_interface_list( addrIndex );
        while( list ) {
-               AddressInterface *interface = list->data;
-               if( interface->type == ADDR_IF_BOOK || 
-                               interface->type == ADDR_IF_LDAP ) {
-                       nodeDS = interface->listSource;
+               AddressInterface *ainterface = list->data;
+               if( ainterface->type == ADDR_IF_BOOK || 
+                               ainterface->type == ADDR_IF_LDAP ) {
+                       nodeDS = ainterface->listSource;
                        while( nodeDS ) {
                                ds = nodeDS->data;
                                dsName = g_strdup( addrindex_ds_get_name( ds ) );
index f608e79..0dd13f3 100644 (file)
@@ -91,7 +91,9 @@
 #include "expldifdlg.h"
 #include "browseldap.h"
 #include "addrcustomattr.h"
-
+#ifdef G_OS_WIN32
+#undef interface
+#endif
 typedef enum
 {
        COL_SOURCES     = 0,
index 953051f..bb3ca72 100644 (file)
 #include "ldaputil.h"
 #endif
 
+#ifdef G_OS_WIN32
+#undef interface
+#endif
+
 #define TAG_ADDRESS_INDEX    "addressbook"
 
 #define TAG_IF_ADDRESS_BOOK  "book_list"
index 4e78a7e..2af3efe 100644 (file)
@@ -30,7 +30,6 @@
 #include <glib.h>
 #include <sys/time.h>
 #include <string.h>
-#include <lber.h>
 
 #include "defs.h"
 #include "ldaputil.h"
@@ -992,9 +991,6 @@ static void ldapqry_destroyer( void * ptr ) {
        qry = ( LdapQuery * ) ptr;
        cm_return_if_fail( qry != NULL );
 
-       debug_print("ldapqry_destroyer::%d::%s\n", (int) pthread_self(),
-                       ADDRQUERY_NAME(qry)?ADDRQUERY_NAME(qry):"null");
-
        /* Perform any destruction here */
        if( qry->control != NULL ) {
                ldapctl_free( qry->control );
@@ -1011,8 +1007,6 @@ static void ldapqry_destroyer( void * ptr ) {
 void ldapqry_cancel( LdapQuery *qry ) {
        cm_return_if_fail( qry != NULL );
 
-       debug_print("cancelling::%d::%s\n", (int) pthread_self(),
-                       ADDRQUERY_NAME(qry)?ADDRQUERY_NAME(qry):"null");
        if( ldapqry_get_busy_flag( qry ) ) {
                if( qry->thread ) {
                        debug_print("calling pthread_cancel\n");
index 7682123..1af0abf 100644 (file)
 #include <stdio.h>
 #include <sys/time.h>
 #include <pthread.h>
-#include <ldap.h>
 
+#ifdef G_OS_UNIX
+#include <ldap.h>
+#include <lber.h>
+#else
+#include <windows.h>
+#include <winldap.h>
+#endif
 #include "addrquery.h"
 #include "ldapctrl.h"
 #include "addritem.h"
index 86d5ad8..670cbab 100644 (file)
@@ -30,8 +30,6 @@
 #include <glib.h>
 #include <sys/time.h>
 #include <string.h>
-#include <ldap.h>
-#include <lber.h>
 
 #include "mgutils.h"
 #include "addritem.h"
@@ -719,17 +717,21 @@ gint ldapsvr_read_data( LdapServer *server )
 void ldapsrv_set_options (gint secs, LDAP *ld)
 {
        static struct timeval timeout;
-       int i = LDAP_OPT_X_TLS_ALLOW;
        int rc;
+       int i;
        timeout.tv_sec = secs;
        timeout.tv_usec = 0;
+#ifdef G_OS_UNIX
+       i = LDAP_OPT_X_TLS_ALLOW;
        rc = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &i);
        debug_print("cert %s\n", ldap_err2string(rc));
-       
        /* can crash old libldaps... */
        rc = ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, &timeout);
        debug_print("tm %s\n", ldap_err2string(rc));
-
+#else
+       rc = ldap_set_option(NULL, LDAP_OPT_TIMELIMIT, &secs);
+       debug_print("tm %s\n", ldap_err2string(rc));
+#endif
 }
 
 /**
@@ -750,7 +752,11 @@ LDAP *ldapsvr_connect(LdapControl *ctl) {
        uri = g_strdup_printf("ldap%s://%s:%d",
                                ctl->enableSSL?"s":"",
                                ctl->hostName, ctl->port);
+#ifdef G_OS_UNIX
        ldap_initialize(&ld, uri);
+#else
+       ld = ldap_sslinit(ctl->hostName, ctl->port, ctl->enableSSL);
+#endif
        g_free(uri);
 
        if (ld == NULL)
index 665ec82..b1ce229 100644 (file)
 #ifdef USE_LDAP
 
 #include <glib.h>
+#ifdef G_OS_UNIX
 #include <ldap.h>
+#else
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <errno.h>
+#include <windows.h>
+#include <winldap.h>
+#include <winber.h>
+#endif
 
 #include "ldapctrl.h"
 #include "addritem.h"
index 397a95a..5d42fb0 100644 (file)
@@ -43,8 +43,6 @@
 #include <glib/gi18n.h>
 #include <sys/time.h>
 #include <string.h>
-#include <ldap.h>
-#include <lber.h>
 
 #include "ldapupdate.h"
 #include "mgutils.h"
index 2dc77cf..9c74f07 100644 (file)
 #include <glib.h>
 #include <string.h>
 #include <sys/time.h>
-#include <ldap.h>
-#include <lber.h>
 #include <errno.h>
 #include "common/utils.h"
+#include "ldaputil.h"
 #include "ldapserver.h"
 #include "ldapctrl.h"
 
@@ -208,8 +207,12 @@ int claws_ldap_simple_bind_s( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *pa
        }
 
        debug_print("binding: DN->%s\n", dn?dn:"null");
+#ifdef G_OS_UNIX
        return ldap_sasl_bind_s( ld, dn, LDAP_SASL_SIMPLE, &cred,
                NULL, NULL, NULL );
+#else
+       return ldap_simple_bind_s(ld, dn, passwd);
+#endif
 }
 
 /**
@@ -253,7 +256,11 @@ GList *ldaputil_read_basedn(
        if (baseDN)
                debug_print("Using LDAP v3\n");
 
+#ifdef G_OS_UNIX
        if( baseDN == NULL && !LDAP_API_ERROR(rc) ) {
+#else
+       if( baseDN == NULL) {
+#endif
                baseDN = ldaputil_test_v2( ld, tov );
                if (baseDN)
                        debug_print("Using LDAP v2\n");
index 15733be..db6ed99 100644 (file)
 #ifdef USE_LDAP
 
 #include <glib.h>
+#ifdef G_OS_UNIX
 #include <ldap.h>
+#include <lber.h>
+#else
+#include <windows.h>
+#include <winldap.h>
+#define LDAP_CONST const
+#define ldap_unbind_ext(ld,x,y) ldap_unbind_s(ld)
+#define LDAP_ADMINLIMIT_EXCEEDED LDAP_ADMIN_LIMIT_EXCEEDED
+#define timeval l_timeval
+#endif
 /* Function Prototypes */
 GList *ldaputil_read_basedn    ( const gchar *host, const gint port,
                                  const gchar *bindDN, const gchar *bindPW,