]> git.ipfire.org Git - thirdparty/systemd.git/commit
fs-util: add new CHASE_SAFE flag to chase_symlinks()
authorLennart Poettering <lennart@poettering.net>
Thu, 4 Jan 2018 18:44:27 +0000 (19:44 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Jan 2018 14:12:16 +0000 (15:12 +0100)
commitf14f1806e329fe92d01f15c22a384702f0cb4ae0
tree0391f83cc44c93997fe80f3ec5c5f552519e62f8
parent6b21ad33ab2989bb94283b1b2a6656a08b26da62
fs-util: add new CHASE_SAFE flag to chase_symlinks()

When the flag is specified we won't transition to a privilege-owned
file or directory from an unprivileged-owned one. This is useful when
privileged code wants to load data from a file unprivileged users have
write access to, and validates the ownership, but want's to make sure
that no symlink games are played to read a root-owned system file
belonging to a different context.
src/basic/fs-util.c
src/basic/fs-util.h
src/test/test-fs-util.c