Skip to content

Use a relative path for creating UNIX sockets

See

http://eweiibe6tdjsdprb4px6rqrzzcsi22m4koia44kc5pcjr7nec2rlxyad.onion/tpo/applications/tor-browser/-/issues/31814#note_3249722

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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information