Bug: chmod should be called only if the tmp dir was created in the first place
Merge pull request #5723 from jeromew/ssh_chmod_bug

Bug: chmod should be called only if the tmp dir was created in the first...