Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Feb 2010 17:29:56 GMT
From:      Andrei Lavreniyuk <andy.lavr@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/144068: [PATCH] Update ports/mail/dbmail to version 2.2.15 
Message-ID:  <201002181729.o1IHTuwu044943@www.freebsd.org>
Resent-Message-ID: <201002181740.o1IHe3Un085489@freefall.freebsd.org>

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

>Number:         144068
>Category:       ports
>Synopsis:       [PATCH] Update ports/mail/dbmail to version 2.2.15
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 18 17:40:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Andrei Lavreniyuk
>Release:        FreeBSD 8.0-STABLE
>Organization:
Technica-03, Inc.
>Environment:
FreeBSD datacenter.technica-03.local 8.0-STABLE FreeBSD 8.0-STABLE #0: Sat Feb 13 11:01:53 EET 2010     root@datacenter.technica-03.local:/usr/obj/usr/src/sys/SMP64  amd64
>Description:

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN dbmail.bak/Makefile dbmail/Makefile
--- dbmail.bak/Makefile	2010-02-18 19:16:06.819302774 +0200
+++ dbmail/Makefile	2010-02-18 19:22:40.411974666 +0200
@@ -6,8 +6,7 @@
 #
 
 PORTNAME=	dbmail
-PORTVERSION=	2.2.11
-PORTREVISION=	0
+PORTVERSION=	2.2.15
 CATEGORIES=	mail
 MASTER_SITES=	http://www.dbmail.org/download/2.2/
 
diff -ruN dbmail.bak/distinfo dbmail/distinfo
--- dbmail.bak/distinfo	2010-02-18 19:16:06.778534513 +0200
+++ dbmail/distinfo	2010-02-18 19:16:28.923239679 +0200
@@ -1,3 +1,3 @@
-MD5 (dbmail-2.2.11.tar.gz) = d535587973d73b85469d92a35f52133b
-SHA256 (dbmail-2.2.11.tar.gz) = 7d61ce32b5f1cbbc42fa39e3c1cc10659c524a7d3135555efe4b272064939148
-SIZE (dbmail-2.2.11.tar.gz) = 901705
+MD5 (dbmail-2.2.15.tar.gz) = 4d0a44c35c02b9c7509489bf5025e113
+SHA256 (dbmail-2.2.15.tar.gz) = ca88e4a3bc1360b3621ffd8567103668a896ecb22102d3886ab5e59e7747217b
+SIZE (dbmail-2.2.15.tar.gz) = 875592
diff -ruN dbmail.bak/files/patch-server.c dbmail/files/patch-server.c
--- dbmail.bak/files/patch-server.c	1970-01-01 03:00:00.000000000 +0300
+++ dbmail/files/patch-server.c	2010-02-18 19:16:11.000000000 +0200
@@ -0,0 +1,105 @@
+--- server.c.orig	2010-02-13 11:17:42.000000000 +0200
++++ server.c	2009-02-02 16:21:55.000000000 +0200
+@@ -44,7 +44,7 @@
+ ChildInfo_t childinfo;
+ 
+ /* some extra prototypes (defintions are below) */
+-static void ParentSigHandler(int sig);
++static void ParentSigHandler(int sig, siginfo_t * info, void *data);
+ static int SetParentSigHandler(void);
+ static int server_setup(serverConfig_t *conf);
+ 
+@@ -59,11 +59,11 @@
+ 
+ 	act.sa_sigaction = ParentSigHandler;
+ 	sigemptyset(&act.sa_mask);
+-	act.sa_flags = 0;
++	act.sa_flags = SA_SIGINFO;
+ 
+ 	sact.sa_sigaction = ParentSigHandler;
+ 	sigemptyset(&sact.sa_mask);
+-	sact.sa_flags = SA_NOCLDSTOP;
++	sact.sa_flags = SA_SIGINFO | SA_NOCLDSTOP;
+ 
+ 	sigaction(SIGCHLD,	&sact, 0);
+ 	sigaction(SIGINT,	&sact, 0);
+@@ -329,7 +329,7 @@
+ 	return result;
+ }
+ 
+-void ParentSigHandler(int sig)
++void ParentSigHandler(int sig, siginfo_t * info UNUSED, void *data UNUSED)
+ {
+ 	int saved_errno = errno;
+ 	Restart = 0;
+@@ -437,41 +437,41 @@
+ 
+ static int create_inet_socket(const char * const ip, int port, int backlog)
+ {
+-        struct addrinfo hints, *res, *ressave;
+-        int sock, n, flags;
++	int sock, err, flags;
++	struct sockaddr_in saServer;
+ 	int so_reuseaddress = 1;
+-	field_t service;
+ 
+-        memset(&hints, 0, sizeof(struct addrinfo));
+-        hints.ai_flags     = AI_PASSIVE;
+-        hints.ai_family    = AF_UNSPEC;
+-        hints.ai_socktype  = SOCK_STREAM;
+-
+-	memset(service, 0, sizeof(field_t));
+-	snprintf(service, sizeof(field_t), "%d", port);
+-
+-        n = getaddrinfo(ip, service, &hints, &res);
+-        if (n < 0) {
+-                TRACE(TRACE_FATAL, "getaddrinfo::error [%s]", gai_strerror(n));
+-                return -1;
+-        }
+-
+-        ressave = res;
+-        if ((sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) {
+-                int serr = errno;
+-                freeaddrinfo(ressave);
+-                TRACE(TRACE_FATAL, "%s", strerror(serr));
+-        }
++	sock = dm_socket(PF_INET);
++	
++	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddress, sizeof(so_reuseaddress));
+ 
+-        TRACE(TRACE_DEBUG, "create socket [%s:%d] backlog [%d]", ip, port, backlog);
++	/* setup sockaddr_in */
++	memset(&saServer, 0, sizeof(saServer));
++	saServer.sin_family	= AF_INET;
++	saServer.sin_port	= htons(port);
+ 
+-	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddress, sizeof(so_reuseaddress));
++	TRACE(TRACE_DEBUG, "creating socket on [%s:%d] with backlog [%d]",
++			ip, port, backlog);
++	
++	if (ip[0] == '*') {
++		
++		saServer.sin_addr.s_addr = htonl(INADDR_ANY);
++		
++	} else if (! (inet_aton(ip, &saServer.sin_addr))) {
++		
++		close(sock);
++		TRACE(TRACE_FATAL, "IP invalid [%s]", ip);
++	}
+ 
+-        // any error in dm_bind_and_listen is fatal
+-        dm_bind_and_listen(sock, res->ai_addr, res->ai_addrlen, backlog);
+-        freeaddrinfo(ressave);
++	err = dm_bind_and_listen(sock, (struct sockaddr *)&saServer, sizeof(saServer), backlog);
++	if (err != 0) {
++		close(sock);
++		TRACE(TRACE_FATAL, "Fatal error, could not bind to [%s:%d] %s",
++			ip, port, strerror(err));
++	}
+ 
+-	// unblock
++	// man 2 accept says that if the connection disappears during the accept call 
++	// accept will block forever unless it is set non-blocking with fcntl
+ 	flags = fcntl(sock, F_GETFL);
+ 	fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+ 


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



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