[Pacemaker] [libqb]Unlink of files bound to sockets

Andrei Borzenkov arvidjaar at gmail.com
Mon Dec 22 22:29:55 EST 2014

В Mon, 22 Dec 2014 16:25:00 -0500 (EST)
David Vossel <dvossel at redhat.com> пишет:

> Linux has this non-portable concept of abstract sockets. This lets us create
> sockets without mapping directly to something on the filesystem. Unfortunately
> solaris doesn't have this feature. Somewhere along the line we introduced a
> file leak for solaris.
> Your original patch is actually very close to being correct.
> Take a look at this function.
> https://github.com/davidvossel/libqb/blob/master/lib/ipc_socket.c#L53
> That's where we set the sun_path.
> for the '#if defined(QB_LINUX) || defined(QB_CYGWIN)' sun_path is actually being
> set to ='\0',  which indicates we want to use that abstract socket feature. I'm
> unsure why we continue with what appears to be a useless snprintf to sun_path+1.

For abstract Linux socket you still need unique socket name; it just
starts with '\0' to indicate that it is not file path. 

More information about the Pacemaker mailing list