[cyrus-sasl] repair rimap support (more packets in response)

Jan F. Chadima jfch2222 at fedoraproject.org
Wed Jun 1 04:24:00 UTC 2011


commit 58fe06df1f319d889e66dab7a346f61f52959cde
Author: Jan F <jfch at zwingli.jagda.eu>
Date:   Wed Jun 1 06:23:37 2011 +0200

    repair rimap support (more packets in response)

 cyrus-sasl-2.1.23-rimap2.patch |   70 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 70 insertions(+), 0 deletions(-)
---
diff --git a/cyrus-sasl-2.1.23-rimap2.patch b/cyrus-sasl-2.1.23-rimap2.patch
new file mode 100644
index 0000000..1a28a30
--- /dev/null
+++ b/cyrus-sasl-2.1.23-rimap2.patch
@@ -0,0 +1,70 @@
+diff -up cyrus-sasl-2.1.23/saslauthd/auth_rimap.c.rimap2 cyrus-sasl-2.1.23/saslauthd/auth_rimap.c
+--- cyrus-sasl-2.1.23/saslauthd/auth_rimap.c.rimap2	2011-06-01 05:54:13.339252378 +0200
++++ cyrus-sasl-2.1.23/saslauthd/auth_rimap.c	2011-06-01 05:54:39.626252337 +0200
+@@ -1,3 +1,4 @@
++
+ /* MODULE: auth_rimap */
+ 
+ /* COPYRIGHT
+@@ -368,6 +369,30 @@ auth_rimap (
+     alarm(NETWORK_IO_TIMEOUT);
+     rc = read(s, rbuf, sizeof(rbuf));
+     alarm(0);
++    if ( rc>0 ) {
++        /* check if there is more to read */
++        fd_set         perm;
++        int            fds, ret;
++        struct timeval timeout;
++
++        FD_ZERO(&perm);
++        FD_SET(s, &perm);
++        fds = s +1;
++
++        timeout.tv_sec  = 1;
++        timeout.tv_usec = 0;
++        while( select (fds, &perm, NULL, NULL, &timeout ) >0 ) {
++           if ( FD_ISSET(s, &perm) ) {
++              ret = read(s, rbuf+rc, sizeof(rbuf)-rc);
++              if ( ret<0 ) {
++                 rc = ret;
++                 break;
++              } else {
++                 rc += ret;
++              }
++           }
++        }
++    }
+     if (rc == -1) {
+ 	syslog(LOG_WARNING, "auth_rimap: read (banner): %m");
+ 	(void) close(s);
+@@ -457,6 +482,30 @@ auth_rimap (
+     alarm(NETWORK_IO_TIMEOUT);
+     rc = read(s, rbuf, sizeof(rbuf));
+     alarm(0);
++    if ( rc>0 ) {
++        /* check if there is more to read */
++        fd_set         perm;
++        int            fds, ret;
++        struct timeval timeout;
++
++        FD_ZERO(&perm);
++        FD_SET(s, &perm);
++        fds = s +1;
++
++        timeout.tv_sec  = 1;
++        timeout.tv_usec = 0;
++        while( select (fds, &perm, NULL, NULL, &timeout ) >0 ) {
++           if ( FD_ISSET(s, &perm) ) {
++              ret = read(s, rbuf+rc, sizeof(rbuf)-rc);
++              if ( ret<0 ) {
++                 rc = ret;
++                 break;
++              } else {
++                 rc += ret;
++              }
++           }
++        }
++    }
+     (void) close(s);			/* we're done with the remote */
+     if (rc == -1) {
+ 	syslog(LOG_WARNING, "auth_rimap: read (response): %m");


More information about the scm-commits mailing list