June McEnroe
1b8be724bc
Sanitize leading dots from log path components
...
Prevent directory traversal by sanitizing leading dots as well as
slashes from log path components, which can be controlled by the
server. Side effect of preventing hidden dotfiles is a bonus, I
think.
Also check that the full path actually fits in the buffer.
Reported-by: Samanta Navarro <ferivoz@riseup.net>
2022-04-20 18:29:28 -04:00
C. McEnroe
b6cf41ab77
Import refactored xdg.c from pounce
2021-10-16 17:03:31 -04:00
C. McEnroe
54d899196c
FreeBSD: Avoid caph_stream_rights(3)
...
caph_stream_rights(3) doesn't exist before FreeBSD 13.0 and there's
no good reason to create that dependency. I still run servers on
FreeBSD 12.
This is a partial revert of cbc9545cb3
.
2021-07-13 15:16:22 -04:00
C. McEnroe
cbc9545cb3
FreeBSD: Use capsicum_helpers.h
2021-06-28 09:11:02 -04:00
C. McEnroe
56c31ae442
FreeBSD: Limit rights on log directory
2021-06-25 12:19:11 -04:00
C. McEnroe
fece6e6eb6
Keep log directory open, use mkdirat(2) and openat(2)
2021-06-25 11:50:14 -04:00
C. McEnroe
73181be1ca
Open log files with CLOEXEC
2021-06-21 13:31:05 -04:00
C. McEnroe
0f7518226e
Check fprintf return values rather than ferror
2021-01-10 22:00:40 -05:00
C. McEnroe
814c36223a
Say "OpenSSL" in additional permission notices
...
LibreSSL is "a modified version of that library".
2020-08-04 12:19:14 -04:00
C. McEnroe
721c3a9ee6
Add additional permission for linking with LibreSSL
...
https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs
2020-06-08 17:48:07 -04:00
C. McEnroe
d99f20c0ff
Add logging functions
...
The mkdir dance is a bit awkward...
2020-03-25 18:56:09 -04:00
C. McEnroe
15ff2a470e
Remove legacy code
2020-02-11 02:45:39 -05:00
Curtis McEnroe
98b76d1b7e
Make copyright headers consistent
2019-07-27 18:00:01 -04:00
Curtis McEnroe
b2f6082dff
Add M-l to list the log
2019-02-25 21:48:05 -05:00
Curtis McEnroe
c4c4de6923
Use getline in place of fgetln
2019-01-25 03:17:02 -05:00
Curtis McEnroe
3d9906b00f
Measure length of log timestamp more consistently
2018-11-30 17:17:34 -05:00
Curtis McEnroe
908b834c1a
Strip timestamps from log replay
...
Also fix string length. %.*s does not behave as one might expect when
writing wchar_t.
2018-11-29 18:52:03 -05:00
Curtis McEnroe
d7659376d1
Add basic log replay
2018-11-29 18:20:24 -05:00
Curtis McEnroe
240f9ebf84
Use PascalCase for constants
...
Begone underscores.
2018-09-02 16:13:00 -04:00
Curtis McEnroe
6ec3c3011e
Do not set log files executable
...
Oops.
2018-08-18 00:02:38 -04:00
Curtis McEnroe
9469db993c
Add logging
...
The reason logFmt takes a timestamp as a parameter is to support IRCv3
server-time in the future to accurately log the znc buffer. Hopefully.
2018-08-17 21:50:45 -04:00