]> git.ipfire.org Git - thirdparty/systemd.git/commit
fs-util: rewrite chmod_and_chown()
authorLennart Poettering <lennart@poettering.net>
Mon, 29 Apr 2019 18:15:06 +0000 (20:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 May 2019 13:07:55 +0000 (15:07 +0200)
commit2dbb7e94af4f9366db2f1d5c4ca37d84f4df8d96
tree48a6bd188a10dae1d26ed6db897e603468f30d60
parent2570578d908a8e010828fa1f88826b1c45d534ff
fs-util: rewrite chmod_and_chown()

Inspired by #12431 let's also rework chmod_and_chown() and make sure we
never add more rights to a file not owned by the right user.

Also, let's make chmod_and_chown() just a wrapper arond
fchmod_and_chown().

let's also change strategy: instead of chown()ing first and stating
after on failure and supressing errors, let's avoid the chown in the
firts place, in the interest on keeping things minimal.
src/basic/fs-util.c