tags 463046 patch
thanks

Hi Florian,

I've revised the patch for this bug after testing, and also adjusted the
build dependencies to transition from db4.5 to db4.6 in the process.  The
new, confirmed working patch is attached.

As the LDAP build failure is an RC bug, I'm going to go ahead and upload
this fix as a zero-day NMU.  But I wonder, do you still use this package?
I was surprised when I fired up the program to see that it's based on XForms
and found the UI painful, and there are a *lot* of compile-time warnings
suggesting that the code is long unmaintained upstream.  Should we consider
removing it from the archive as obsolete?  

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
[EMAIL PROTECTED]                                     [EMAIL PROTECTED]
diff -u xfmail-1.5.5/debian/control xfmail-1.5.5/debian/control
--- xfmail-1.5.5/debian/control
+++ xfmail-1.5.5/debian/control
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Florian Hinzmann <[EMAIL PROTECTED]>
 Standards-Version: 3.7.2
-Build-Depends: dpatch, debhelper (>= 4), libforms-dev, libxt-dev, libx11-dev, libxpm-dev, x-dev, libdb4.5-dev, libgdbm-dev, libglib1.2-dev, libcompfaceg1-dev, libesd0-dev, libldap2-dev, libmcrypt-dev, autotools-dev
+Build-Depends: dpatch, debhelper (>= 4), libforms-dev, libxt-dev, libx11-dev, libxpm-dev, x-dev, libdb4.6-dev, libgdbm-dev, libglib1.2-dev, libcompfaceg1-dev, libesd0-dev, libldap2-dev, libmcrypt-dev, autotools-dev
 
 Package: xfmail
 Architecture: any
diff -u xfmail-1.5.5/debian/changelog xfmail-1.5.5/debian/changelog
--- xfmail-1.5.5/debian/changelog
+++ xfmail-1.5.5/debian/changelog
@@ -1,3 +1,12 @@
+xfmail (1.5.5-4.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * add patches/60_openldap_2.4.dpatch, to fix FTBFS with openldap 2.4.
+    Closes: #463046.
+  * Build against libdb4.6 instead of libdb4.5.
+
+ -- Steve Langasek <[EMAIL PROTECTED]>  Mon, 28 Jan 2008 19:04:13 -0800
+
 xfmail (1.5.5-4.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u xfmail-1.5.5/debian/patches/00list xfmail-1.5.5/debian/patches/00list
--- xfmail-1.5.5/debian/patches/00list
+++ xfmail-1.5.5/debian/patches/00list
@@ -5,0 +6 @@
+60_openldap_2.4.dpatch
only in patch2:
unchanged:
--- xfmail-1.5.5.orig/debian/patches/60_openldap_2.4.dpatch
+++ xfmail-1.5.5/debian/patches/60_openldap_2.4.dpatch
@@ -0,0 +1,104 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 60_openldap_2.4.dpatch by Steve Langasek <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: eliminate use of deprecated ldap functions, to support building
+## DP: against OpenLDAP 2.4.  Debian bug #463046.
+
[EMAIL PROTECTED]@
+diff -urNad xfmail-1.5.5~/src/mail/ldap.cpp xfmail-1.5.5/src/mail/ldap.cpp
+--- xfmail-1.5.5~/src/mail/ldap.cpp	2008-02-06 02:35:06.000000000 +0000
++++ xfmail-1.5.5/src/mail/ldap.cpp	2008-02-06 02:41:10.000000000 +0000
+@@ -149,35 +149,35 @@
+ {
+ 	//cerr << "init_LDAP called ";
+ 	if (ld == NULL) {
+-        string sHostPort;
+         string sHost;
+         string sPort;
+ 
+ 		if(!Config.exist("LDAPserver"))
+             return 0;
+ 
+-		sHost = Config.get("LDAPserver", "");
++		sHost = "ldap://";;
++		sHost.append(Config.get("LDAPserver", ""));
+ 
+ 		if(Config.exist("LDAPport")) {
+ 		    sPort = Config.get("LDAPport", "");
+             sHost.append(":" + sPort);
+         }
+ 
+-		ld = ldap_init(sHost.c_str(), LDAP_PORT);
++		ldap_initialize(&ld,sHost.c_str());
+ 		if (ld == NULL) {
+-			//cerr << "ldap_init failure" << endl;
+-			display_msg(MSG_WARN, "LDAP", "Failure in ldap_init! Bad options?");
++			//cerr << "ldap_initialize failure" << endl;
++			display_msg(MSG_WARN, "LDAP", "Failure in ldap_initialize! Bad options?");
+ 			return -1;
+ 		}
+ 	}
+ 
+ 	if (!ldap_bound) {
+-		if (ldap_simple_bind_s(ld, NULL, NULL) != LDAP_SUCCESS) {
+-			//cerr << "ldap_simple_bind_s failure" << endl;
++		if (ldap_sasl_bind_s(ld, NULL, LDAP_SASL_SIMPLE, NULL, NULL, NULL, NULL) != LDAP_SUCCESS) {
++			//cerr << "ldap_sasl_bind_s failure" << endl;
+ 			return -1;
+ 		}
+ 		ldap_bound = 1;
+-		//cerr << "ldap_simple_bind_s: ldap is now bound" << endl;
++		//cerr << "ldap_sasl_bind_s: ldap is now bound" << endl;
+ 	}
+ 	
+ 	return (ldap_bound);
+@@ -185,7 +185,7 @@
+ 
+ void close_LDAP(void) {
+ 	if (ld != NULL && ldap_bound) {
+-		ldap_unbind(ld);
++		ldap_unbind_ext(ld, NULL, NULL);
+ 		ldap_bound = 0;
+ 		ld = NULL;
+ 	}
+@@ -227,10 +227,10 @@
+ 		return NULL;
+ 	}
+ 	
+-	searchRes = ldap_search(ld, sBase.c_str(), LDAP_SCOPE_SUBTREE, filter, attributes, 0);
++	rc = ldap_search_ext(ld, sBase.c_str(), LDAP_SCOPE_SUBTREE, filter, attributes, 0, NULL, NULL, NULL, LDAP_NO_LIMIT, &searchRes);
+ 	free(filter);
+-	if ( searchRes == -1 ) {
+-		//cerr << "find_ldap_expansion: ldap_search returned -1" << endl;
++	if ( rc != LDAP_SUCCESS ) {
++		//cerr << "find_ldap_expansion: ldap_search_ext returned -1" << endl;
+ 		return NULL;
+ 	}
+ 
+@@ -266,13 +266,13 @@
+ 			for (attrib = ldap_first_attribute(ld, entry, &ber);
+ 				attrib != NULL;
+ 				attrib = ldap_next_attribute(ld, entry, ber)) {
+-				char ** values;
++				struct berval ** values;
+ 
+ 				//cerr << "\t\t\tsearching attrib " << noResults << endl;
+ 
+-				values = ldap_get_values(ld, entry, attrib);
++				values = ldap_get_values_len(ld, entry, attrib);
+ 				if ( values != NULL) {
+-					char * last_val = values[ldap_count_values(values) - 1];
++					char * last_val = values[ldap_count_values_len(values) - 1]->bv_val;
+ 
+ 					if (strcmp(attrib, "mail") == 0)
+ 						ma->addr = strdup(last_val);
+@@ -280,7 +280,7 @@
+ 						ma->name = copy_and_quote_name(last_val);
+ 				}
+ 
+-				ldap_value_free(values);
++				ldap_value_free_len(values);
+ 			}
+ 
+ 		  	/*

Reply via email to