C/C++ remusock: a tool to make a local unix domain socket available on a remote machine


Aspiring Daemon

Reaction score: 472
Messages: 699

Would you be able to add a list of possible use-cases / scenarios for this piece of software? Might go well in the repo's readme.


Son of Beastie

Reaction score: 2,005
Messages: 3,327

Well, one reason to post this thread was to find out whether someone would have a usecase (and whether it would be useful if I added stuff like TLS and authentication). So far, I only know my own (slightly obscure) usecase:

The standard way for an MTA to use dovecot's authentication is through a local unix socket. This is supported by exim. dovecot has the option to offer a TCP socket for auth as well, but unfortunately, exim can't use it. I have a setup with an internal mailer and an external "mail gateway", both have dovecot and exim installed. For auth, the external MTA needs to use the internal dovecot's socket, cause dovecot in proxy mode uses some kind of tunneled auth and the external dovecot socket will succeed with any credentials (I only noticed that after some spammer started abusing my external MTA) 🤯 I had to disable authenticated relaying quickly, and to re-enable it, I wrote this tool…

I think kpedersen (?) outlined another possible usecase in a different thread: forwarding X11's local socket to a jail on the same machine that's on a different FS. Not sure whether this has been tested so far ;)

Jose: lol – there are for sure obscure optimizations, not all conforming to the C standard. But from -O3, you should expect that it respects the standard. So, if the result is broken, either your code or the compiler is broken :cool: – and in this case, I couldn't blame the compiler, without volatile, it's indeed incorrect. Guess last year, I was mislead to believe volatile was already implied by sig_atomic_t.