pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/mail/imap-uw
Module Name: pkgsrc
Committed By: vins
Date: Tue Apr 28 19:35:40 UTC 2026
Modified Files:
pkgsrc/mail/imap-uw: Makefile distinfo
Added Files:
pkgsrc/mail/imap-uw/patches: patch-src_c-client_rfc822.c
patch-src_osdep_unix_flocklnx.c patch-src_osdep_unix_tcp__unix.c
Log Message:
mail/imap-uw: add a couple of fixes
To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 pkgsrc/mail/imap-uw/Makefile
cvs rdiff -u -r1.55 -r1.56 pkgsrc/mail/imap-uw/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/mail/imap-uw/patches/patch-src_c-client_rfc822.c \
pkgsrc/mail/imap-uw/patches/patch-src_osdep_unix_flocklnx.c \
pkgsrc/mail/imap-uw/patches/patch-src_osdep_unix_tcp__unix.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/mail/imap-uw/Makefile
diff -u pkgsrc/mail/imap-uw/Makefile:1.159 pkgsrc/mail/imap-uw/Makefile:1.160
--- pkgsrc/mail/imap-uw/Makefile:1.159 Tue Feb 10 02:14:16 2026
+++ pkgsrc/mail/imap-uw/Makefile Tue Apr 28 19:35:39 2026
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.159 2026/02/10 02:14:16 gutteridge Exp $
+# $NetBSD: Makefile,v 1.160 2026/04/28 19:35:39 vins Exp $
#
# ATTENTION:
# The Kerberos support in this software is known to be problematic. If you
@@ -11,7 +11,7 @@
DISTNAME= imap-2007f
PKGNAME= ${DISTNAME:S/-/-uw-/}
-PKGREVISION= 16
+PKGREVISION= 17
CATEGORIES= mail
#MASTER_SITES= ftp://ftp.cac.washington.edu/imap/
EXTRACT_SUFX= .tar.Z
Index: pkgsrc/mail/imap-uw/distinfo
diff -u pkgsrc/mail/imap-uw/distinfo:1.55 pkgsrc/mail/imap-uw/distinfo:1.56
--- pkgsrc/mail/imap-uw/distinfo:1.55 Tue Nov 11 20:40:56 2025
+++ pkgsrc/mail/imap-uw/distinfo Tue Apr 28 19:35:39 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.55 2025/11/11 20:40:56 vins Exp $
+$NetBSD: distinfo,v 1.56 2026/04/28 19:35:39 vins Exp $
BLAKE2s (imap-2007f.tar.Z) = 6e67d03b84ec0fed4db99c81aea92160304c1f0c7c9ece7d5e9c4375f1490621
SHA512 (imap-2007f.tar.Z) = 2c728deaf66d23158c61ae55ff94f05d2a1cf0168002760321ca30c6ee1c58c0a4c7bc14ece0097ea662df6c7c49be3b91c8e5e943724c9e2736800fa9298dae
@@ -40,6 +40,9 @@ SHA1 (patch-src_c-client_mail.c) = fca90
SHA1 (patch-src_c-client_misc.c) = d22ca95fb333b5234c66440faf5d6e30a148bad1
SHA1 (patch-src_c-client_misc.h) = 5cf51d186b04ebb45c79b8042bbdcb01716dd2ce
SHA1 (patch-src_c-client_nntp.c) = 0cca24036e699a4cd8c349056c9e0cfbd4910a9d
+SHA1 (patch-src_c-client_rfc822.c) = bf28235f80c3b0e6abdced10b822451f3a1ca056
SHA1 (patch-src_mlock_Makefile) = 6bf652f597ad21dffa44e01d6cb89525eeaf7fc9
SHA1 (patch-src_mlock_mlock.c) = 5cdc25f4295479fb772959cb84e51c0a9fa97c01
+SHA1 (patch-src_osdep_unix_flocklnx.c) = 5e1e3fd7de5c92350399f8af2921ab0271e6097c
SHA1 (patch-src_osdep_unix_ssl__unix.c) = e4fadc1212d06a04824e7f9b2c70592254a3329e
+SHA1 (patch-src_osdep_unix_tcp__unix.c) = 3c6916e189f4997fd42e9ff8c47ad414a3433b07
Added files:
Index: pkgsrc/mail/imap-uw/patches/patch-src_c-client_rfc822.c
diff -u /dev/null pkgsrc/mail/imap-uw/patches/patch-src_c-client_rfc822.c:1.1
--- /dev/null Tue Apr 28 19:35:40 2026
+++ pkgsrc/mail/imap-uw/patches/patch-src_c-client_rfc822.c Tue Apr 28 19:35:39 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_c-client_rfc822.c,v 1.1 2026/04/28 19:35:39 vins Exp $
+
+Make sure we don't get an overflow for messages on \015.
+
+--- src/c-client/rfc822.c.orig 2011-07-23 00:20:18.000000000 +0000
++++ src/c-client/rfc822.c
+@@ -384,6 +384,8 @@ void rfc822_parse_content (BODY *body,ST
+ if (CHR (bs) == '\012'){/* following LF? */
+ c = SNX (bs); i--; /* yes, slurp it */
+ }
++ if (!i)
++ break;
+ case '\012': /* at start of a line, start with -- ? */
+ if (!(i && i-- && ((c = SNX (bs)) == '-') && i-- &&
+ ((c = SNX (bs)) == '-'))) break;
Index: pkgsrc/mail/imap-uw/patches/patch-src_osdep_unix_flocklnx.c
diff -u /dev/null pkgsrc/mail/imap-uw/patches/patch-src_osdep_unix_flocklnx.c:1.1
--- /dev/null Tue Apr 28 19:35:40 2026
+++ pkgsrc/mail/imap-uw/patches/patch-src_osdep_unix_flocklnx.c Tue Apr 28 19:35:39 2026
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_osdep_unix_flocklnx.c,v 1.1 2026/04/28 19:35:39 vins Exp $
+
+Prevent unsafe usage of syslog.
+
+--- src/osdep/unix/flocklnx.c.orig 2026-04-28 18:47:34.739732606 +0000
++++ src/osdep/unix/flocklnx.c
+@@ -57,7 +57,7 @@ int safe_flock (int fd,int op)
+ case ENOLCK: /* lock table is full */
+ sprintf (tmp,"File locking failure: %s",strerror (errno));
+ mm_log (tmp,WARN); /* give the user a warning of what happened */
+- if (!logged++) syslog (LOG_ERR,tmp);
++ if (!logged++) syslog (LOG_ERR,"%s", tmp);
+ /* return failure if non-blocking lock */
+ if (op & LOCK_NB) return -1;
+ sleep (5); /* slow down in case it loops */
Index: pkgsrc/mail/imap-uw/patches/patch-src_osdep_unix_tcp__unix.c
diff -u /dev/null pkgsrc/mail/imap-uw/patches/patch-src_osdep_unix_tcp__unix.c:1.1
--- /dev/null Tue Apr 28 19:35:40 2026
+++ pkgsrc/mail/imap-uw/patches/patch-src_osdep_unix_tcp__unix.c Tue Apr 28 19:35:39 2026
@@ -0,0 +1,173 @@
+$NetBSD: patch-src_osdep_unix_tcp__unix.c,v 1.1 2026/04/28 19:35:39 vins Exp $
+
+Use poll(2) instead of select(2) to support more than 1024 file
+descriptors. See https://bugs.debian.org/478193.
+
+--- src/osdep/unix/tcp_unix.c.orig 2011-07-23 00:20:11.000000000 +0000
++++ src/osdep/unix/tcp_unix.c
+@@ -26,6 +26,7 @@
+ * Last Edited: 13 January 2008
+ */
+
++#include <poll.h>
+ #include "ip_unix.c"
+
+ #undef write /* don't use redefined write() */
+@@ -235,12 +236,11 @@ TCPSTREAM *tcp_open (char *host,char *se
+ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port,
+ char *tmp,int *ctr,char *hst)
+ {
+- int i,ti,sock,flgs;
++ int i,ti,sock,flgs,tmo;
++ struct pollfd pfd;
+ size_t len;
+ time_t now;
+ struct protoent *pt = getprotobyname ("tcp");
+- fd_set rfds,wfds,efds;
+- struct timeval tmo;
+ struct sockaddr *sadr = ip_sockaddr (family,adr,adrlen,port,&len);
+ blocknotify_t bn = (blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
+ /* fetid Solaris */
+@@ -252,14 +252,6 @@ int tcp_socket_open (int family,void *ad
+ sprintf (tmp,"Unable to create TCP socket: %s",strerror (errno));
+ (*bn) (BLOCK_NONSENSITIVE,data);
+ }
+- else if (sock >= FD_SETSIZE) {/* unselectable sockets are useless */
+- sprintf (tmp,"Unable to create selectable TCP socket (%d >= %d)",
+- sock,FD_SETSIZE);
+- (*bn) (BLOCK_NONSENSITIVE,data);
+- close (sock);
+- sock = -1;
+- errno = EMFILE;
+- }
+
+ else { /* get current socket flags */
+ flgs = fcntl (sock,F_GETFL,0);
+@@ -284,16 +276,11 @@ int tcp_socket_open (int family,void *ad
+ if ((sock >= 0) && ctr) { /* want open timeout? */
+ now = time (0); /* open timeout */
+ ti = ttmo_open ? now + ttmo_open : 0;
+- tmo.tv_usec = 0;
+- FD_ZERO (&rfds); /* initialize selection vector */
+- FD_ZERO (&wfds); /* initialize selection vector */
+- FD_ZERO (&efds); /* handle errors too */
+- FD_SET (sock,&rfds); /* block for error or readable or writable */
+- FD_SET (sock,&wfds);
+- FD_SET (sock,&efds);
++ pfd.fd = sock;
++ pfd.events = POLLIN | POLLOUT;
+ do { /* block under timeout */
+- tmo.tv_sec = ti ? ti - now : 0;
+- i = select (sock+1,&rfds,&wfds,&efds,ti ? &tmo : NIL);
++ tmo = ti ? ti - now : 0;
++ i = poll (&pfd, 1, ti ? tmo * 1000 : -1);
+ now = time (0); /* fake timeout if interrupt & time expired */
+ if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
+ } while ((i < 0) && (errno == EINTR));
+@@ -302,7 +289,7 @@ int tcp_socket_open (int family,void *ad
+ fcntl (sock,F_SETFL,flgs);
+ /* This used to be a zero-byte read(), but that crashes Solaris */
+ /* get socket status */
+- if(FD_ISSET(sock, &rfds)) while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR));
++ if(pfd.revents & POLLIN) while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR));
+ }
+ if (i <= 0) { /* timeout or error? */
+ i = i ? errno : ETIMEDOUT;/* determine error code */
+@@ -545,9 +532,8 @@ long tcp_getbuffer (TCPSTREAM *stream,un
+ stream->ictr -=n;
+ }
+ if (size) {
+- int i;
+- fd_set fds,efds;
+- struct timeval tmo;
++ int i, tmo;
++ struct pollfd pfd;
+ time_t t = time (0);
+ blocknotify_t bn=(blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
+ (*bn) (BLOCK_TCPREAD,NIL);
+@@ -556,16 +542,13 @@ long tcp_getbuffer (TCPSTREAM *stream,un
+ time_t now = tl;
+ time_t ti = ttmo_read ? now + ttmo_read : 0;
+ if (tcpdebug) mm_log ("Reading TCP buffer",TCPDEBUG);
+- tmo.tv_usec = 0;
+- FD_ZERO (&fds); /* initialize selection vector */
+- FD_ZERO (&efds); /* handle errors too */
+- /* set bit in selection vectors */
+- FD_SET (stream->tcpsi,&fds);
+- FD_SET (stream->tcpsi,&efds);
++
++ pfd.events = POLLIN;
++ pfd.fd = stream->tcpsi;
+ errno = NIL; /* initially no error */
+ do { /* block under timeout */
+- tmo.tv_sec = ti ? ti - now : 0;
+- i = select (stream->tcpsi+1,&fds,NIL,&efds,ti ? &tmo : NIL);
++ tmo = ti ? ti - now : 0;
++ i = poll (&pfd, 1, ti ? tmo * 1000 : -1);
+ now = time (0); /* fake timeout if interrupt & time expired */
+ if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
+ } while ((i < 0) && (errno == EINTR));
+@@ -605,9 +588,8 @@ long tcp_getbuffer (TCPSTREAM *stream,un
+
+ long tcp_getdata (TCPSTREAM *stream)
+ {
+- int i;
+- fd_set fds,efds;
+- struct timeval tmo;
++ int i, tmo;
++ struct pollfd pfd;
+ time_t t = time (0);
+ blocknotify_t bn = (blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
+ if (stream->tcpsi < 0) return NIL;
+@@ -617,15 +599,12 @@ long tcp_getdata (TCPSTREAM *stream)
+ time_t now = tl;
+ time_t ti = ttmo_read ? now + ttmo_read : 0;
+ if (tcpdebug) mm_log ("Reading TCP data",TCPDEBUG);
+- tmo.tv_usec = 0;
+- FD_ZERO (&fds); /* initialize selection vector */
+- FD_ZERO (&efds); /* handle errors too */
+- FD_SET (stream->tcpsi,&fds);/* set bit in selection vectors */
+- FD_SET (stream->tcpsi,&efds);
++ pfd.fd = stream->tcpsi;
++ pfd.events = POLLIN;
+ errno = NIL; /* initially no error */
+ do { /* block under timeout */
+- tmo.tv_sec = ti ? ti - now : 0;
+- i = select (stream->tcpsi+1,&fds,NIL,&efds,ti ? &tmo : NIL);
++ tmo = ti ? ti - now : 0;
++ i = poll (&pfd, 1, ti ? tmo * 1000 : -1);
+ now = time (0); /* fake timeout if interrupt & time expired */
+ if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
+ } while ((i < 0) && (errno == EINTR));
+@@ -677,9 +656,8 @@ long tcp_soutr (TCPSTREAM *stream,char *
+
+ long tcp_sout (TCPSTREAM *stream,char *string,unsigned long size)
+ {
+- int i;
+- fd_set fds,efds;
+- struct timeval tmo;
++ int i, tmo;
++ struct pollfd pfd;
+ time_t t = time (0);
+ blocknotify_t bn = (blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
+ if (stream->tcpso < 0) return NIL;
+@@ -689,15 +667,12 @@ long tcp_sout (TCPSTREAM *stream,char *s
+ time_t now = tl;
+ time_t ti = ttmo_write ? now + ttmo_write : 0;
+ if (tcpdebug) mm_log ("Writing to TCP",TCPDEBUG);
+- tmo.tv_usec = 0;
+- FD_ZERO (&fds); /* initialize selection vector */
+- FD_ZERO (&efds); /* handle errors too */
+- FD_SET (stream->tcpso,&fds);/* set bit in selection vector */
+- FD_SET(stream->tcpso,&efds);/* set bit in error selection vector */
++ pfd.fd = stream->tcpso;
++ pfd.events = POLLOUT;
+ errno = NIL; /* block and write */
+ do { /* block under timeout */
+- tmo.tv_sec = ti ? ti - now : 0;
+- i = select (stream->tcpso+1,NIL,&fds,&efds,ti ? &tmo : NIL);
++ tmo = ti ? ti - now : 0;
++ i = poll (&pfd, 1, ti ? tmo * 1000 : -1);
+ now = time (0); /* fake timeout if interrupt & time expired */
+ if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
+ } while ((i < 0) && (errno == EINTR));
Home |
Main Index |
Thread Index |
Old Index