]> git.ipfire.org Git - thirdparty/strongswan.git/commit
file-logger: Prevent potential race when opening log files and change permission master
authorTobias Brunner <tobias@strongswan.org>
Fri, 24 Jul 2026 10:35:23 +0000 (12:35 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 24 Jul 2026 11:55:04 +0000 (13:55 +0200)
commitea7a721dd8f7ff429109eb33b4f8dd5894be8f22
tree0dfc34a585385ca6c76df73e4932ddd119c3296f
parent50ac563292accebdc36e8fb1e34f52ce00b234bd
file-logger: Prevent potential race when opening log files and change permission

This fixes a potential TOCTOU issue with opening log files.  The use of
`chown()` instead of `fchown()` could theoretically allow modifying the
ownership of an unintended file.

The log file now also is not world-readable anymore.

Also, the patch fixes the log groups for the two `(f)chown()` errors.

Fixes: d35d6691807d ("Make syslog and file loggers configurable at runtime")
src/libcharon/bus/listeners/file_logger.c