]> granicus.if.org Git - sudo/commit
On systems that lack the O_NOFOLLOW open(2) flag, check in
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 25 Jul 2016 16:26:54 +0000 (10:26 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 25 Jul 2016 16:26:54 +0000 (10:26 -0600)
commitbf82b3f2ba37e3c8d02abb10cdf02727c94d188a
tree31f4d1267945aa3aa500cc26069c3a4b05022f4e
parent26635751180689744cb90010d0922774e486f119
On systems that lack the O_NOFOLLOW open(2) flag, check in
sudo_edit_open() whether the path to be opened is symlink before
opening it.  This is racey but we detect losing the last post-open
and it is better to fail early if possible.  When editing a link
to a non-existent file, a zero-length file will be left behind but
it is too dangerous to try and remove it after the fact.
Bug #753
src/sudo_edit.c