[Pkg-openldap-devel] r948 - in openldap/trunk/debian: . patches

Russ Allbery rra at alioth.debian.org
Fri Dec 21 20:23:08 UTC 2007


Author: rra
Date: 2007-12-21 20:23:07 +0000 (Fri, 21 Dec 2007)
New Revision: 948

Added:
   openldap/trunk/debian/patches/evolution-ntlm
Removed:
   openldap/trunk/debian/patches/ntlm-ldap_h-hack
   openldap/trunk/debian/patches/ntlm_c
Modified:
   openldap/trunk/debian/changelog
   openldap/trunk/debian/patches/libldap-makefile_in
   openldap/trunk/debian/patches/series
Log:
* Patch cleanup:
  - Combine the NTLM patches for Evolution into a single patch.

Modified: openldap/trunk/debian/changelog
===================================================================
--- openldap/trunk/debian/changelog	2007-12-21 09:05:38 UTC (rev 947)
+++ openldap/trunk/debian/changelog	2007-12-21 20:23:07 UTC (rev 948)
@@ -73,6 +73,8 @@
     - Remove obsolete information about TLS/SSL and OpenLDAP 2.0 upgrades.
     - Recommend HDB instead of BDB.
     - Generally reformat and reorganize.
+  * Patch cleanup:
+    - Combine the NTLM patches for Evolution into a single patch.
   * Update Vcs-* headers for new repository layout.
   * Remove versioned dependency on an ancient dpkg-dev.
   * Wrap and reorder Build-Depends for readability.

Added: openldap/trunk/debian/patches/evolution-ntlm
===================================================================
--- openldap/trunk/debian/patches/evolution-ntlm	                        (rev 0)
+++ openldap/trunk/debian/patches/evolution-ntlm	2007-12-21 20:23:07 UTC (rev 948)
@@ -0,0 +1,217 @@
+Patch from evolution-exchange (2.10.3).  The ldap_ntlm_bind function is
+actually called by evolution-data-server, checked at version 1.12.2.
+Without this patch, the Exchange addressbook integration uses simple binds
+with cleartext passwords.
+
+Russ checked with openldap-software for upstream's opinion on this patch
+on 2007-12-21.  No results yet.
+
+--- openldap.orig/include/ldap.h
++++ openldap/include/ldap.h
+@@ -2343,5 +2343,25 @@
+ 
+ #endif /* LDAP_CONTROL_X_SESSION_TRACKING */
+ 
++/*
++ * hacks for NTLM
++ */
++#define LDAP_AUTH_NTLM_REQUEST ((ber_tag_t) 0x8aU)
++#define LDAP_AUTH_NTLM_RESPONSE  ((ber_tag_t) 0x8bU)
++LDAP_F( int )
++ldap_ntlm_bind LDAP_P((
++      LDAP    *ld,
++      LDAP_CONST char *dn,
++      ber_tag_t tag,
++      struct berval *cred,
++      LDAPControl **sctrls,
++      LDAPControl **cctrls,
++      int   *msgidp ));
++LDAP_F( int )
++ldap_parse_ntlm_bind_result LDAP_P((
++      LDAP    *ld,
++      LDAPMessage *res,
++      struct berval *challenge));
++
+ LDAP_END_DECL
+ #endif /* _LDAP_H */
+--- /dev/null
++++ openldap/libraries/libldap/ntlm.c
+@@ -0,0 +1,138 @@
++/* $OpenLDAP: pkg/ldap/libraries/libldap/ntlm.c,v 1.1.4.10 2002/01/04 20:38:21 kurt Exp $ */
++/*
++ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
++ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
++ */
++
++/* Mostly copied from sasl.c */
++
++#include "portable.h"
++
++#include <stdlib.h>
++#include <stdio.h>
++
++#include <ac/socket.h>
++#include <ac/string.h>
++#include <ac/time.h>
++#include <ac/errno.h>
++
++#include "ldap-int.h"
++
++int
++ldap_ntlm_bind(
++ LDAP    *ld,
++ LDAP_CONST char *dn,
++ ber_tag_t tag,
++ struct berval *cred,
++ LDAPControl **sctrls,
++ LDAPControl **cctrls,
++ int   *msgidp )
++{
++ BerElement  *ber;
++ int rc;
++ ber_int_t id;
++
++ Debug( LDAP_DEBUG_TRACE, "ldap_ntlm_bind\n", 0, 0, 0 );
++
++ assert( ld != NULL );
++ assert( LDAP_VALID( ld ) );
++ assert( msgidp != NULL );
++
++ if( msgidp == NULL ) {
++   ld->ld_errno = LDAP_PARAM_ERROR;
++   return ld->ld_errno;
++ }
++
++ /* create a message to send */
++ if ( (ber = ldap_alloc_ber_with_options( ld )) == NULL ) {
++   ld->ld_errno = LDAP_NO_MEMORY;
++   return ld->ld_errno;
++ }
++
++ assert( LBER_VALID( ber ) );
++
++ LDAP_NEXT_MSGID( ld, id );
++ rc = ber_printf( ber, "{it{istON}" /*}*/,
++      id, LDAP_REQ_BIND,
++      ld->ld_version, dn, tag,
++      cred );
++
++ /* Put Server Controls */
++ if( ldap_int_put_controls( ld, sctrls, ber ) != LDAP_SUCCESS ) {
++   ber_free( ber, 1 );
++   return ld->ld_errno;
++ }
++
++ if ( ber_printf( ber, /*{*/ "N}" ) == -1 ) {
++   ld->ld_errno = LDAP_ENCODING_ERROR;
++   ber_free( ber, 1 );
++   return ld->ld_errno;
++ }
++
++ /* send the message */
++ *msgidp = ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber, id );
++
++ if(*msgidp < 0)
++   return ld->ld_errno;
++
++ return LDAP_SUCCESS;
++}
++
++int
++ldap_parse_ntlm_bind_result(
++ LDAP    *ld,
++ LDAPMessage *res,
++ struct berval *challenge)
++{
++ ber_int_t errcode;
++ ber_tag_t tag;
++ BerElement  *ber;
++ ber_len_t len;
++
++ Debug( LDAP_DEBUG_TRACE, "ldap_parse_ntlm_bind_result\n", 0, 0, 0 );
++
++ assert( ld != NULL );
++ assert( LDAP_VALID( ld ) );
++ assert( res != NULL );
++
++ if ( ld == NULL || res == NULL ) {
++   return LDAP_PARAM_ERROR;
++ }
++
++ if( res->lm_msgtype != LDAP_RES_BIND ) {
++   ld->ld_errno = LDAP_PARAM_ERROR;
++   return ld->ld_errno;
++ }
++
++ if ( ld->ld_error ) {
++   LDAP_FREE( ld->ld_error );
++   ld->ld_error = NULL;
++ }
++ if ( ld->ld_matched ) {
++   LDAP_FREE( ld->ld_matched );
++   ld->ld_matched = NULL;
++ }
++
++ /* parse results */
++
++ ber = ber_dup( res->lm_ber );
++
++ if( ber == NULL ) {
++   ld->ld_errno = LDAP_NO_MEMORY;
++   return ld->ld_errno;
++ }
++
++ tag = ber_scanf( ber, "{ioa" /*}*/,
++      &errcode, challenge, &ld->ld_error );
++ ber_free( ber, 0 );
++
++ if( tag == LBER_ERROR ) {
++   ld->ld_errno = LDAP_DECODING_ERROR;
++   return ld->ld_errno;
++ }
++
++ ld->ld_errno = errcode;
++
++ return( ld->ld_errno );
++}
++
+--- openldap.orig/libraries/libldap/Makefile.in
++++ openldap/libraries/libldap/Makefile.in
+@@ -26,7 +26,7 @@
+ 	request.c os-ip.c url.c pagectrl.c sortctrl.c vlvctrl.c \
+ 	init.c options.c print.c string.c util-int.c schema.c \
+ 	charray.c tls.c os-local.c dnssrv.c utf-8.c utf-8-conv.c \
+-	turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c
++	turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c ntlm.c
+ 
+ OBJS	= bind.lo open.lo result.lo error.lo compare.lo search.lo \
+ 	controls.lo messages.lo references.lo extended.lo cyrus.lo \
+@@ -37,7 +37,7 @@
+ 	request.lo os-ip.lo url.lo pagectrl.lo sortctrl.lo vlvctrl.lo \
+ 	init.lo options.lo print.lo string.lo util-int.lo schema.lo \
+ 	charray.lo tls.lo os-local.lo dnssrv.lo utf-8.lo utf-8-conv.lo \
+-	turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo
++	turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo ntlm.lo
+ 
+ LDAP_INCDIR= ../../include       
+ LDAP_LIBDIR= ../../libraries
+--- openldap.orig/libraries/libldap_r/Makefile.in
++++ openldap/libraries/libldap_r/Makefile.in
+@@ -28,7 +28,7 @@
+ 	request.c os-ip.c url.c pagectrl.c sortctrl.c vlvctrl.c \
+ 	init.c options.c print.c string.c util-int.c schema.c \
+ 	charray.c tls.c os-local.c dnssrv.c utf-8.c utf-8-conv.c \
+-	turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c
++	turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c ntlm.c
+ SRCS	= threads.c rdwr.c rmutex.c tpool.c rq.c \
+ 	thr_posix.c thr_cthreads.c thr_thr.c thr_lwp.c thr_nt.c \
+ 	thr_pth.c thr_stub.c thr_debug.c
+@@ -44,7 +44,7 @@
+ 	request.lo os-ip.lo url.lo pagectrl.lo sortctrl.lo vlvctrl.lo \
+ 	init.lo options.lo print.lo string.lo util-int.lo schema.lo \
+ 	charray.lo tls.lo os-local.lo dnssrv.lo utf-8.lo utf-8-conv.lo \
+-	turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo
++	turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo ntlm.lo
+ 
+ LDAP_INCDIR= ../../include       
+ LDAP_LIBDIR= ../../libraries

Modified: openldap/trunk/debian/patches/libldap-makefile_in
===================================================================
--- openldap/trunk/debian/patches/libldap-makefile_in	2007-12-21 09:05:38 UTC (rev 947)
+++ openldap/trunk/debian/patches/libldap-makefile_in	2007-12-21 20:23:07 UTC (rev 948)
@@ -1,49 +1,9 @@
-Add the necessary makefile logic for the NTLM code.
+Link libldap_r directly with the threading libraries.  Otherwise, it gets
+unversioned references to the pthread symbols, which is a time bomb should
+the ABI ever change (as it did with glibc on alpha in the past).
 
-Index: trunk/libraries/libldap/Makefile.in
-===================================================================
---- trunk.orig/libraries/libldap/Makefile.in
-+++ trunk/libraries/libldap/Makefile.in
-@@ -26,7 +26,7 @@
- 	request.c os-ip.c url.c pagectrl.c sortctrl.c vlvctrl.c \
- 	init.c options.c print.c string.c util-int.c schema.c \
- 	charray.c tls.c os-local.c dnssrv.c utf-8.c utf-8-conv.c \
--	turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c
-+	turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c ntlm.c
- 
- OBJS	= bind.lo open.lo result.lo error.lo compare.lo search.lo \
- 	controls.lo messages.lo references.lo extended.lo cyrus.lo \
-@@ -37,7 +37,7 @@
- 	request.lo os-ip.lo url.lo pagectrl.lo sortctrl.lo vlvctrl.lo \
- 	init.lo options.lo print.lo string.lo util-int.lo schema.lo \
- 	charray.lo tls.lo os-local.lo dnssrv.lo utf-8.lo utf-8-conv.lo \
--	turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo
-+	turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo ntlm.lo
- 
- LDAP_INCDIR= ../../include       
- LDAP_LIBDIR= ../../libraries
-Index: trunk/libraries/libldap_r/Makefile.in
-===================================================================
 --- trunk.orig/libraries/libldap_r/Makefile.in
 +++ trunk/libraries/libldap_r/Makefile.in
-@@ -28,7 +28,7 @@
- 	request.c os-ip.c url.c pagectrl.c sortctrl.c vlvctrl.c \
- 	init.c options.c print.c string.c util-int.c schema.c \
- 	charray.c tls.c os-local.c dnssrv.c utf-8.c utf-8-conv.c \
--	turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c
-+	turn.c ppolicy.c dds.c txn.c ldap_sync.c stctrl.c ntlm.c
- SRCS	= threads.c rdwr.c rmutex.c tpool.c rq.c \
- 	thr_posix.c thr_cthreads.c thr_thr.c thr_lwp.c thr_nt.c \
- 	thr_pth.c thr_stub.c thr_debug.c
-@@ -44,7 +44,7 @@
- 	request.lo os-ip.lo url.lo pagectrl.lo sortctrl.lo vlvctrl.lo \
- 	init.lo options.lo print.lo string.lo util-int.lo schema.lo \
- 	charray.lo tls.lo os-local.lo dnssrv.lo utf-8.lo utf-8-conv.lo \
--	turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo
-+	turn.lo ppolicy.lo dds.lo txn.lo ldap_sync.lo stctrl.lo ntlm.lo
- 
- LDAP_INCDIR= ../../include       
- LDAP_LIBDIR= ../../libraries
 @@ -56,7 +56,7 @@
  XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
  XXXLIBS = $(LTHREAD_LIBS)

Deleted: openldap/trunk/debian/patches/ntlm-ldap_h-hack
===================================================================
--- openldap/trunk/debian/patches/ntlm-ldap_h-hack	2007-12-21 09:05:38 UTC (rev 947)
+++ openldap/trunk/debian/patches/ntlm-ldap_h-hack	2007-12-21 20:23:07 UTC (rev 948)
@@ -1,30 +0,0 @@
-Index: include/ldap.h
-===================================================================
---- include/ldap.h.orig
-+++ include/ldap.h
-@@ -2343,5 +2343,25 @@
- 
- #endif /* LDAP_CONTROL_X_SESSION_TRACKING */
- 
-+/*
-+ * hacks for NTLM
-+ */
-+#define LDAP_AUTH_NTLM_REQUEST ((ber_tag_t) 0x8aU)
-+#define LDAP_AUTH_NTLM_RESPONSE  ((ber_tag_t) 0x8bU)
-+LDAP_F( int )
-+ldap_ntlm_bind LDAP_P((
-+      LDAP    *ld,
-+      LDAP_CONST char *dn,
-+      ber_tag_t tag,
-+      struct berval *cred,
-+      LDAPControl **sctrls,
-+      LDAPControl **cctrls,
-+      int   *msgidp ));
-+LDAP_F( int )
-+ldap_parse_ntlm_bind_result LDAP_P((
-+      LDAP    *ld,
-+      LDAPMessage *res,
-+      struct berval *challenge));
-+
- LDAP_END_DECL
- #endif /* _LDAP_H */

Deleted: openldap/trunk/debian/patches/ntlm_c
===================================================================
--- openldap/trunk/debian/patches/ntlm_c	2007-12-21 09:05:38 UTC (rev 947)
+++ openldap/trunk/debian/patches/ntlm_c	2007-12-21 20:23:07 UTC (rev 948)
@@ -1,142 +0,0 @@
-diff -urNad openldap2.3-2.3.11~/libraries/libldap/ntlm.c openldap2.3-2.3.11/libraries/libldap/ntlm.c
---- openldap2.3-2.3.11~/libraries/libldap/ntlm.c	1970-01-01 01:00:00.000000000 +0100
-+++ openldap2.3-2.3.11/libraries/libldap/ntlm.c	2005-12-02 09:47:08.226364500 +0100
-@@ -0,0 +1,138 @@
-+/* $OpenLDAP: pkg/ldap/libraries/libldap/ntlm.c,v 1.1.4.10 2002/01/04 20:38:21 kurt Exp $ */
-+/*
-+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
-+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
-+ */
-+
-+/* Mostly copied from sasl.c */
-+
-+#include "portable.h"
-+
-+#include <stdlib.h>
-+#include <stdio.h>
-+
-+#include <ac/socket.h>
-+#include <ac/string.h>
-+#include <ac/time.h>
-+#include <ac/errno.h>
-+
-+#include "ldap-int.h"
-+
-+int
-+ldap_ntlm_bind(
-+ LDAP    *ld,
-+ LDAP_CONST char *dn,
-+ ber_tag_t tag,
-+ struct berval *cred,
-+ LDAPControl **sctrls,
-+ LDAPControl **cctrls,
-+ int   *msgidp )
-+{
-+ BerElement  *ber;
-+ int rc;
-+ ber_int_t id;
-+
-+ Debug( LDAP_DEBUG_TRACE, "ldap_ntlm_bind\n", 0, 0, 0 );
-+
-+ assert( ld != NULL );
-+ assert( LDAP_VALID( ld ) );
-+ assert( msgidp != NULL );
-+
-+ if( msgidp == NULL ) {
-+   ld->ld_errno = LDAP_PARAM_ERROR;
-+   return ld->ld_errno;
-+ }
-+
-+ /* create a message to send */
-+ if ( (ber = ldap_alloc_ber_with_options( ld )) == NULL ) {
-+   ld->ld_errno = LDAP_NO_MEMORY;
-+   return ld->ld_errno;
-+ }
-+
-+ assert( LBER_VALID( ber ) );
-+
-+ LDAP_NEXT_MSGID( ld, id );
-+ rc = ber_printf( ber, "{it{istON}" /*}*/,
-+      id, LDAP_REQ_BIND,
-+      ld->ld_version, dn, tag,
-+      cred );
-+
-+ /* Put Server Controls */
-+ if( ldap_int_put_controls( ld, sctrls, ber ) != LDAP_SUCCESS ) {
-+   ber_free( ber, 1 );
-+   return ld->ld_errno;
-+ }
-+
-+ if ( ber_printf( ber, /*{*/ "N}" ) == -1 ) {
-+   ld->ld_errno = LDAP_ENCODING_ERROR;
-+   ber_free( ber, 1 );
-+   return ld->ld_errno;
-+ }
-+
-+ /* send the message */
-+ *msgidp = ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber, id );
-+
-+ if(*msgidp < 0)
-+   return ld->ld_errno;
-+
-+ return LDAP_SUCCESS;
-+}
-+
-+int
-+ldap_parse_ntlm_bind_result(
-+ LDAP    *ld,
-+ LDAPMessage *res,
-+ struct berval *challenge)
-+{
-+ ber_int_t errcode;
-+ ber_tag_t tag;
-+ BerElement  *ber;
-+ ber_len_t len;
-+
-+ Debug( LDAP_DEBUG_TRACE, "ldap_parse_ntlm_bind_result\n", 0, 0, 0 );
-+
-+ assert( ld != NULL );
-+ assert( LDAP_VALID( ld ) );
-+ assert( res != NULL );
-+
-+ if ( ld == NULL || res == NULL ) {
-+   return LDAP_PARAM_ERROR;
-+ }
-+
-+ if( res->lm_msgtype != LDAP_RES_BIND ) {
-+   ld->ld_errno = LDAP_PARAM_ERROR;
-+   return ld->ld_errno;
-+ }
-+
-+ if ( ld->ld_error ) {
-+   LDAP_FREE( ld->ld_error );
-+   ld->ld_error = NULL;
-+ }
-+ if ( ld->ld_matched ) {
-+   LDAP_FREE( ld->ld_matched );
-+   ld->ld_matched = NULL;
-+ }
-+
-+ /* parse results */
-+
-+ ber = ber_dup( res->lm_ber );
-+
-+ if( ber == NULL ) {
-+   ld->ld_errno = LDAP_NO_MEMORY;
-+   return ld->ld_errno;
-+ }
-+
-+ tag = ber_scanf( ber, "{ioa" /*}*/,
-+      &errcode, challenge, &ld->ld_error );
-+ ber_free( ber, 0 );
-+
-+ if( tag == LBER_ERROR ) {
-+   ld->ld_errno = LDAP_DECODING_ERROR;
-+   return ld->ld_errno;
-+ }
-+
-+ ld->ld_errno = errcode;
-+
-+ return( ld->ld_errno );
-+}
-+

Modified: openldap/trunk/debian/patches/series
===================================================================
--- openldap/trunk/debian/patches/series	2007-12-21 09:05:38 UTC (rev 947)
+++ openldap/trunk/debian/patches/series	2007-12-21 20:23:07 UTC (rev 948)
@@ -1,6 +1,5 @@
 man-slapd -p0
-ntlm-ldap_h-hack -p0
-ntlm_c
+evolution-ntlm
 libldap-makefile_in
 add-autogen-sh
 slapi-errorlog-file -p0




More information about the Pkg-openldap-devel mailing list