If a user wants to bind to a privileged port (<1024) our current systemd unit fails to provide enough capabilities to endlessh binary.
So, a user can modify `/etc/endlessh/config` to have `Port=22` or similar and then check out the systemd unit to enable the extra attribute.
`ConfigurationDirectory=endlessh` should be enough. Previous assignment throws a warning with systemd 237
```
May 13 08:57:18 kernelwtf systemd[1]: Started Endlessh SSH Tarpit.
May 13 08:58:20 kernelwtf systemd[1]: /etc/systemd/system/endlessh.service:25: ConfigurationDirectory= path is not valid, ignoring assignment: /etc/endlessh
```
Thanks for creating this wonderful tool!
By default `make install` installs the binary into `/usr/local/bin` so I think this should be changed accordingly.
Cheers
When logging was enabled via the config file, standard output was left
fully buffered. Logs should never be fully buffered.
Thanks to Chang-Li for pointing this out.
* Don't dynamically allocate the struct since that's not necessary.
* Use a more concise log message.
* Include current clients when counting the time.
* Print final statistics message *after* closing all clients.
* Don't include total connections in ACCEPT.
* Mention SIGUSR1 in the new man page, too.
Adjusts #24.
As *BSD defaults to use IPv6 only sockets and Linux to IPv4 mapped IPv6
sockets, switches to support explicit binding address families are required.
Now set explicitly if you want IPv6 only, IPv4 only or mapped IPv4.
Caveat:
OpenBSD explicitly states to not support IPv4 mapped IPv6 via setsock-API
It seems this is required to get all the IPv6 definitions, though most
systems aren't very picky. NetBSD seems to be one of those picky
systems, though.
1. If sockets are non-blocking, no need to use poll() on them. Just try
to write regardless and ignore the outcome. This means we don't need the
pollvec stuff anymore.
2. getline(3) is apparently still too new to POSIX that it's hard to use
portably. We don't really need it that badly anyway.
3. Don't use MSG_DONTWAIT. It's non-standard and apparently still hard
to use portably. Set sockets to non-blocking instead.
4. Since we're not polling on client sockets, the queue is a whole lot
simpler.
Requires extensions to be enabled due to incomplete support for
POSIX.1-2008. However one of the now-exposed extensions is tragically
named "struct queue". This struct was been renamed to "struct fifo".
Thanks to @yvoinov for reporting this issue and collaborating on a
solution.
Closes#14, #17.
Assuming an /opt/ install. For those unfamiliar, plop it into /etc/systemd/system (symlinks might not work, old systemd bug), run `systemctl daemon-reload`, and have it start on boot (and immediately) with `systemctl enable --now endlessh.service`