upload does not honor :mode or :permissions
Reported by Jay Reitz | May 8th, 2008 @ 11:45 AM
Upload does not honor the :mode option (deprecated but still allegedly supported) nor the :permissions option. No matter what mode is set the files are placed as 0644.
This is the case with both the sftp and scp strategies. Destination and source machines are debian etch with the standard open-ssh package installed.
upload("/tmp/test-file", "/tmp/test-file", :mode => 0600)
This is a regression from net-sftp-1.1.4 and capistrano-2.2.0.
Comments and changes to this ticket
-
Jamis Buck May 29th, 2008 @ 03:29 PM
- → State changed from new to resolved
I just committed a fix for this, in http://github.com/jamis/capistra.... Basically, if :mode exists, run("chmod") happens immediately after the upload to set the mode.
Eventually, it would be nice to patch net-sftp and net-scp to correctly handle this case, but it was trickier than you would expect and I didn't have the time to spend on it.
-
Jay Reitz May 29th, 2008 @ 06:55 PM
Thanks Jamis, that's a good and pragmatic workaround for the issue. I tried digging into where mode was going wrong but I got a bit confused myself.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
