pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/comms/conserver8 Add two patches so that this at least...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8d766ccd64c5
branches:  trunk
changeset: 357291:8d766ccd64c5
user:      he <he%pkgsrc.org@localhost>
date:      Wed Jan 18 09:54:51 2017 +0000

description:
Add two patches so that this at least semi-works when the inet6
option is used:

 * Use correct sockaddr length when doing getnameinfo() for inet6,
   so we avoid an early return with "permanent failure" from getnameinfo()
 * Use temp variables for walking the address lists so that we avoid trying
   freeaddrinfo(NULL) and getting SEGV

This still isn't fully baked and backward compatible: with the
inet6 option turned on, on NetBSD the conserver process only opens
an inet6 server socket and no longer serves an inet socket (a
Linuxism, I suspect), making it troublesome to interoperate with
older versions of conserver or installations on hosts without IPv6
connectivity.

PKGREVISION bumped.

diffstat:

 comms/conserver8/Makefile                          |   6 +-
 comms/conserver8/distinfo                          |   8 +-
 comms/conserver8/patches/patch-aa                  |   4 +-
 comms/conserver8/patches/patch-ab                  |   4 +-
 comms/conserver8/patches/patch-conserver_access.c  |  14 ++++
 comms/conserver8/patches/patch-conserver_consent.c |  72 ++++++++++++++++++++++
 6 files changed, 100 insertions(+), 8 deletions(-)

diffs (155 lines):

diff -r c80050d95769 -r 8d766ccd64c5 comms/conserver8/Makefile
--- a/comms/conserver8/Makefile Wed Jan 18 09:52:22 2017 +0000
+++ b/comms/conserver8/Makefile Wed Jan 18 09:54:51 2017 +0000
@@ -1,14 +1,14 @@
-# $NetBSD: Makefile,v 1.21 2016/06/20 15:25:39 schnoebe Exp $
+# $NetBSD: Makefile,v 1.22 2017/01/18 09:54:51 he Exp $
 #
 
 PKGVER=                8.2.1
-PKGREVISION=   2
+PKGREVISION=   3
 DISTNAME=      conserver-${PKGVER}
 PKGNAME=       conserver8-${PKGVER}
 CATEGORIES=    comms
 MASTER_SITES=  http://www.conserver.com/
 
-MAINTAINER=    pkgsrc-users%netbsd.org@localhost
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      http://www.conserver.com/
 COMMENT=       Application that allows multiple users to watch serial consoles
 #LICENSE=      # modified-bsd and more (see LICENSE file)
diff -r c80050d95769 -r 8d766ccd64c5 comms/conserver8/distinfo
--- a/comms/conserver8/distinfo Wed Jan 18 09:52:22 2017 +0000
+++ b/comms/conserver8/distinfo Wed Jan 18 09:54:51 2017 +0000
@@ -1,9 +1,11 @@
-$NetBSD: distinfo,v 1.10 2016/03/13 18:31:11 schnoebe Exp $
+$NetBSD: distinfo,v 1.11 2017/01/18 09:54:51 he Exp $
 
 SHA1 (conserver-8.2.1.tar.gz) = 357eea46c0189280b0ab66776b01ce3ba02f1847
 RMD160 (conserver-8.2.1.tar.gz) = 39f08facffc9b462c8257fa21c24785eb1e2bb5a
 SHA512 (conserver-8.2.1.tar.gz) = caf519b8295fc142cf1cb5b141854aede07b3613653f417e9c3ebee75b30a12fa785c248806758f60afbc155cc048418635d514a9848e0fa06992f1e4f930fb6
 Size (conserver-8.2.1.tar.gz) = 335241 bytes
-SHA1 (patch-aa) = d0eebea0d126c611f6f60035730a0c2f97280b01
-SHA1 (patch-ab) = 7a507e428277cc6ccf14b961c44d4e6fd3abcde3
+SHA1 (patch-aa) = e7dea78d62c4e879c0741b0c9992811410737178
+SHA1 (patch-ab) = ec5b849cad7662a3e14a834d63840a306e89bdf2
+SHA1 (patch-conserver_access.c) = a7956022bbdbbf2dc97ee474e8815d48d6adfadd
+SHA1 (patch-conserver_consent.c) = aa868cdacfe8a8e294ba8dcf74e2460ddf34ef3a
 SHA1 (patch-conserver_readcfg.c) = c39e1d50829658cb77e4c943e631da4b3cdd31ee
diff -r c80050d95769 -r 8d766ccd64c5 comms/conserver8/patches/patch-aa
--- a/comms/conserver8/patches/patch-aa Wed Jan 18 09:52:22 2017 +0000
+++ b/comms/conserver8/patches/patch-aa Wed Jan 18 09:54:51 2017 +0000
@@ -1,4 +1,6 @@
-$NetBSD: patch-aa,v 1.2 2006/05/11 21:42:43 seb Exp $
+$NetBSD: patch-aa,v 1.3 2017/01/18 09:54:51 he Exp $
+
+Reduce verbosity.
 
 --- conserver/main.c.orig      2006-04-03 09:32:08.000000000 -0400
 +++ conserver/main.c   2006-05-07 22:24:26.000000000 -0400
diff -r c80050d95769 -r 8d766ccd64c5 comms/conserver8/patches/patch-ab
--- a/comms/conserver8/patches/patch-ab Wed Jan 18 09:52:22 2017 +0000
+++ b/comms/conserver8/patches/patch-ab Wed Jan 18 09:54:51 2017 +0000
@@ -1,4 +1,6 @@
-$NetBSD: patch-ab,v 1.1 2005/08/12 14:39:06 he Exp $
+$NetBSD: patch-ab,v 1.2 2017/01/18 09:54:51 he Exp $
+
+Document that escape sequence converts to "telnet break" when using telnet.
 
 --- conserver.cf/conserver.cf.man.orig 2004-11-06 01:20:30.000000000 +0100
 +++ conserver.cf/conserver.cf.man
diff -r c80050d95769 -r 8d766ccd64c5 comms/conserver8/patches/patch-conserver_access.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/conserver8/patches/patch-conserver_access.c Wed Jan 18 09:54:51 2017 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-conserver_access.c,v 1.1 2017/01/18 09:54:51 he Exp $
+
+Make sure to use correct sockaddr length when doing getnameinfo().
+
+--- conserver/access.c.orig    2017-01-18 09:20:03.000000000 +0000
++++ conserver/access.c
+@@ -150,6 +150,7 @@ AccType(INADDR_STYPE *addr, char **peern
+     so = sizeof(*addr);
+ 
+ #if USE_IPV6
++    so = sizeof(struct sockaddr_in6);
+     error =
+       getnameinfo((struct sockaddr *)addr, so, ipaddr, sizeof(ipaddr),
+                   NULL, 0, NI_NUMERICHOST);
diff -r c80050d95769 -r 8d766ccd64c5 comms/conserver8/patches/patch-conserver_consent.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/conserver8/patches/patch-conserver_consent.c        Wed Jan 18 09:54:51 2017 +0000
@@ -0,0 +1,72 @@
+$NetBSD: patch-conserver_consent.c,v 1.1 2017/01/18 09:54:51 he Exp $
+
+Print strerror() on failure.
+Use scratch variables for walking address info list, so that
+we don't end up trying to freeaddrinfo(NULL).
+
+--- conserver/consent.c.orig   2015-06-02 17:17:45.000000000 +0000
++++ conserver/consent.c
+@@ -919,13 +919,16 @@ ConsInit(CONSENT *pCE)
+                                    rp->ai_addrlen)) == 0)
+                           goto success;
+                     fail:
++                      error = errno;
+                       close(cofile);
++                  } else {
++                      error = errno;
+                   }
+                   rp = rp->ai_next;
+               }
+ 
+-              Error("[%s]: Unable to connect to %s:%s", pCE->server,
+-                    host, serv);
++              Error("[%s]: Unable to connect to %s:%s %s", pCE->server,
++                    host, serv, strerror(error));
+               ConsDown(pCE, FLAGTRUE, FLAGTRUE);
+               return;
+             success:
+@@ -1252,7 +1255,7 @@ AddrsMatch(char *addr1, char *addr2)
+ {
+ #if USE_IPV6
+     int error, ret = 0;
+-    struct addrinfo *ai1, *ai2, hints;
++    struct addrinfo *ai1, *aip1, *ai2, *aip2, hints;
+ #else
+     /* so, since we might use inet_addr, we're going to use
+      * (in_addr_t)(-1) as a sign of an invalid ip address.
+@@ -1290,17 +1293,17 @@ AddrsMatch(char *addr1, char *addr2)
+       goto done;
+     }
+ 
+-    for (; ai1 != NULL; ai1 = ai1->ai_next) {
+-      for (; ai2 != NULL; ai2 = ai2->ai_next) {
+-          if (ai1->ai_addr->sa_family != ai2->ai_addr->sa_family)
++    for (aip1 = ai1; aip1 != NULL; aip1 = aip1->ai_next) {
++      for (aip2 = ai2; aip2 != NULL; aip2 = aip2->ai_next) {
++          if (aip1->ai_addr->sa_family != aip2->ai_addr->sa_family)
+               continue;
+ 
+           if (
+ # if HAVE_MEMCMP
+-                 memcmp(&ai1->ai_addr, &ai2->ai_addr,
++                 memcmp(&aip1->ai_addr, &aip2->ai_addr,
+                         sizeof(struct sockaddr_storage))
+ # else
+-                 bcmp(&ai1->ai_addr, &ai2->ai_addr,
++                 bcmp(&aip1->ai_addr, &aip2->ai_addr,
+                       sizeof(struct sockaddr_storage))
+ # endif
+                  == 0) {
+@@ -1311,8 +1314,10 @@ AddrsMatch(char *addr1, char *addr2)
+     }
+ 
+   done:
+-    freeaddrinfo(ai1);
+-    freeaddrinfo(ai2);
++    if (ai1)
++      freeaddrinfo(ai1);
++    if (ai2)
++      freeaddrinfo(ai2);
+     Msg("compare %s and %s returns %d", addr1, addr2, ret);
+     return ret;
+ #else



Home | Main Index | Thread Index | Old Index