Mon Feb 23 22:27:37 2015 UTC ()
One more fix for assumption about POSIX accept(). PKGREVISION++


(fhajny)
diff -r1.4 -r1.5 pkgsrc/security/stud/Makefile
diff -r1.2 -r1.3 pkgsrc/security/stud/distinfo
diff -r1.2 -r1.3 pkgsrc/security/stud/patches/patch-stud.c

cvs diff -r1.4 -r1.5 pkgsrc/security/stud/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/security/stud/Attic/Makefile 2015/02/20 09:32:07 1.4
+++ pkgsrc/security/stud/Attic/Makefile 2015/02/23 22:27:37 1.5
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1# $NetBSD: Makefile,v 1.4 2015/02/20 09:32:07 fhajny Exp $ 1# $NetBSD: Makefile,v 1.5 2015/02/23 22:27:37 fhajny Exp $
2# 2#
3 3
4PKGNAME= stud-0.3p53 4PKGNAME= stud-0.3p53
5PKGREVISION= 3 5PKGREVISION= 4
6CATEGORIES= security 6CATEGORIES= security
7MAINTAINER= jym@NetBSD.org 7MAINTAINER= jym@NetBSD.org
8HOMEPAGE= http://github.com/bumptech/stud 8HOMEPAGE= http://github.com/bumptech/stud
9COMMENT= Scalable TLS Unwrapping Daemon 9COMMENT= Scalable TLS Unwrapping Daemon
10LICENSE= 2-clause-bsd 10LICENSE= 2-clause-bsd
11 11
12MASTER_SITES= http://rohara.fedorapeople.org/stud/ 12MASTER_SITES= http://rohara.fedorapeople.org/stud/
13DISTNAME= bumptech-stud-0.3-51-g0b88039 13DISTNAME= bumptech-stud-0.3-51-g0b88039
14WRKSRC= ${WRKDIR}/bumptech-stud-0b88039 14WRKSRC= ${WRKDIR}/bumptech-stud-0b88039
15 15
16USE_TOOLS+= gmake nroff pax:run 16USE_TOOLS+= gmake nroff pax:run
17 17
18BUILD_DEFS+= STUD_USER STUD_GROUP VARBASE 18BUILD_DEFS+= STUD_USER STUD_GROUP VARBASE

cvs diff -r1.2 -r1.3 pkgsrc/security/stud/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/security/stud/Attic/distinfo 2015/02/20 09:32:07 1.2
+++ pkgsrc/security/stud/Attic/distinfo 2015/02/23 22:27:37 1.3
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1$NetBSD: distinfo,v 1.2 2015/02/20 09:32:07 fhajny Exp $ 1$NetBSD: distinfo,v 1.3 2015/02/23 22:27:37 fhajny Exp $
2 2
3SHA1 (bumptech-stud-0.3-51-g0b88039.tar.gz) = fad22d9cf008b7db8f30d8d7ca0a6fcc177714de 3SHA1 (bumptech-stud-0.3-51-g0b88039.tar.gz) = fad22d9cf008b7db8f30d8d7ca0a6fcc177714de
4RMD160 (bumptech-stud-0.3-51-g0b88039.tar.gz) = 66a186e1095fd127945802ab681f5948ee1d4011 4RMD160 (bumptech-stud-0.3-51-g0b88039.tar.gz) = 66a186e1095fd127945802ab681f5948ee1d4011
5Size (bumptech-stud-0.3-51-g0b88039.tar.gz) = 41000 bytes 5Size (bumptech-stud-0.3-51-g0b88039.tar.gz) = 41000 bytes
6SHA1 (patch-Makefile) = c0794c6ebb3bdc3d55b473acec674a9f98b03ffb 6SHA1 (patch-Makefile) = c0794c6ebb3bdc3d55b473acec674a9f98b03ffb
7SHA1 (patch-configuration.c) = 886226a104f84bac6902bb8a8593d37a25653563 7SHA1 (patch-configuration.c) = 886226a104f84bac6902bb8a8593d37a25653563
8SHA1 (patch-stud.8) = a6b36ab6ac8c65cbc70172a9c230b22965cbdc3d 8SHA1 (patch-stud.8) = a6b36ab6ac8c65cbc70172a9c230b22965cbdc3d
9SHA1 (patch-stud.c) = aae56a212de51dfec4c31a9f4318818a79a51dfd 9SHA1 (patch-stud.c) = a33ccb6adc85ea545db3372201b8f50733d79222

cvs diff -r1.2 -r1.3 pkgsrc/security/stud/patches/Attic/patch-stud.c (expand / switch to unified diff)

--- pkgsrc/security/stud/patches/Attic/patch-stud.c 2015/02/20 09:32:07 1.2
+++ pkgsrc/security/stud/patches/Attic/patch-stud.c 2015/02/23 22:27:37 1.3
@@ -1,17 +1,18 @@ @@ -1,17 +1,18 @@
1$NetBSD: patch-stud.c,v 1.2 2015/02/20 09:32:07 fhajny Exp $ 1$NetBSD: patch-stud.c,v 1.3 2015/02/23 22:27:37 fhajny Exp $
2 2
3SunOS fixes as per https://github.com/bumptech/stud/pull/71. 3SunOS fixes as per https://github.com/bumptech/stud/pull/71.
4SSL fixes as per https://github.com/bumptech/stud/pull/130. 4SSL fixes as per https://github.com/bumptech/stud/pull/130.
 5Fix for POSIX accept() that can also return ECONNABORTED.
5 6
6--- stud.c.orig 2012-08-10 23:40:19.000000000 +0000 7--- stud.c.orig 2012-08-10 23:40:19.000000000 +0000
7+++ stud.c 8+++ stud.c
8@@ -189,9 +189,17 @@ typedef struct proxystate { 9@@ -189,9 +189,17 @@ typedef struct proxystate {
9  10
10 /* Set a file descriptor (socket) to non-blocking mode */ 11 /* Set a file descriptor (socket) to non-blocking mode */
11 static void setnonblocking(int fd) { 12 static void setnonblocking(int fd) {
12- int flag = 1; 13- int flag = 1;
13- 14-
14- assert(ioctl(fd, FIONBIO, &flag) == 0); 15- assert(ioctl(fd, FIONBIO, &flag) == 0);
15+ int flag; 16+ int flag;
16+#if defined(O_NONBLOCK) 17+#if defined(O_NONBLOCK)
17+ /* O_NONBLOCK is more portable and POSIX-standard */ 18+ /* O_NONBLOCK is more portable and POSIX-standard */
@@ -58,26 +59,35 @@ SSL fixes as per https://github.com/bump @@ -58,26 +59,35 @@ SSL fixes as per https://github.com/bump
58- LOG("{%s} Unexpected SSL error (in handshake): %d\n", w->fd == ps->fd_up ? "client" : "backend", err); 59- LOG("{%s} Unexpected SSL error (in handshake): %d\n", w->fd == ps->fd_up ? "client" : "backend", err);
59+ 60+
60+ // Try and get more detail on the error from the SSL 61+ // Try and get more detail on the error from the SSL
61+ // error queue. ERR_error_string requires a char buffer 62+ // error queue. ERR_error_string requires a char buffer
62+ // of 120 bytes. 63+ // of 120 bytes.
63+ unsigned long err_detail = ERR_get_error(); 64+ unsigned long err_detail = ERR_get_error();
64+ char err_msg[120]; 65+ char err_msg[120];
65+ ERR_error_string(err_detail, err_msg); 66+ ERR_error_string(err_detail, err_msg);
66+ 67+
67+ LOG("{client} Unexpected SSL error (in handshake): %d, %s\n", err, err_msg); 68+ LOG("{client} Unexpected SSL error (in handshake): %d, %s\n", err, err_msg);
68 shutdown_proxy(ps, SHUTDOWN_SSL); 69 shutdown_proxy(ps, SHUTDOWN_SSL);
69 } 70 }
70 } 71 }
 72@@ -1312,7 +1335,7 @@ static void handle_accept(struct ev_loop
 73 break;
 74
 75 default:
 76- assert(errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN);
 77+ assert(errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN || errno == ECONNABORTED);
 78 break;
 79 }
 80 return;
71@@ -1751,24 +1774,16 @@ void daemonize () { 81@@ -1751,24 +1774,16 @@ void daemonize () {
72 exit(0); 82 exit(0);
73 } 83 }
74  84
75- /* close standard streams */ 85- /* close standard streams */
76- fclose(stdin); 86- fclose(stdin);
77- fclose(stdout); 87- fclose(stdout);
78- fclose(stderr); 88- fclose(stderr);
79- 89-
80 /* reopen standard streams to null device */ 90 /* reopen standard streams to null device */
81- stdin = fopen(NULL_DEV, "r"); 91- stdin = fopen(NULL_DEV, "r");
82- if (stdin == NULL) { 92- if (stdin == NULL) {
83+ if (freopen(NULL_DEV, "r", stdin) == NULL) { 93+ if (freopen(NULL_DEV, "r", stdin) == NULL) {