We open for writing a known location, which is exploitable with a symlink
attack. Now, use the EXCLusive flag, so that the presence of anything at
that location causes a failure. Try once to open safely, and if failure
then remove that location and try again to open safely. If both fail, then
raise an error.
client/mysql_upgrade.c:
Open the file with the O_EXCL flag, so that a symlink attack would not work.
If opening it fails, try removing something at that location, and try again.
If the second time fails, then abort as previous.
on Windows.
Code added to look for different names on Windows
client/mysql_upgrade.c:
added conditionally-compiled part to look for different names of tools
on Windows
BitKeeper/etc/ignore:
Added client/mysql_upgrade to the ignore list
client/mysql_upgrade.c:
fixed for Win build
include/config-win.h:
fixed for Win build