OpenSolaris

Printable Version Enter a New Search
Bug ID 6574205
Synopsis No support for abstract namespace UNIX sockets in lx brand library emulation
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:brandz
Keywords lx_bind | lx_socketcall
Responsible Engineer Evan Hoke
Reported Against snv_68
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_72
Fixed In snv_72
Release Fixed solaris_nevada(snv_72)
Related Bugs 6589261
Submit Date 26-June-2007
Last Update Date 31-August-2007
Description
struct sockaddr_un {
	sa_family_t    sun_family;               /* AF_UNIX */
	char           sun_path[UNIX_PATH_MAX];  /* pathname */
};

From the "unix 7" man page on CentOS 3 (2002-12-02) Linux (kernel 2.4):
sun_family  always contains AF_UNIX.  sun_path contains the zero-termi-
nated pathname of the socket in the file system.   If  sun_path  starts
with a zero byte it refers to the abstract namespace maintained by the
Unix protocol  module.   The  socket's  address  in  this namespace is  given
by  the rest of the bytes in sun_path.  Note that names in the abstract
namespace are not zero-terminated.

Currently, lx_bind does not check the pathname for a leading NULL byte, but blindly
passes the sockaddr to bind.

I have not found any applications in CentOS 3 that use this functionality, but in CentOS 4 and greater, Gnome applications, such as Gnome panel use abstract namespace sockets to communicate with each other. Also Ubuntu init will fail to run without this functionality.

To emulate abstract namespace sockets, in the lx_bind function, I plan to modify paths that begin with a null charactor to point to files in the /tmp directory by prepending "/tmp/.ABSK_" to the specified path, and replacing all subsequent null character and "/" with "_". Since the overhead of creating and deleting files needs to be invisible to the caller, lx_bind will check to see if a socket with the same name exsists. If this is the case it will try to connect to it, to see if it is an active socket and return an error if this is the case. Otherwise it will remove the socket and create a new one.
Work Around
N/A
Comments
N/A