From nobody@FreeBSD.org  Wed Oct 20 11:50:41 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4B75C16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2004 11:50:41 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3E01643D46
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2004 11:50:41 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i9KBoe6C087732
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 20 Oct 2004 11:50:40 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i9KBoemF087731;
	Wed, 20 Oct 2004 11:50:40 GMT
	(envelope-from nobody)
Message-Id: <200410201150.i9KBoemF087731@www.freebsd.org>
Date: Wed, 20 Oct 2004 11:50:40 GMT
From: Andriy Gapon <avg@icyb.net.ua>
To: freebsd-gnats-submit@FreeBSD.org
Subject: linux emulation : path "prefixing" is not done on unix domain socket addresses
X-Send-Pr-Version: www-2.3

>Number:         72920
>Category:       kern
>Synopsis:       [linux] path "prefixing" is not done on unix domain socket addresses
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-emulation
>State:          analyzed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 20 12:00:50 GMT 2004
>Closed-Date:    
>Last-Modified:  Thu Oct 06 18:58:44 UTC 2011
>Originator:     Andriy Gapon
>Release:        5.2.1-RELEASE-p11
>Organization:
>Environment:
5.2.1-RELEASE-p11 i386
>Description:
It seems that pathname "prefixing" is not performed for unix domain
socket calls in linux emulation e.g. "/compat/linux" prefix is never
tried to be prepended for bind() and connect() calls. 
When mixed with filesystem calls this leads to linux applications
failing in scenarios like this:


mkdir("/tmp/foo");
//this will create /compat/linux/tmp/foo/ directory

s = socket(AF_LOCAL, SOCK_DGRAM, PF_LOCAL);
strcpy(addr.sun_path, "/tmp/foo/bar");
addr.sun_family = AF_LOCAL;
bind(s, (struct sockaddr *) &addr, SUN_LEN(&addr));
//this will try to bind socket in /tmp/foo/ directory
//which does not exist

I have experinced this problem on FreeBSD 5.2.1 with two real-life
applications:
	oracle 9.2.0.4.0
	IBM WebSphere MQ 5.3

>How-To-Repeat:
Existence of this problem can be easily verified using a small program 
with the above code (make sure /tmp/foo directory is not existant).
>Fix:
fix should not be very hard to implement, but I'd prefer that someone more
familiar with the code would do it (someone who wrote the similar code for 
filesystem calls).
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->emulation 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Nov 29 09:31:36 GMT 2004 
Responsible-Changed-Why:  
Reassign to appropriate mailing list. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72920 
State-Changed-From-To: open->feedback 
State-Changed-By: netchild 
State-Changed-When: Thu Dec 29 16:09:27 UTC 2005 
State-Changed-Why:  
Does this problem still persists on a recent FreeBSD? 
If yes, I suggest to try to come up with a patch, since most 
of the problems are fixed by people which need a particular 
feature (we don't have a maintainer for the linuxolator). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72920 
State-Changed-From-To: feedback->open 
State-Changed-By: netchild 
State-Changed-When: Sat Jan 14 14:23:47 UTC 2006 
State-Changed-Why:  
Feedback reveived, the bug still exist in -current. 
 
http://www.freebsd.org/cgi/query-pr.cgi?pr=72920 
State-Changed-From-To: open->analyzed 
State-Changed-By: linimon 
State-Changed-When: Sat Jan 14 18:19:19 UTC 2006 
State-Changed-Why:  
ISTM 'analyzed' is a better state for this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72920 
State-Changed-From-To: analyzed->closed 
State-Changed-By: avg 
State-Changed-When: Sun Dec 5 15:26:02 UTC 2010 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=72920 
State-Changed-From-To: closed->analyzed 
State-Changed-By: avg 
State-Changed-When: Sun Dec 5 15:27:04 UTC 2010 
State-Changed-Why:  
Revert accidental status change. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72920 
>Unformatted:
