From owner-freebsd-emulation@FreeBSD.ORG Fri Dec 30 10:42:28 2005 Return-Path: X-Original-To: freebsd-emulation@FreeBSD.org Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 199D916A41F; Fri, 30 Dec 2005 10:42:28 +0000 (GMT) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1CDF43D94; Fri, 30 Dec 2005 10:42:14 +0000 (GMT) (envelope-from avg@icyb.net.ua) Received: from oddity (oddity-e.topspin.kiev.ua [212.40.38.87]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA15578; Fri, 30 Dec 2005 12:42:03 +0200 (EET) (envelope-from avg@icyb.net.ua) Date: Fri, 30 Dec 2005 12:42:03 +0200 (EET) From: Andriy Gapon X-X-Sender: avg@oddity.topspin.kiev.ua To: Alexander Leidinger In-Reply-To: <200512291610.jBTGAfgf010522@freefall.freebsd.org> Message-ID: <20051230123308.Y20613@oddity.topspin.kiev.ua> References: <200512291610.jBTGAfgf010522@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-emulation@FreeBSD.org Subject: Re: kern/72920: [linux]: path "prefixing" is not done on unix domain socket addresses X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2005 10:42:28 -0000 On Thu, 29 Dec 2005, Alexander Leidinger wrote: > Does this problem still persists on a recent FreeBSD? I can confirm that the problem still exists on FreeBSD 5.4 and looking at linux_socket.c differences between 5.4 and HEAD I am sure that the problem exists in all releases/branches: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/compat/linux/linux_socket.c.diff?r1=1.51.2.3&r2=1.62&f=h I am attaching a simple test program, so that anyone interested could easily verify the issue. Prerequisites for the test are: /compat/linux/tmp must exist /tmp/foo must not exist /compat/linux/tmp/foo must not exist Usage of ktrace is also advised for additional insights. /************ lin_un_sock.c *********/ #include #include #include #include #include #include int main() { struct sockaddr_un addr; int s; int err; /*this will create /compat/linux/tmp/foo/ directory*/ err = mkdir("/tmp/foo", 0777); if(err < 0) { perror("mkdir"); return 1; } s = socket(PF_LOCAL, SOCK_STREAM, 0); if(s < 0) { perror("socket"); return 1; } strcpy(addr.sun_path, "/tmp/foo/bar"); addr.sun_family = AF_LOCAL; /*this will try to bind socket in /tmp/foo/ directory *which does not exist */ err = bind(s, (struct sockaddr *) &addr, SUN_LEN(&addr)); if(err < 0) { perror("bind"); return 1; } return 0; } /******************************/ -- Andriy Gapon