Mailinglist Archive: opensuse-commit (2092 mails)
| < Previous | Next > |
commit libetpan11
- From: root@xxxxxxxxxxxxxxx (h_root)
- Date: Fri, 03 Aug 2007 16:52:46 +0200
- Message-id: <20070803145246.AD4E367832C@xxxxxxxxxxxxxxx>
Hello community,
here is the log from the commit of package libetpan11
checked in at Fri Aug 3 16:52:46 CEST 2007.
--------
--- libetpan11/libetpan11.changes 2007-07-25 15:29:54.000000000 +0200
+++ /mounts/work_src_done/STABLE/libetpan11/libetpan11.changes 2007-08-03 11:18:50.000000000 +0200
@@ -1,0 +2,7 @@
+Fri Aug 3 11:18:15 CEST 2007 - anosek@xxxxxxx
+
+- updated to version 0.51
+ * bugfix release
+- dropped obsoleted mailsmtp.patch
+
+-------------------------------------------------------------------
Old:
----
libetpan-0.50.tar.bz2
libetpan11-0.50-mailsmtp.patch
libetpan11-0.50-uninitialized.patch
New:
----
libetpan-0.51.tar.bz2
libetpan11-0.51-uninitialized.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libetpan11.spec ++++++
--- /var/tmp/diff_new_pack.J25088/_old 2007-08-03 16:52:05.000000000 +0200
+++ /var/tmp/diff_new_pack.J25088/_new 2007-08-03 16:52:05.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package libetpan11 (Version 0.50)
+# spec file for package libetpan11 (Version 0.51)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,7 +12,7 @@
Name: libetpan11
%define _prefix /usr
-Version: 0.50
+Version: 0.51
Release: 1
Summary: mail handling library
License: BSD 3-Clause
@@ -21,7 +21,6 @@
URL: http://libetpan.sourceforge.net/
Source0: http://prdownloads.sourceforge.net/libetpan/libetpan-%{version}.tar.bz2
Patch: %{name}-%{version}-uninitialized.patch
-Patch2: %{name}-%{version}-mailsmtp.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: openssl-devel
BuildRequires: cyrus-sasl-devel
@@ -66,7 +65,6 @@
%prep
%setup -n libetpan-%{version}
%patch
-%patch2
%{?suse_update_libdir:%{suse_update_libdir}}
%{?suse_update_config:%{suse_update_config -f}}
@@ -100,6 +98,10 @@
%{_libdir}/libetpan.so
%changelog
+* Fri Aug 03 2007 - anosek@xxxxxxx
+- updated to version 0.51
+ * bugfix release
+- dropped obsoleted mailsmtp.patch
* Wed Jul 25 2007 - anosek@xxxxxxx
- updated to version 0.50
* feature enhancements:
++++++ libetpan-0.50.tar.bz2 -> libetpan-0.51.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libetpan-0.50/build-windows/libetpan_version.h new/libetpan-0.51/build-windows/libetpan_version.h
--- old/libetpan-0.50/build-windows/libetpan_version.h 2007-07-25 11:44:11.000000000 +0200
+++ new/libetpan-0.51/build-windows/libetpan_version.h 2007-08-03 10:47:20.000000000 +0200
@@ -38,7 +38,7 @@
#endif
#ifndef LIBETPAN_VERSION_MINOR
-#define LIBETPAN_VERSION_MINOR 49
+#define LIBETPAN_VERSION_MINOR 51
#endif
#ifndef LIBETPAN_REENTRANT
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libetpan-0.50/ChangeLog new/libetpan-0.51/ChangeLog
--- old/libetpan-0.50/ChangeLog 2007-07-25 11:38:59.000000000 +0200
+++ new/libetpan-0.51/ChangeLog 2007-08-03 10:41:30.000000000 +0200
@@ -1,3 +1,51 @@
+2007-08-03 - libetpan-0.51 - alfie
+
+ * release 0.51 - Sex & Religion
+ fixes:
+ SASL enabled build fixed
+ GnuTLS build fixed
+ BIOs handling fix for openSSL
+
+2007-07-30 - libetpan-0.50cvs6 - colin
+
+ * src/data-types/connect.c
+ put back the (ai == NULL) test - it was alright
+ but a break was missing in the for loop
+ * src/data-types/mailstream_ssl.c
+ rename wait_connect to wait_SSL_connect for
+ clarity
+
+2007-07-30 - libetpan-0.50cvs5 - colin
+
+ * src/data-types/connect.c
+ fix non-blocking connection (select()ing for
+ connect is on writability)
+ * src/data-types/mailstream_ssl.c
+ fix handling of non-blocking underlying BIOs for
+ openSSL; fix build with GnuTLS.
+
+2007-07-28 - libetpan-0.50cvs4 - hoa
+
+ * src/data-types/connect.c
+ connection to server has timeout using
+ mailstream_network_delay.
+
+2007-07-27 - libetpan-0.50cvs3 - hoa
+
+ * src/low-level/imap/mailimap_parser.c
+ workaround broken behavior of www.safe-mail.net server.
+
+2007-07-27 - libetpan-0.50cvs2 - hoa
+
+ * src/low-level/smtp/mailsmtp.[ch]
+ cleanup: mapped MAILSMTP_AUTH_LOGIN authentication type
+ on SASL LOGIN mechanism.
+
+2007-07-25 - libetpan-0.50cvs1 - hoa
+
+ * src/low-level/smtp/mailsmtp.c
+ fixed build when SASL is enabled.
+
2007-07-25 - libetpan-0.50 - alfie
* release 0.50 - Used to be alright
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libetpan-0.50/src/data-types/connect.c new/libetpan-0.51/src/data-types/connect.c
--- old/libetpan-0.50/src/data-types/connect.c 2007-07-24 09:55:01.000000000 +0200
+++ new/libetpan-0.51/src/data-types/connect.c 2007-08-02 11:38:11.000000000 +0200
@@ -30,7 +30,7 @@
*/
/*
- * $Id: connect.c,v 1.20 2007/07/15 15:02:35 hoa Exp $
+ * $Id: connect.c,v 1.23 2007/07/30 09:35:26 colinleroy Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -39,9 +39,16 @@
#include "connect.h"
+#include "mailstream.h"
+
#include <sys/types.h>
#include <string.h>
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+#include <fcntl.h>
#ifdef _MSC_VER
# include "win_etpan.h"
@@ -64,6 +71,57 @@
return ntohs(service->s_port);
}
+static int prepare_fd(int fd)
+{
+#ifndef WIN32
+ int fd_flags;
+ int r;
+
+ fd_flags = fcntl(fd, F_GETFL, 0);
+ fd_flags |= O_NDELAY;
+ r = fcntl(fd, F_SETFL, fd_flags);
+ if (r < 0)
+ return -1;
+#endif
+
+ return 0;
+}
+
+static int wait_connect(int s, int r)
+{
+ fd_set fds;
+ struct timeval timeout;
+
+ if (r == 0) {
+ /* connected immediately */
+ return 0;
+ }
+ else if (r == -1) {
+ if (errno == EINPROGRESS) {
+ /* select */
+ }
+ else {
+ return -1;
+ }
+ }
+
+ FD_ZERO(&fds);
+ FD_SET(s, &fds);
+ timeout = mailstream_network_delay;
+ /* TODO: how to cancel this ? */
+ r = select(s + 1, NULL, &fds, NULL, &timeout);
+ if (r <= 0) {
+ return -1;
+ }
+
+ if (!FD_ISSET(s, &fds)) {
+ /* though, it's strange */
+ return -1;
+ }
+
+ return 0;
+}
+
int mail_tcp_connect(const char * server, uint16_t port)
{
return mail_tcp_connect_with_local_address(server, port, NULL, 0);
@@ -116,10 +174,17 @@
sa.sin_family = AF_INET;
sa.sin_port = htons(port);
memcpy(&sa.sin_addr, remotehost->h_addr, remotehost->h_length);
-
+
+ r = prepare_fd(s);
+ if (r == -1) {
+ goto close_socket;
+ }
+
r = connect(s, (struct sockaddr *) &sa, sizeof(struct sockaddr_in));
- if (r == -1)
+ r = wait_connect(s, r);
+ if (r == -1) {
goto close_socket;
+ }
#else /* HAVE_IPV6 */
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@@ -166,18 +231,27 @@
goto close_socket;
}
+ r = prepare_fd(s);
+ if (r == -1) {
+ goto close_socket;
+ }
+
r = connect(s, ai->ai_addr, ai->ai_addrlen);
- if (r == 0)
- break;
+ r = wait_connect(s, r);
+ if (r == -1) {
+ goto close_socket;
+ }
+ /* if we're here, we're good */
+ break;
}
if (res != NULL)
freeaddrinfo(res);
+#endif
if (ai == NULL)
goto err;
-#endif
-
+
return s;
close_socket:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libetpan-0.50/src/data-types/mailstream_ssl.c new/libetpan-0.51/src/data-types/mailstream_ssl.c
--- old/libetpan-0.50/src/data-types/mailstream_ssl.c 2007-07-24 09:55:01.000000000 +0200
+++ new/libetpan-0.51/src/data-types/mailstream_ssl.c 2007-08-02 11:38:11.000000000 +0200
@@ -30,7 +30,7 @@
*/
/*
- * $Id: mailstream_ssl.c,v 1.55 2007/07/21 19:03:19 hoa Exp $
+ * $Id: mailstream_ssl.c,v 1.57 2007/07/30 09:35:26 colinleroy Exp $
*/
/*
@@ -186,6 +186,31 @@
}
#endif
+static int wait_SSL_connect(int s, int read)
+{
+ fd_set fds;
+ struct timeval timeout;
+ int r;
+
+ FD_ZERO(&fds);
+ FD_SET(s, &fds);
+ timeout = mailstream_network_delay;
+ /* TODO: how to cancel this ? */
+ if (read)
+ r = select(s + 1, &fds, NULL, NULL, &timeout);
+ else
+ r = select(s + 1, NULL, &fds, NULL, &timeout);
+ if (r <= 0) {
+ return -1;
+ }
+
+ if (!FD_ISSET(s, &fds)) {
+ /* though, it's strange */
+ return -1;
+ }
+
+ return 0;
+}
#ifdef USE_SSL
static int mailstream_low_ssl_close(mailstream_low * s);
@@ -246,7 +271,25 @@
if (SSL_set_fd(ssl_conn, fd) == 0)
goto free_ssl_conn;
+again:
r = SSL_connect(ssl_conn);
+
+ switch(SSL_get_error(ssl_conn, r)) {
+ case SSL_ERROR_WANT_READ:
+ r = wait_SSL_connect(fd, 1);
+ if (r < 0)
+ goto free_ssl_conn;
+ else
+ goto again;
+ break;
+ case SSL_ERROR_WANT_WRITE:
+ r = wait_SSL_connect(fd, 0);
+ if (r < 0)
+ goto free_ssl_conn;
+ else
+ goto again;
+ break;
+ }
if (r <= 0)
goto free_ssl_conn;
@@ -917,7 +960,9 @@
void * mailstream_ssl_get_openssl_ssl_ctx(struct mailstream_ssl_context * ssl_context)
{
#ifdef USE_SSL
+#ifndef USE_GNUTLS
return ssl_context->openssl_ssl_ctx;
+#endif
#endif /* USE_SSL */
return 0;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libetpan-0.50/src/low-level/imap/mailimap_parser.c new/libetpan-0.51/src/low-level/imap/mailimap_parser.c
--- old/libetpan-0.50/src/low-level/imap/mailimap_parser.c 2006-12-12 20:44:29.000000000 +0100
+++ new/libetpan-0.51/src/low-level/imap/mailimap_parser.c 2007-08-02 11:38:13.000000000 +0200
@@ -30,7 +30,7 @@
*/
/*
- * $Id: mailimap_parser.c,v 1.35 2006/12/12 19:44:29 hoa Exp $
+ * $Id: mailimap_parser.c,v 1.36 2007/07/27 19:26:12 hoa Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -4112,7 +4112,10 @@
(mailimap_struct_destructor *)
mailimap_address_free,
progr_rate, progr_fun);
- if (r != MAILIMAP_NO_ERROR) {
+ if (r == MAILIMAP_ERROR_PARSE) {
+ address_list = NULL;
+ }
+ else if (r != MAILIMAP_NO_ERROR) {
res = r;
goto err;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libetpan-0.50/src/low-level/smtp/mailsmtp.c new/libetpan-0.51/src/low-level/smtp/mailsmtp.c
--- old/libetpan-0.50/src/low-level/smtp/mailsmtp.c 2007-07-24 09:55:19.000000000 +0200
+++ new/libetpan-0.51/src/low-level/smtp/mailsmtp.c 2007-08-02 11:38:13.000000000 +0200
@@ -32,7 +32,7 @@
*/
/*
- * $Id: mailsmtp.c,v 1.29 2007/07/21 18:44:40 hoa Exp $
+ * $Id: mailsmtp.c,v 1.31 2007/07/26 23:14:02 hoa Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -636,6 +636,7 @@
}
}
+#if 0
static int mailsmtp_auth_login(mailsmtp * session,
const char * user, const char * pass)
{
@@ -684,175 +685,11 @@
return err;
}
-
-#if 0
-static int mailsmtp_auth_plain(mailsmtp * session,
- const char * user, const char * pass)
-{
- int err, len;
- char command[SMTP_STRING_SIZE];
- char * plain, * plain64;
-
- len = strlen(user) + strlen(pass) + 3;
- plain = (char *) malloc(len);
- if (plain == NULL) {
- err = MAILSMTP_ERROR_MEMORY;
- goto err;
- }
-
- snprintf(plain, len, "%c%s%c%s", '\0', user, '\0', pass);
- plain64 = encode_base64(plain, len - 1);
-
- snprintf(command, SMTP_STRING_SIZE, "%s\r\n", plain64);
- err = send_command(session, command);
- if (err == -1) {
- err = MAILSMTP_ERROR_STREAM;
- goto err_free;
- }
-
- err = read_response(session);
- err = auth_map_errors(err);
-
-err_free:
- free(plain64);
- free(plain);
-
- err:
- return err;
-}
-
-static char * convert_hex(unsigned char *in, int len)
-{
- static char hex[] = "0123456789abcdef";
- char * out;
- int i;
-
- out = (char *) malloc(len * 2 + 1);
- if (out == NULL)
- return NULL;
-
- for (i = 0; i < len; i++) {
- out[i * 2] = hex[in[i] >> 4];
- out[i * 2 + 1] = hex[in[i] & 15];
- }
-
- out[i*2] = 0;
-
- return out;
-}
-
-static char * hash_md5(const char * sec_key, const char * data, int len)
-{
- char key[65], digest[24];
- char * hash_hex;
-
- int sec_len, i;
-
- sec_len = strlen(sec_key);
-
- if (sec_len < 64) {
- memcpy(key, sec_key, sec_len);
- for (i = sec_len; i < 64; i++) {
- key[i] = 0;
- }
- } else {
- memcpy(key, sec_key, 64);
- }
-
- hmac_md5(data, len, key, 64, digest);
- hash_hex = convert_hex((unsigned char *) digest, 16);
-
- return hash_hex;
-}
-
-static int mailsmtp_auth_cram_md5(mailsmtp * session,
- const char * user, const char * pass)
-{
- int err;
- char command[SMTP_STRING_SIZE];
- char *response, *auth_hex, *auth;
-
- response = decode_base64(session->response, strlen(session->response));
- if (response == NULL) return MAILSMTP_ERROR_MEMORY;
-
- auth_hex = hash_md5(pass, response, strlen(response));
- if (auth_hex == NULL) {
- err = MAILSMTP_ERROR_MEMORY;
- goto err_free_response;
- }
-
- snprintf(command, SMTP_STRING_SIZE, "%s %s", user, auth_hex);
-
- auth = encode_base64(command, strlen(command));
- if (auth == NULL) {
- err = MAILSMTP_ERROR_MEMORY;
- goto err_free_auth_hex;
- }
-
- snprintf(command, SMTP_STRING_SIZE, "%s\r\n", auth);
- err = send_command(session, command);
- if (err == -1) {
- err = MAILSMTP_ERROR_STREAM;
- goto err_free;
- }
-
- err = read_response(session);
- err = auth_map_errors(err);
-
-err_free:
- free(auth);
-err_free_auth_hex:
- free(auth_hex);
-err_free_response:
- free(response);
- return err;
-}
#endif
int mailsmtp_auth_type(mailsmtp * session,
const char * user, const char * pass, int type)
{
-#if 0 /* deprecated */
- int err;
- char command[SMTP_STRING_SIZE];
-
- if (session->auth == MAILSMTP_AUTH_NOT_CHECKED)
- return MAILSMTP_ERROR_BAD_SEQUENCE_OF_COMMAND;
-
- if ( !(session->auth & type) ) return MAILSMTP_ERROR_AUTH_NOT_SUPPORTED;
-
- switch (type) {
- case MAILSMTP_AUTH_LOGIN:
- snprintf(command, SMTP_STRING_SIZE, "AUTH LOGIN\r\n");
- break;
- case MAILSMTP_AUTH_PLAIN:
- snprintf(command, SMTP_STRING_SIZE, "AUTH PLAIN\r\n");
- break;
- case MAILSMTP_AUTH_CRAM_MD5:
- snprintf(command, SMTP_STRING_SIZE, "AUTH CRAM-MD5\r\n");
- break;
- default:
- return MAILSMTP_ERROR_NOT_IMPLEMENTED;
- }
-
- err = send_command(session, command);
- if (err == -1) return MAILSMTP_ERROR_STREAM;
-
- err = read_response(session);
- err = auth_map_errors(err);
- if (err != MAILSMTP_NO_ERROR) return err;
-
- switch (type) {
- case MAILSMTP_AUTH_LOGIN:
- return mailsmtp_auth_login(session, user, pass);
- case MAILSMTP_AUTH_PLAIN:
- return mailsmtp_auth_plain(session, user, pass);
- case MAILSMTP_AUTH_CRAM_MD5:
- return mailsmtp_auth_cram_md5(session, user, pass);
- default:
- return MAILSMTP_ERROR_NOT_IMPLEMENTED;
- }
-#endif
int err;
char command[SMTP_STRING_SIZE];
char hostname[SMTP_STRING_SIZE];
@@ -869,6 +706,7 @@
switch (type) {
case MAILSMTP_AUTH_LOGIN:
+#if 0
{
snprintf(command, SMTP_STRING_SIZE, "AUTH LOGIN\r\n");
err = send_command(session, command);
@@ -880,6 +718,10 @@
return mailsmtp_auth_login(session, user, pass);
}
+#endif
+ return mailesmtp_auth_sasl(session, "LOGIN",
+ hostname, NULL, NULL, user, user, pass, NULL);
+
case MAILSMTP_AUTH_PLAIN:
return mailesmtp_auth_sasl(session, "PLAIN",
hostname, NULL, NULL, user, user, pass, NULL);
@@ -1257,11 +1099,11 @@
unsigned int max_decoded;
char * p;
- p = strchr(f->pop3_response, '\r');
+ p = strchr(session->response, '\r');
if (p != NULL) {
* p = '\0';
}
- p = strchr(f->pop3_response, '\n');
+ p = strchr(session->response, '\n');
if (p != NULL) {
* p = '\0';
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libetpan-0.50/src/low-level/smtp/mailsmtp.h new/libetpan-0.51/src/low-level/smtp/mailsmtp.h
--- old/libetpan-0.50/src/low-level/smtp/mailsmtp.h 2005-12-20 18:56:11.000000000 +0100
+++ new/libetpan-0.51/src/low-level/smtp/mailsmtp.h 2007-08-02 11:38:13.000000000 +0200
@@ -30,7 +30,7 @@
*/
/*
- * $Id: mailsmtp.h,v 1.20 2005/12/20 17:56:11 hoa Exp $
+ * $Id: mailsmtp.h,v 1.21 2007/07/26 23:14:02 hoa Exp $
*/
#ifndef MAILSMTP_H
@@ -116,6 +116,7 @@
LIBETPAN_EXPORT
const char * mailsmtp_strerror(int errnum);
+/* sasl authentication */
LIBETPAN_EXPORT
int mailesmtp_auth_sasl(mailsmtp * session, const char * auth_type,
const char * server_fqdn,
++++++ libetpan11-0.50-uninitialized.patch -> libetpan11-0.51-uninitialized.patch ++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx
| < Previous | Next > |