Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
contrib.files.upload_template should pass along temp_dir to put #932
This patch would offer at least a partial work-around to the design problem with put() when the sudo_user is not root. I hope you will merge it soon.
The design for put() with sudo is fundamentally unsound for the general case. The problem is that the file gets transferred by sftp as the logged in user, but it's moved into its final place by the sudo_user. Unless the both the logged in user and the sudo_user have proper permissions on the temp directory and the file, the operation will fail at some point. Probably what's necessary is to perform all remote operations as root and then chown the uploaded file to the sudo_user as the last step.