Use a relative path for creating UNIX sockets
See
tor
can crash at start up, if a provided path for an UNIX socket is too long.
One way to work around this is to to change the working directory to the directory where the path would be created, then create the socket using a relative link.
This is needed to fix a bug on Tor Browser for Android, but this may also improve compatibility with other UNIX systems, and allow longer socket names on certain UNIX systems.
You can test the concept by running the following script:
cd /tmp;
mkdir XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;
cd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;
echo 'Enter Ctrl+C';
nc -Ul ./foo;
echo 'Worked with relative path!';
echo 'Trying with absolute path:';
nc -Ul "$(realpath .)"/bar;
Source: https://unix.stackexchange.com/questions/367008/why-is-socket-path-length-limited-to-a-hundred-chars
Edited by Katarzyna Nowak