From owner-freebsd-ports-bugs@FreeBSD.ORG Tue May 16 15:27:15 2006 Return-Path: X-Original-To: freebsd-ports-bugs@FreeBSD.org Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91B2F16A402; Tue, 16 May 2006 15:27:15 +0000 (UTC) (envelope-from huntting@glarp.com) Received: from pernicious.glarp.com (71-211-243-76.hlrn.qwest.net [71.211.243.76]) by mx1.FreeBSD.org (Postfix) with ESMTP id D188F43D45; Tue, 16 May 2006 15:27:14 +0000 (GMT) (envelope-from huntting@glarp.com) Received: from hunkular.glarp.com (hunkular.glarp.com [10.0.0.251]) by pernicious.glarp.com (8.13.6/8.13.4) with ESMTP id k4GFR5Us013255 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NOT); Tue, 16 May 2006 09:27:06 -0600 (MDT) (envelope-from huntting@hunkular.glarp.com) Received: from hunkular.glarp.com (localhost [127.0.0.1]) by hunkular.glarp.com (8.13.4/8.13.4) with ESMTP id k4GFR5PT001207; Tue, 16 May 2006 09:27:05 -0600 (MDT) (envelope-from huntting@hunkular.glarp.com) Message-Id: <200605161527.k4GFR5PT001207@hunkular.glarp.com> To: clemens fischer From: Brad Huntting In-Reply-To: Your message of "Tue, 16 May 2006 16:02:28 +0200." <20060516140228.GA607@spotteswoode.de.eu.org> Date: Tue, 16 May 2006 09:27:05 -0600 Sender: huntting@glarp.com X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (pernicious.glarp.com [10.0.0.254]); Tue, 16 May 2006 09:27:06 -0600 (MDT) Cc: freebsd-ports-bugs@FreeBSD.org, Ion-Mihai IOnut Tetcu , Brad Huntting Subject: Re: ports/96918: sysutils/fcron: fcrondyn completely broken 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, 16 May 2006 15:27:16 -0000 > never mind. i have a problem with the postfix MTA re. local (unix) > sockets, where code and error message look remarkably similar. this > isn't all that urgent, but at somepoint in the future i'll have to > tackle it. > is there a reason why linux-code differs slightly from fbsd as far as > connect(2) is concerned? is your patch the "canonical" way of dealing > with it? The problem is that BSD (as of Net2 or Reno) changed (struct sockaddr) (and all the family specific versions such as (struct sockadder_un) to add a length field (sa_len, or sun_len) which needs to be set to the length of the struct (or zeroed out so it's deliberately ignored). As usual, Linux chose to emulate the old way rather than adopting the new sockaddr convention. Since so much code today is writen for Linux, this has become a common problem with anything that uses unix domain sockets. The generic fix is to add code to configure.in and config.h.in.in to set HAVE_SA_LEN. Then, when filling in the struct sockaddr before a connect or bind, use #ifdef HAVE_SA_LEN and fill in the sun_len field. This is the bulk of the patch in PR ports/97066. Note, in this case, the code leading up to connect() was did not correctly check the path length and called strncpy() with incorrect arguments, so I had to fix that too. But, yes, the changes to configure.in and config.in.in are generic enough they should be useable with anything that uses gnu configure just place the added lines in the right place. Then add the appropreate #ifdefs when setting up the socket address before bind and connect. Such a patch should be ecumenical enough that it can be sent to the original code maintainer. After all, FreeBSD is not the only system to use sa_len. hope that helps, brad