- fix build with gcc-4.4

This commit is contained in:
Tomáš Mráz 2009-02-06 16:13:44 +00:00
parent 6230a7151e
commit 1814ca1f1c
5 changed files with 27 additions and 98 deletions

Binary file not shown.

View File

@ -1,97 +0,0 @@
"Speak" the saslauthd version 1 protocol if "saslauthd_version" is "1". I
don't think we'll be using this (the other way around was far more useful),
but here for the sake of completeness.
--- cyrus-sasl-2.1.17/lib/checkpw.c 2003-09-09 11:38:13.000000000 -0400
+++ cyrus-sasl-2.1.17/lib/checkpw.c 2004-01-20 16:57:52.000000000 -0500
@@ -454,7 +454,7 @@
sasl_getopt_t *getopt;
void *context;
char pwpath[sizeof(srvaddr.sun_path)];
- const char *p = NULL;
+ const char *p = NULL, *q = NULL;
char *freeme = NULL;
#ifdef USE_DOORS
door_arg_t arg;
@@ -463,6 +463,7 @@
/* check to see if the user configured a rundir */
if (_sasl_getcallback(conn, SASL_CB_GETOPT, &getopt, &context) == SASL_OK) {
getopt(context, NULL, "saslauthd_path", &p, NULL);
+ getopt(context, NULL, "saslauthd_version", &q, NULL);
}
if (p) {
strncpy(pwpath, p, sizeof(pwpath));
@@ -514,18 +515,22 @@
memcpy(query_end, &u_len, sizeof(unsigned short));
query_end += sizeof(unsigned short);
while (*userid) *query_end++ = *userid++;
+ userid -= ntohs(u_len);
memcpy(query_end, &p_len, sizeof(unsigned short));
query_end += sizeof(unsigned short);
while (*passwd) *query_end++ = *passwd++;
+ passwd -= ntohs(p_len);
memcpy(query_end, &s_len, sizeof(unsigned short));
query_end += sizeof(unsigned short);
while (*service) *query_end++ = *service++;
+ service -= ntohs(s_len);
memcpy(query_end, &r_len, sizeof(unsigned short));
query_end += sizeof(unsigned short);
if (user_realm) while (*user_realm) *query_end++ = *user_realm++;
+ user_realm -= ntohs(r_len);
}
#ifdef USE_DOORS
@@ -578,6 +583,50 @@
}
}
+ if (q && (*q == '1')) {
+ struct iovec iov[8];
+ unsigned int u_length, p_length;
+ char buffer[1024];
+
+ u_length = strlen(userid ? userid : "") + 1;
+ p_length = strlen(passwd ? passwd : "") + 1;
+ if (u_length + p_length >= sizeof(query)) {
+ close(s);
+ sasl_seterror(conn, 0, "out of memory");
+ goto fail;
+ }
+
+ memset(buffer, '\0', sizeof(buffer));
+ if (userid != NULL)
+ memcpy(buffer, userid, u_length);
+ if (passwd != NULL)
+ memcpy(buffer + u_length, passwd, p_length);
+
+ iov[0].iov_len = u_length + p_length;
+ iov[0].iov_base = buffer;
+
+ if (retry_writev(s, iov, 1) == -1) {
+ close(s);
+ sasl_seterror(conn, 0, "write failed");
+ goto fail;
+ }
+
+ if (retry_read(s, buffer, 2) != 2) {
+ close(s);
+ sasl_seterror(conn, 0, "read failed");
+ goto fail;
+ }
+
+ close(s);
+
+ if (strncmp(buffer, "OK", 2) == 0) {
+ return SASL_OK;
+ }
+
+ sasl_seterror(conn, SASL_NOLOG, "authentication failed");
+ return SASL_BADAUTH;
+ }
+
{
struct iovec iov[8];

Binary file not shown.

View File

@ -0,0 +1,21 @@
diff -up cyrus-sasl-2.1.22/plugins/digestmd5.c.elif cyrus-sasl-2.1.22/plugins/digestmd5.c
--- cyrus-sasl-2.1.22/plugins/digestmd5.c.elif 2009-01-23 09:40:31.000000000 +0100
+++ cyrus-sasl-2.1.22/plugins/digestmd5.c 2009-02-06 15:20:15.000000000 +0100
@@ -2743,7 +2743,7 @@ static sasl_server_plug_t digestmd5_serv
"DIGEST-MD5", /* mech_name */
#ifdef WITH_RC4
128, /* max_ssf */
-#elif WITH_DES
+#elif defined(WITH_DES)
112,
#else
1,
@@ -4071,7 +4071,7 @@ static sasl_client_plug_t digestmd5_clie
"DIGEST-MD5",
#ifdef WITH_RC4 /* mech_name */
128, /* max ssf */
-#elif WITH_DES
+#elif defined(WITH_DES)
112,
#else
1,

View File

@ -4,7 +4,7 @@
Summary: The Cyrus SASL library
Name: cyrus-sasl
Version: 2.1.22
Release: 20%{?dist}
Release: 21%{?dist}
License: BSD
Group: System Environment/Libraries
# Source0 originally comes from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/;
@ -30,6 +30,7 @@ Patch31: cyrus-sasl-2.1.22-kerberos4.patch
Patch32: cyrus-sasl-2.1.22-warnings.patch
Patch33: cyrus-sasl-2.1.22-current-db.patch
Patch34: cyrus-sasl-2.1.22-ldap-timeout.patch
Patch35: cyrus-sasl-2.1.22-bad-elif.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf, automake, libtool, gdbm-devel, groff
@ -149,6 +150,7 @@ chmod -x include/*.h
%patch32 -p1 -b .warnings
%patch33 -p1 -b .current-db
%patch34 -p1 -b .ldap-timeout
%patch35 -p1 -b .elif
# FIXME - we remove these files directly so that we can avoid using the -f
# flag, which has a nasty habit of overwriting files like COPYING.
@ -383,6 +385,9 @@ fi
%{_sbindir}/sasl2-shared-mechlist
%changelog
* Fri Feb 6 2009 Tomas Mraz <tmraz@redhat.com> - 2.1.22-21
- fix build with gcc-4.4
* Fri Jan 23 2009 Tomas Mraz <tmraz@redhat.com> - 2.1.22-20
- set LDAP_OPT_TIMEOUT (#326452)
- provide LSB compatible init script (#246900)