]> git.ipfire.org Git - thirdparty/systemd.git/commit
basic/rm-rf: allow a symlink to / to be removed 6140/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 17 Jun 2017 16:41:08 +0000 (12:41 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 17 Jun 2017 16:41:08 +0000 (12:41 -0400)
commit7cb53855dcc503c97f5fa9c0487946b5daeec183
tree1175fccafa2011128eb0a9b9cd7dd3bb17d380e4
parente3f791a2b35b98cddf1f140ee5c80e5403d89afd
basic/rm-rf: allow a symlink to / to be removed

We open the target path with O_DIRECTORY|O_NOFOLLOW, and if that doesn't work,
we call unlink() on the path. In neither case we will follow the symlink, so
we can relax our check to also not follow symlinks.

Fixes #5864.
src/basic/rm-rf.c