From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jun 30 02:40:03 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1F01065676 for ; Tue, 30 Jun 2009 02:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2478FC17 for ; Tue, 30 Jun 2009 02:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n5U2e3fd061739 for ; Tue, 30 Jun 2009 02:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n5U2e3sJ061737; Tue, 30 Jun 2009 02:40:03 GMT (envelope-from gnats) Resent-Date: Tue, 30 Jun 2009 02:40:03 GMT Resent-Message-Id: <200906300240.n5U2e3sJ061737@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bryan Drewery Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0DD21065676 for ; Tue, 30 Jun 2009 02:31:52 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 9EEC48FC19 for ; Tue, 30 Jun 2009 02:31:52 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n5U2Vp38007665 for ; Tue, 30 Jun 2009 02:31:51 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n5U2VpXk007664; Tue, 30 Jun 2009 02:31:51 GMT (envelope-from nobody) Message-Id: <200906300231.n5U2VpXk007664@www.freebsd.org> Date: Tue, 30 Jun 2009 02:31:51 GMT From: Bryan Drewery To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/136176: mail/qmail: Outgoing IP + QMTPC - segfault X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 02:40:03 -0000 >Number: 136176 >Category: ports >Synopsis: mail/qmail: Outgoing IP + QMTPC - segfault >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 30 02:40:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Bryan Drewery >Release: FreeBSD 7.2 >Organization: >Environment: >Description: The combined patch for OUTGOING_IP and QMTPC (qmail-1.03-qmtpc_outgoingip.patch) fails to pass the 'outip' parameter to timeoutconn() which results in a segfault. >How-To-Repeat: Enable OUTGOING_IP and QMTPC. Send an email to a server with QMTP support enabled. 12801 in its MX. Tracing with gdb shows that the crash is in timeoutconn() as the 'outip' param is 0xd1 (209). >Fix: The current combined patch has this block: + + if (qmtp_priority(ip.ix[i].pref)) { + if (timeoutconn(smtpfd,&ip.ix[i].ip,(unsigned int) qmtp_port,timeoutconnect) == 0) { + tcpto_err(&ip.ix[i].ip,0); + partner = ip.ix[i].ip; + qmtp(); /* does not return */ + } + close(smtpfd); + smtpfd = socket(AF_INET,SOCK_STREAM,0); + if (smtpfd == -1) temp_oserr(); + } - if (timeoutconn(smtpfd,&ip.ix[i].ip,(unsigned int) port,timeoutconnect) == 0) { + if (timeoutconn(smtpfd,&ip.ix[i].ip,&outip,(unsigned int) smtp_port,timeoutconnect) == 0) { ------------------------ The first timeoutconn should be fixed to: if (timeoutconn(smtpfd,&ip.ix[i].ip,&outip, (unsigned int) qmtp_port,timeoutconnect) == 0) Note the &outip being passed in, same as the smtp timeoutconn() call. No patch attached. Let me know if you would like one. >Release-Note: >Audit-Trail: >Unformatted: