Wed Feb 15 19:39:10 2017 UTC ()
Pullup ticket #5212 - requested by he
comms/conserver8: bugfix

Revisions pulled up:
- comms/conserver8/Makefile                                     1.22-1.24
- comms/conserver8/distinfo                                     1.11
- comms/conserver8/options.mk                                   1.5
- comms/conserver8/patches/patch-aa                             1.3
- comms/conserver8/patches/patch-ab                             1.2
- comms/conserver8/patches/patch-conserver_access.c             1.1
- comms/conserver8/patches/patch-conserver_consent.c            1.1

---
   Module Name:	pkgsrc
   Committed By:	he
   Date:		Wed Jan 18 09:54:51 UTC 2017

   Modified Files:
   	pkgsrc/comms/conserver8: Makefile distinfo
   	pkgsrc/comms/conserver8/patches: patch-aa patch-ab
   Added Files:
   	pkgsrc/comms/conserver8/patches: patch-conserver_access.c
   	    patch-conserver_consent.c

   Log Message:
   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.

---
   Module Name:	pkgsrc
   Committed By:	he
   Date:		Fri Feb 10 10:35:06 UTC 2017

   Modified Files:
   	pkgsrc/comms/conserver8: Makefile options.mk

   Log Message:
   Don't enable the inet6 option on the various BSDs, since their stack
   require separate inet6 and inet sockets, and conserver as of 8.2.1
   doesn't do that.
   Bump PKGREVISION.

---
   Module Name:	pkgsrc
   Committed By:	he
   Date:		Fri Feb 10 10:38:42 UTC 2017

   Modified Files:
   	pkgsrc/comms/conserver8: Makefile

   Log Message:
   Um, need bsd.prefs.mk before testing ${OPSYS}.


(bsiegert)
diff -r1.21 -r1.21.6.1 pkgsrc/comms/conserver8/Makefile
diff -r1.10 -r1.10.8.1 pkgsrc/comms/conserver8/distinfo
diff -r1.4 -r1.4.6.1 pkgsrc/comms/conserver8/options.mk
diff -r1.2 -r1.2.90.1 pkgsrc/comms/conserver8/patches/patch-aa
diff -r1.1 -r1.1.96.1 pkgsrc/comms/conserver8/patches/patch-ab
diff -r0 -r1.1.2.2 pkgsrc/comms/conserver8/patches/patch-conserver_access.c
diff -r0 -r1.1.2.2 pkgsrc/comms/conserver8/patches/patch-conserver_consent.c

cvs diff -r1.21 -r1.21.6.1 pkgsrc/comms/conserver8/Makefile (expand / switch to unified diff)

--- pkgsrc/comms/conserver8/Makefile 2016/06/20 15:25:39 1.21
+++ pkgsrc/comms/conserver8/Makefile 2017/02/15 19:39:10 1.21.6.1
@@ -1,44 +1,45 @@ @@ -1,44 +1,45 @@
1# $NetBSD: Makefile,v 1.21 2016/06/20 15:25:39 schnoebe Exp $ 1# $NetBSD: Makefile,v 1.21.6.1 2017/02/15 19:39:10 bsiegert Exp $
2# 2#
3 3
4PKGVER= 8.2.1 4PKGVER= 8.2.1
5PKGREVISION= 2 5PKGREVISION= 4
6DISTNAME= conserver-${PKGVER} 6DISTNAME= conserver-${PKGVER}
7PKGNAME= conserver8-${PKGVER} 7PKGNAME= conserver8-${PKGVER}
8CATEGORIES= comms 8CATEGORIES= comms
9MASTER_SITES= http://www.conserver.com/ 9MASTER_SITES= http://www.conserver.com/
10 10
11MAINTAINER= pkgsrc-users@netbsd.org 11MAINTAINER= pkgsrc-users@NetBSD.org
12HOMEPAGE= http://www.conserver.com/ 12HOMEPAGE= http://www.conserver.com/
13COMMENT= Application that allows multiple users to watch serial consoles 13COMMENT= Application that allows multiple users to watch serial consoles
14#LICENSE= # modified-bsd and more (see LICENSE file) 14#LICENSE= # modified-bsd and more (see LICENSE file)
15 15
16CONFLICTS= conserver-[0-9]* 16CONFLICTS= conserver-[0-9]*
17 17
18INSTALLATION_DIRS= ${EGDIR} ${DOCDIR} 18INSTALLATION_DIRS= ${EGDIR} ${DOCDIR}
19 19
20GNU_CONFIGURE= YES 20GNU_CONFIGURE= YES
21 21
22CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q} 22CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
23CONFIGURE_ARGS+= --with-master=${CONSERVER_DEFAULTHOST:Q} 23CONFIGURE_ARGS+= --with-master=${CONSERVER_DEFAULTHOST:Q}
24CONFIGURE_ARGS+= --with-port=${CONSERVER_DEFAULTPORT:Q} 24CONFIGURE_ARGS+= --with-port=${CONSERVER_DEFAULTPORT:Q}
25CONFIGURE_ARGS+= --with-libwrap=${BUILDLINK_PREFIX.tcp_wrappers} 25CONFIGURE_ARGS+= --with-libwrap=${BUILDLINK_PREFIX.tcp_wrappers}
26CONFIGURE_ARGS+= --with-logfile=${VARBASE:Q}/log/conserver 26CONFIGURE_ARGS+= --with-logfile=${VARBASE:Q}/log/conserver
27 27
28.include "options.mk" 
29 
30BUILD_DEFS+= CONSERVER_DEFAULTPORT CONSERVER_DEFAULTHOST VARBASE 28BUILD_DEFS+= CONSERVER_DEFAULTPORT CONSERVER_DEFAULTHOST VARBASE
31 29
 30.include "../../mk/bsd.prefs.mk"
 31.include "options.mk"
 32
32RCD_SCRIPTS= conserver8 33RCD_SCRIPTS= conserver8
33 34
34TEST_TARGET= test 35TEST_TARGET= test
35 36
36DOCDIR= ${PREFIX}/share/doc/conserver 37DOCDIR= ${PREFIX}/share/doc/conserver
37EGDIR= ${PREFIX}/share/examples/conserver 38EGDIR= ${PREFIX}/share/examples/conserver
38CONF_FILES= ${EGDIR}/conserver.cf ${PKG_SYSCONFDIR}/conserver.cf 39CONF_FILES= ${EGDIR}/conserver.cf ${PKG_SYSCONFDIR}/conserver.cf
39CONF_FILES+= ${EGDIR}/conserver.passwd ${PKG_SYSCONFDIR}/conserver.passwd 40CONF_FILES+= ${EGDIR}/conserver.passwd ${PKG_SYSCONFDIR}/conserver.passwd
40OWN_DIRS= ${VARBASE}/consoles 41OWN_DIRS= ${VARBASE}/consoles
41 42
42SUBST_CLASSES+= conf 43SUBST_CLASSES+= conf
43SUBST_STAGE.conf= post-patch 44SUBST_STAGE.conf= post-patch
44SUBST_FILES.conf= conserver.cf/conserver.cf 45SUBST_FILES.conf= conserver.cf/conserver.cf

cvs diff -r1.10 -r1.10.8.1 pkgsrc/comms/conserver8/distinfo (expand / switch to unified diff)

--- pkgsrc/comms/conserver8/distinfo 2016/03/13 18:31:11 1.10
+++ pkgsrc/comms/conserver8/distinfo 2017/02/15 19:39:10 1.10.8.1
@@ -1,9 +1,11 @@ @@ -1,9 +1,11 @@
1$NetBSD: distinfo,v 1.10 2016/03/13 18:31:11 schnoebe Exp $ 1$NetBSD: distinfo,v 1.10.8.1 2017/02/15 19:39:10 bsiegert Exp $
2 2
3SHA1 (conserver-8.2.1.tar.gz) = 357eea46c0189280b0ab66776b01ce3ba02f1847 3SHA1 (conserver-8.2.1.tar.gz) = 357eea46c0189280b0ab66776b01ce3ba02f1847
4RMD160 (conserver-8.2.1.tar.gz) = 39f08facffc9b462c8257fa21c24785eb1e2bb5a 4RMD160 (conserver-8.2.1.tar.gz) = 39f08facffc9b462c8257fa21c24785eb1e2bb5a
5SHA512 (conserver-8.2.1.tar.gz) = caf519b8295fc142cf1cb5b141854aede07b3613653f417e9c3ebee75b30a12fa785c248806758f60afbc155cc048418635d514a9848e0fa06992f1e4f930fb6 5SHA512 (conserver-8.2.1.tar.gz) = caf519b8295fc142cf1cb5b141854aede07b3613653f417e9c3ebee75b30a12fa785c248806758f60afbc155cc048418635d514a9848e0fa06992f1e4f930fb6
6Size (conserver-8.2.1.tar.gz) = 335241 bytes 6Size (conserver-8.2.1.tar.gz) = 335241 bytes
7SHA1 (patch-aa) = d0eebea0d126c611f6f60035730a0c2f97280b01 7SHA1 (patch-aa) = e7dea78d62c4e879c0741b0c9992811410737178
8SHA1 (patch-ab) = 7a507e428277cc6ccf14b961c44d4e6fd3abcde3 8SHA1 (patch-ab) = ec5b849cad7662a3e14a834d63840a306e89bdf2
 9SHA1 (patch-conserver_access.c) = a7956022bbdbbf2dc97ee474e8815d48d6adfadd
 10SHA1 (patch-conserver_consent.c) = aa868cdacfe8a8e294ba8dcf74e2460ddf34ef3a
9SHA1 (patch-conserver_readcfg.c) = c39e1d50829658cb77e4c943e631da4b3cdd31ee 11SHA1 (patch-conserver_readcfg.c) = c39e1d50829658cb77e4c943e631da4b3cdd31ee

cvs diff -r1.4 -r1.4.6.1 pkgsrc/comms/conserver8/options.mk (expand / switch to unified diff)

--- pkgsrc/comms/conserver8/options.mk 2016/06/20 15:25:39 1.4
+++ pkgsrc/comms/conserver8/options.mk 2017/02/15 19:39:10 1.4.6.1
@@ -1,23 +1,29 @@ @@ -1,23 +1,29 @@
1# $NetBSD: options.mk,v 1.4 2016/06/20 15:25:39 schnoebe Exp $ 1# $NetBSD: options.mk,v 1.4.6.1 2017/02/15 19:39:10 bsiegert Exp $
2 2
3PKG_OPTIONS_VAR= PKG_OPTIONS.conserver8 3PKG_OPTIONS_VAR= PKG_OPTIONS.conserver8
4 4
5PKG_OPTIONS_OPTIONAL_GROUPS= connectivity 5PKG_OPTIONS_OPTIONAL_GROUPS= connectivity
6PKG_OPTIONS_GROUP.connectivity=inet6 uds 6PKG_OPTIONS_GROUP.connectivity=inet6 uds
7 7
8PKG_SUPPORTED_OPTIONS= pam ssl 8PKG_SUPPORTED_OPTIONS= pam ssl
9 9
10PKG_SUGGESTED_OPTIONS= ssl inet6 10PKG_SUGGESTED_OPTIONS= ssl
 11
 12# The BSDs require separate inet6 & inet sockets,
 13# and conserver8 doesn't have code to do that as of 8.2.1
 14.if ${OPSYS} != "NetBSD" && ${OPSYS} != "FreeBSD" && ${OPSYS} != "OpenBSD" && ${OPSYS} != "DragonFly"
 15PKG_SUGGESTED_OPTIONS+= inet6
 16.endif
11 17
12.include "../../mk/bsd.options.mk" 18.include "../../mk/bsd.options.mk"
13 19
14.if !empty(PKG_OPTIONS:Mpam) 20.if !empty(PKG_OPTIONS:Mpam)
15. include "../../mk/pam.buildlink3.mk" 21. include "../../mk/pam.buildlink3.mk"
16CONFIGURE_ARGS+= --with-pam 22CONFIGURE_ARGS+= --with-pam
17.endif 23.endif
18 24
19.if !empty(PKG_OPTIONS:Muds) 25.if !empty(PKG_OPTIONS:Muds)
20CONFIGURE_ARGS+= --with-uds 26CONFIGURE_ARGS+= --with-uds
21.endif 27.endif
22 28
23.if !empty(PKG_OPTIONS:Minet6) 29.if !empty(PKG_OPTIONS:Minet6)

cvs diff -r1.2 -r1.2.90.1 pkgsrc/comms/conserver8/patches/patch-aa (expand / switch to unified diff)

--- pkgsrc/comms/conserver8/patches/patch-aa 2006/05/11 21:42:43 1.2
+++ pkgsrc/comms/conserver8/patches/patch-aa 2017/02/15 19:39:10 1.2.90.1
@@ -1,14 +1,16 @@ @@ -1,14 +1,16 @@
1$NetBSD: patch-aa,v 1.2 2006/05/11 21:42:43 seb Exp $ 1$NetBSD: patch-aa,v 1.2.90.1 2017/02/15 19:39:10 bsiegert Exp $
 2
 3Reduce verbosity.
2 4
3--- conserver/main.c.orig 2006-04-03 09:32:08.000000000 -0400 5--- conserver/main.c.orig 2006-04-03 09:32:08.000000000 -0400
4+++ conserver/main.c 2006-05-07 22:24:26.000000000 -0400 6+++ conserver/main.c 2006-05-07 22:24:26.000000000 -0400
5@@ -463,7 +463,9 @@ 7@@ -463,7 +463,9 @@
6 int td; 8 int td;
7 #endif 9 #endif
8  10
9+#if 0 11+#if 0
10 Msg("daemonizing"); 12 Msg("daemonizing");
11+#endif 13+#endif
12 SimpleSignal(SIGQUIT, SIG_IGN); 14 SimpleSignal(SIGQUIT, SIG_IGN);
13 SimpleSignal(SIGINT, SIG_IGN); 15 SimpleSignal(SIGINT, SIG_IGN);
14 #if defined(SIGTTOU) 16 #if defined(SIGTTOU)

cvs diff -r1.1 -r1.1.96.1 pkgsrc/comms/conserver8/patches/Attic/patch-ab (expand / switch to unified diff)

--- pkgsrc/comms/conserver8/patches/Attic/patch-ab 2005/08/12 14:39:06 1.1
+++ pkgsrc/comms/conserver8/patches/Attic/patch-ab 2017/02/15 19:39:10 1.1.96.1
@@ -1,14 +1,16 @@ @@ -1,14 +1,16 @@
1$NetBSD: patch-ab,v 1.1 2005/08/12 14:39:06 he Exp $ 1$NetBSD: patch-ab,v 1.1.96.1 2017/02/15 19:39:10 bsiegert Exp $
 2
 3Document that escape sequence converts to "telnet break" when using telnet.
2 4
3--- conserver.cf/conserver.cf.man.orig 2004-11-06 01:20:30.000000000 +0100 5--- conserver.cf/conserver.cf.man.orig 2004-11-06 01:20:30.000000000 +0100
4+++ conserver.cf/conserver.cf.man 6+++ conserver.cf/conserver.cf.man
5@@ -271,7 +271,30 @@ is ``and''ed with 0x1f) 7@@ -271,7 +271,30 @@ is ``and''ed with 0x1f)
6 .PD 8 .PD
7 .RE 9 .RE
8 .RE 10 .RE
9+.sp 11+.sp
10+For consoles accessed using the telnet protocol, the \f3\ez\fP 12+For consoles accessed using the telnet protocol, the \f3\ez\fP
11+sequence will be translated to the telnet protocol's ``send break'' 13+sequence will be translated to the telnet protocol's ``send break''
12+protocol sequence. 14+protocol sequence.
13+.sp 15+.sp
14+Conserver provides the following predefined default break strings: 16+Conserver provides the following predefined default break strings:

File Added: pkgsrc/comms/conserver8/patches/patch-conserver_access.c
$NetBSD: patch-conserver_access.c,v 1.1.2.2 2017/02/15 19:39:10 bsiegert 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);

File Added: pkgsrc/comms/conserver8/patches/patch-conserver_consent.c
$NetBSD: patch-conserver_consent.c,v 1.1.2.2 2017/02/15 19:39:10 bsiegert 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