Since Capistrano > 1.3, file permissions have been forced to g+w. I've found that shared hosts don't like this; they often have suexec setup to trap FastCGI/CGIs that are more than 755 (as a security precaution, to prevent users from writing/running scripts in other users' directories in the shared environment.)
The patch moves the permission forcing to a separate task; in this way, this task can be overridden where necessary (without re-writing all of update_code). For example:
desc "Override standard set_permissions for shared hosts"
task :set_permissions do
donothing = true
end