]> git.ipfire.org Git - thirdparty/chrony.git/commit
util: don't open symlink when appending to file
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 25 Aug 2020 07:39:59 +0000 (09:39 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 25 Aug 2020 09:49:44 +0000 (11:49 +0200)
commit79b348f07519094d508544ed447c2fd252be1f99
tree4a6d5886f701948a95ee9c8f200dc23d07fab6bf
parent9d88c028e289910462d33dde1d34ba865f84c1d9
util: don't open symlink when appending to file

When opening a file for appending (i.e. a log file), use the O_NOFOLLOW
flag to get an error if the path is a symlink. Opening log files through
symlinks is no longer supported.

This is a protection against symlink attacks if chronyd is misconfigured
to write a log in a world-writable directory (e.g. /tmp). That is not
meant to become a recommended practice. Log messages will be lost, or
chronyd won't start, if a symlink exists at the location of the log
file.
util.c