--- libssh2-1.4.2/src/sftp.c	2012-05-18 14:29:03.000000000 -0700
+++ libssh2-1.4.2-modified/src/sftp.c	2012-05-29 10:19:54.000000000 -0700
@@ -1051,6 +1051,12 @@
             (open_file ? LIBSSH2_SFTP_ATTR_PFILETYPE_FILE :
              LIBSSH2_SFTP_ATTR_PFILETYPE_DIR);
 
+        /* If we are only reading the file, then we do not need to
+           send permissions. */
+        if (flags == LIBSSH2_FXF_READ) {
+            attrs.flags &= ~LIBSSH2_SFTP_ATTR_PERMISSIONS;
+        }
+
         _libssh2_store_u32(&s, sftp->open_packet_len - 4);
         *(s++) = open_file? SSH_FXP_OPEN : SSH_FXP_OPENDIR;
         sftp->open_request_id = sftp->request_id++;
