Bash: connecting to Linux

I have an abstract Linux socket listening for connections.

An abstract Linux socket is basically an AF_UNIX named socket, except that the name is not specific to a file on the filesystem. Rather, it is simply a unique name within the abstract socket namespace within the kernel.

My question is, is there a way to connect to an abstract socket just using the Bash shell? I know from this question that you can use socat

or netcat

to connect to a normal AF_UNIX socket that is associated with a filesystem file. But when I tried to use this with an abstract socket it didn't work (it was treating my name string as a file and reported "file not found" which is what I expected.)

So, is there any utility I can use to connect to an abstract Linux socket?

+3


source to share


1 answer


Modern versions socat

have a namespace ABSTRACT

for this purpose.

Quote from the manual :



ABSTRACT-CONNECT: <string>

ABSTRACT-LISTEN: <string>

ABSTRACT-SENDTO: <string>

abstract-RECVFROM: & lt; string>

ABSTRACT-RECV: <string>

SUMMARY-CLIENT: <string>

ABSTRACT addresses are almost identical to UNIX addresses, except that they do not address filesystem-based sockets, but are an alternative UNIX domain address space. To archive this, socket address strings are prefixed with "\ 0" inside. This feature is available (only?) On Linux. Option groups are the same as the corresponding UNIX addresses, except that the ABSTRACT addresses are not members of the NAMED group.

+4


source







All Articles