packages: cyrus-sasl/cyrus-sasl.spec, cyrus-sasl/0030-dont_use_la_files_for...

baggins baggins at pld-linux.org
Fri Oct 21 14:46:48 CEST 2011


Author: baggins                      Date: Fri Oct 21 12:46:48 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- added passdss and ldapdb plugins
- don't waste time trying to open plugins via .la files (from debian)

---- Files affected:
packages/cyrus-sasl:
   cyrus-sasl.spec (1.214 -> 1.215) , 0030-dont_use_la_files_for_opening_plugins.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/cyrus-sasl/cyrus-sasl.spec
diff -u packages/cyrus-sasl/cyrus-sasl.spec:1.214 packages/cyrus-sasl/cyrus-sasl.spec:1.215
--- packages/cyrus-sasl/cyrus-sasl.spec:1.214	Fri Oct 21 14:13:08 2011
+++ packages/cyrus-sasl/cyrus-sasl.spec	Fri Oct 21 14:46:43 2011
@@ -1,6 +1,4 @@
 # $Revision$, $Date$
-# TODO:
-# - add ldap plugin from openldap sources
 #
 # Conditional build:
 %bcond_without	cryptedpw	# if you keep crypted passwords in your *sql
@@ -26,7 +24,7 @@
 Summary(uk.UTF-8):	Бібліотека Cyrus SASL
 Name:		cyrus-sasl
 Version:	2.1.25
-Release:	4.9
+Release:	4.99
 License:	distributable
 Group:		Libraries
 Source0:	ftp://ftp.cyrusimap.org/cyrus-sasl/%{name}-%{version}.tar.gz
@@ -58,6 +56,7 @@
 Patch19:	0034-fix_dovecot_authentication.patch
 Patch20:	%{name}-auxprop.patch
 Patch21:	%{name}-get_fqhostname.patch
+Patch22:	0030-dont_use_la_files_for_opening_plugins.patch
 URL:		http://asg.web.cmu.edu/sasl/
 BuildRequires:	autoconf >= 2.54
 BuildRequires:	automake >= 1:1.7
@@ -362,6 +361,34 @@
 %description sasldb -l pl.UTF-8
 Wtyczka sasldb do Cyrus SASL.
 
+%package ldapdb
+Summary:	Cyrus SASL LDAPDB plugin
+Summary(pl.UTF-8):	Wtyczka LDAPDB do Cyrus SASL
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description ldapdb
+Cyrus SASL ldapdb plugin.
+
+%description ldapdb -l pl.UTF-8
+Wtyczka ldapdb do Cyrus SASL.
+
+%package passdss
+Summary:	PASSDSS Cyrus SASL plugin
+Summary(pl.UTF-8):	Wtyczka PASSDSS do Cyrus SASL
+Summary(pt_BR.UTF-8):	Mecanismo SASL PASSDSS
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description passdss
+This plugin implements the PASSDSS 3DES mechanism.
+
+%description passdss -l pl.UTF-8
+Wtyczka dodająca obsługę mechanizmu PASSDSS 3DES do Cyrus SASL.
+
+%description passdss -l pt_BR.UTF-8
+Este plugin implementa o mecanismo SASL PASSDSS 3DES.
+
 %package scram
 Summary:	SCRAM Cyrus SASL plugin
 Summary(pl.UTF-8):	Wtyczka SCRAM do Cyrus SASL
@@ -493,6 +520,7 @@
 %patch19 -p1
 %patch20 -p1
 %patch21 -p1
+%patch22 -p1
 
 cd doc
 echo "cyrus-sasl complies with the following RFCs:" > rfc-compliance
@@ -532,6 +560,7 @@
 	--enable-sample \
 	--enable-httpform \
 	--enable-sql \
+	--enable-passdss \
 	%{?with_srp: --enable-srp} \
 	--enable-static \
 	--with-plugindir=%{_libdir}/sasl2 \
@@ -704,6 +733,16 @@
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/sasl2/libsasldb.so*
 
+%if %{with ldap}
+%files ldapdb
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/sasl2/libldapdb.so*
+%endif
+
+%files passdss
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/sasl2/libpassdss.so*
+
 %files scram
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/sasl2/libscram.so*
@@ -760,6 +799,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.215  2011/10/21 12:46:43  baggins
+- added passdss and ldapdb plugins
+- don't waste time trying to open plugins via .la files (from debian)
+
 Revision 1.214  2011/10/21 12:13:08  baggins
 - fix completely broken logic in get_fqhostname
 

================================================================
Index: packages/cyrus-sasl/0030-dont_use_la_files_for_opening_plugins.patch
diff -u /dev/null packages/cyrus-sasl/0030-dont_use_la_files_for_opening_plugins.patch:1.1
--- /dev/null	Fri Oct 21 14:46:48 2011
+++ packages/cyrus-sasl/0030-dont_use_la_files_for_opening_plugins.patch	Fri Oct 21 14:46:43 2011
@@ -0,0 +1,134 @@
+--- a/lib/dlopen.c
++++ b/lib/dlopen.c
+@@ -247,105 +247,6 @@ static int _sasl_plugin_load(char *plugi
+     return result;
+ }
+ 
+-/* this returns the file to actually open.
+- *  out should be a buffer of size PATH_MAX
+- *  and may be the same as in. */
+-
+-/* We'll use a static buffer for speed unless someone complains */
+-#define MAX_LINE 2048
+-
+-static int _parse_la(const char *prefix, const char *in, char *out) 
+-{
+-    FILE *file;
+-    size_t length;
+-    char line[MAX_LINE];
+-    char *ntmp = NULL;
+-
+-    if(!in || !out || !prefix || out == in) return SASL_BADPARAM;
+-
+-    /* Set this so we can detect failure */
+-    *out = '\0';
+-
+-    length = strlen(in);
+-
+-    if (strcmp(in + (length - strlen(LA_SUFFIX)), LA_SUFFIX)) {
+-	if(!strcmp(in + (length - strlen(SO_SUFFIX)),SO_SUFFIX)) {
+-	    /* check for a .la file */
+-	    strcpy(line, prefix);
+-	    strcat(line, in);
+-	    length = strlen(line);
+-	    *(line + (length - strlen(SO_SUFFIX))) = '\0';
+-	    strcat(line, LA_SUFFIX);
+-	    file = fopen(line, "r");
+-	    if(file) {
+-		/* We'll get it on the .la open */
+-		fclose(file);
+-		return SASL_FAIL;
+-	    }
+-	}
+-	strcpy(out, prefix);
+-	strcat(out, in);
+-	return SASL_OK;
+-    }
+-
+-    strcpy(line, prefix);
+-    strcat(line, in);
+-
+-    file = fopen(line, "r");
+-    if(!file) {
+-	_sasl_log(NULL, SASL_LOG_WARN,
+-		  "unable to open LA file: %s", line);
+-	return SASL_FAIL;
+-    }
+-    
+-    while(!feof(file)) {
+-	if(!fgets(line, MAX_LINE, file)) break;
+-	if(line[strlen(line) - 1] != '\n') {
+-	    _sasl_log(NULL, SASL_LOG_WARN,
+-		      "LA file has too long of a line: %s", in);
+-	    return SASL_BUFOVER;
+-	}
+-	if(line[0] == '\n' || line[0] == '#') continue;
+-	if(!strncmp(line, "dlname=", sizeof("dlname=") - 1)) {
+-	    /* We found the line with the name in it */
+-	    char *end;
+-	    char *start;
+-	    size_t len;
+-	    end = strrchr(line, '\'');
+-	    if(!end) continue;
+-	    start = &line[sizeof("dlname=")-1];
+-	    len = strlen(start);
+-	    if(len > 3 && start[0] == '\'') {
+-		ntmp=&start[1];
+-		*end='\0';
+-		/* Do we have dlname="" ? */
+-		if(ntmp == end) {
+-		    _sasl_log(NULL, SASL_LOG_DEBUG,
+-			      "dlname is empty in .la file: %s", in);
+-		    return SASL_FAIL;
+-		}
+-		strcpy(out, prefix);
+-		strcat(out, ntmp);
+-	    }
+-	    break;
+-	}
+-    }
+-    if(ferror(file) || feof(file)) {
+-	_sasl_log(NULL, SASL_LOG_WARN,
+-		  "Error reading .la: %s\n", in);
+-	fclose(file);
+-	return SASL_FAIL;
+-    }
+-    fclose(file);
+-
+-    if(!(*out)) {
+-	_sasl_log(NULL, SASL_LOG_WARN,
+-		  "Could not find a dlname line in .la file: %s", in);
+-	return SASL_FAIL;
+-    }
+-
+-    return SASL_OK;
+-}
+ #endif /* DO_DLOPEN */
+ 
+ /* loads a plugin library */
+@@ -499,18 +400,18 @@ int _sasl_load_plugins(const add_plugin_
+ 		if (length + pos>=PATH_MAX) continue; /* too big */
+ 
+ 		if (strcmp(dir->d_name + (length - strlen(SO_SUFFIX)),
+-			   SO_SUFFIX)
+-		    && strcmp(dir->d_name + (length - strlen(LA_SUFFIX)),
+-			   LA_SUFFIX))
++			   SO_SUFFIX))
+ 		    continue;
+ 
++		/* We only use .so files for loading plugins */
++
+ 		memcpy(name,dir->d_name,length);
+ 		name[length]='\0';
+ 
+-		result = _parse_la(prefix, name, tmp);
+-		if(result != SASL_OK)
+-		    continue;
+-		
++		/* Create full name with path */
++		strncpy(tmp, prefix, PATH_MAX);
++		strncat(tmp, name, PATH_MAX);
++
+ 		/* skip "lib" and cut off suffix --
+ 		   this only need be approximate */
+ 		strcpy(plugname, name + 3);
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/cyrus-sasl/cyrus-sasl.spec?r1=1.214&r2=1.215&f=u



More information about the pld-cvs-commit mailing list