NAS-128404 / 24.10 / Improve file receive
file_receive was susceptible to the TOCTOU race conditions when checking for a paths existence (or any path component) before opening said path. This should get rid of theoretical conditions and also switches to using the fchmod/fchown syscalls. I've also fixed a few flake8 issues while I'm here. There should be no functional change.
Jira URL: https://ixsystems.atlassian.net/browse/NAS-128404
I approved too quickly. Got spoofed by the latest simple update.
This PR has been merged and conversations have been locked. If you would like to discuss more about this issue please use our forums or raise a Jira ticket.