Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 May 2010 18:57:19 +0200 (CEST)
From:      Martin Matuska <mm@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        kuriyama@FreeBSD.org
Subject:   ports/147083: [PATCH] net/relayd: fix two ugly bugs
Message-ID:  <201005261657.o4QGvJYD098473@neo.vx.sk>
Resent-Message-ID: <201005261720.o4QHK6ak082591@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         147083
>Category:       ports
>Synopsis:       [PATCH] net/relayd: fix two ugly bugs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 26 17:20:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 8.1-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD neo.vx.sk 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #13 r208365M: Fri May 21 21:41:01 CEST
>Description:
Add fixes for two ugly bugs:

1. Control connection allocation bugfix
http://www.mail-archive.com/misc@openbsd.org/msg79451.html
Fix: import control.c diff rev. 1.23-1.24 and 1.35-1.36 

2. "relayctl reload" and a configuration file with syntax errors 
cause a segfault
Fix: import relayd.c diff rev. 1.65-1.66

Added file(s):
- files/patch-d-control.c

Port maintainer (kuriyama@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
1. Run "relayctl monitor", press CTRL+C, run "relayctl monitor"
2. Run relayd, make a syntax error to config file, run "relayctl reload"
>Fix:

--- relayd-4.2.20071221_1.patch begins here ---
Index: files/patch-d-control.c
===================================================================
RCS file: files/patch-d-control.c
diff -N files/patch-d-control.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-d-control.c	26 May 2010 16:47:17 -0000
@@ -0,0 +1,12 @@
+--- relayd/control.c.orig	2010-05-26 18:32:18.000000000 +0200
++++ relayd/control.c	2010-05-26 18:32:27.000000000 +0200
+@@ -141,7 +141,8 @@
+ 
+ 	session_socket_blockmode(connfd, BM_NONBLOCK);
+ 
+-	if ((c = malloc(sizeof(struct ctl_conn))) == NULL) {
++	if ((c = calloc(1, sizeof(struct ctl_conn))) == NULL) {
++		close(connfd);
+ 		log_warn("control_accept");
+ 		return;
+ 	}
Index: files/patch-d-relayd.c
===================================================================
RCS file: /home/pcvs/ports/net/relayd/files/patch-d-relayd.c,v
retrieving revision 1.1
diff -u -r1.1 patch-d-relayd.c
--- files/patch-d-relayd.c	20 Jan 2008 21:38:26 -0000	1.1
+++ files/patch-d-relayd.c	26 May 2010 16:47:17 -0000
@@ -1,5 +1,5 @@
---- relayd/relayd.c.orig	2008-01-14 10:00:21.487354557 +0900
-+++ relayd/relayd.c	2008-01-14 16:44:45.705572691 +0900
+--- relayd/relayd.c.orig	2010-05-26 18:42:56.000000000 +0200
++++ relayd/relayd.c	2010-05-26 18:42:59.000000000 +0200
 @@ -16,7 +16,7 @@
   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   */
@@ -18,7 +18,25 @@
  #include <md5.h>
  
  #include <openssl/ssl.h>
-@@ -943,7 +943,7 @@
+@@ -383,7 +383,7 @@
+ reconfigure(void)
+ {
+ 	struct relayd		*env = relayd_env;
+-	struct relayd		*new_env;
++	struct relayd		*new_env = NULL;
+ 	struct rdr		*rdr;
+ 	struct address		*virt;
+ 	struct table            *table;
+@@ -391,8 +391,6 @@
+ 
+ 	log_info("reloading configuration");
+ 	if ((new_env = parse_config(env->confpath, env->opts)) == NULL) {
+-		purge_config(new_env, PURGE_EVERYTHING);
+-		free(new_env);
+ 		log_warnx("configuration reloading FAILED");
+ 		return;
+ 	}
+@@ -943,7 +941,7 @@
  {
  	switch (type) {
  	case DIGEST_SHA1:
--- relayd-4.2.20071221_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005261657.o4QGvJYD098473>