]> git.ipfire.org Git - thirdparty/lldpd.git/commit
coverity: fix TOCTOU problem when creating chroot
authorVincent Bernat <bernat@luffy.cx>
Fri, 22 Nov 2013 22:03:51 +0000 (23:03 +0100)
committerVincent Bernat <bernat@luffy.cx>
Fri, 22 Nov 2013 22:03:51 +0000 (23:03 +0100)
commitb7e2b07c1eb6e32ca2f2aa95bb60250fa90c80c5
tree5c87493ac0922d667e8c742c7483851dd1ecd3b6
parent0059e4786dc81e3caac46c451a417753e127da8a
coverity: fix TOCTOU problem when creating chroot

It is believed that checking for existence of a directory or a file
before an action is useless since it could be created after the check
and before the action. Therefore, it is better to just try to do the
action and handle any failure gracefully.

When setting up the chroot, instead of checking if it already exists, we
create it and don't display an error if it is already set up.
src/daemon/priv.c