← Back to team overview

touch-packages team mailing list archive

[Bug 1374386] Re: sftp client stores files and directories with wrong permissions received by the server and lets download fail

 

** Description changed:

  Ubuntu: 14.04 LTS
  The problem occurs always, but only with remote site reporting wrong/broken file permissions:
  
- sftp downloads files with those wrong permissions. The download succeeds, but to access the file, you have to chmod them.
- Recursive downloads fail reproducibly.
- A workaround for a manual download could be to chmod the directories and try the command again, then chmod the downloaded tree again, try the download again, ... , until the download was successful.
+ sftp downloads files with those wrong permissions. The download succeeds for a single file or directory, but to access the local file/directory, you have to chmod it locally.
+ Recursive downloads fail reproducibly, because the local directory lacks permission to add the remote files to be downloaded into it.
+ 
+ A network resource wasting workaround for a manual download of a
+ directory could be to chmod +rwX the local directories after a failed
+ download and try the download command again, then chmod the local
+ download tree again, try the download again, ... , until the download
+ was finally successful.
  
  The remote site reports wrong permissions (no permission at all) for each directory and file.
  sftp takes these permissions for the download, even when it is not told to do so via option.
  As a result the downloaded directories have no write permissions and downloading the contained files fails.
  
  sftp> ls -l
  d---------   32 0        0            8192 Sep 25 18:45 download
  sftp>
  
  sftp> get -r download/
  Fetching /home/test/download/ to download
  Retrieving /home/test/download
  Retrieving /home/test/download/20140821
  mkdir download/20140821: Permission denied
  Retrieving /home/test/download/20140826
  mkdir download/20140826: Permission denied
  Retrieving /home/test/download/20140828
  mkdir download/20140828: Permission denied
  Retrieving /home/test/download/20140902
  mkdir download/20140902: Permission denied
  Retrieving /home/test/download/20140903
  mkdir download/20140903: Permission denied
  Retrieving /home/test/download/20140904
  mkdir download/20140904: Permission denied
  Retrieving /home/test/download/20140909
  mkdir download/20140909: Permission denied
  Retrieving /home/test/download/20140910
  mkdir download/20140910: Permission denied
  Retrieving /home/test/download/20140911
  mkdir download/20140911: Permission denied
  Retrieving /home/test/download/20140916
  mkdir download/20140916: Permission denied
  Retrieving /home/test/download/20140917
  mkdir download/20140917: Permission denied
  Retrieving /home/test/download/20140918
  mkdir download/20140918: Permission denied
  Retrieving /home/test/download/20140923
  mkdir download/20140923: Permission denied
  Retrieving /home/test/download/20140925
  mkdir download/20140925: Permission denied
  Retrieving /home/test/download/20140717
  mkdir download/20140717: Permission denied
  Retrieving /home/test/download/20140722
  mkdir download/20140722: Permission denied
  Retrieving /home/test/download/20140723
  mkdir download/20140723: Permission denied
  Retrieving /home/test/download/20140729
  mkdir download/20140729: Permission denied
  Retrieving /home/test/download/20140730
  mkdir download/20140730: Permission denied
  Retrieving /home/test/download/20140731
  mkdir download/20140731: Permission denied
  Retrieving /home/test/download/20140806
  mkdir download/20140806: Permission denied
  Retrieving /home/test/download/20140807
  mkdir download/20140807: Permission denied
  Retrieving /home/test/download/20140812
  mkdir download/20140812: Permission denied
  Retrieving /home/test/download/20140814
  mkdir download/20140814: Permission denied
  Retrieving /home/test/download/20140819
  mkdir download/20140819: Permission denied
  Retrieving /home/test/download/20140820
  mkdir download/20140820: Permission denied
  Retrieving /home/test/download/20140827
  mkdir download/20140827: Permission denied
  Retrieving /home/test/download/20140924
  mkdir download/20140924: Permission denied
  Retrieving /home/test/download/20140929
  mkdir download/20140929: Permission denied
  Retrieving /home/test/download/20140724
  mkdir download/20140724: Permission denied
  sftp>
  
  The directory has been created, but with empty permissions, thus
  downloading the content fails, because the local files/directories could
  not be created.
  
  mm@janus:~/download/download-test/test $ ll
  total 4
  d--------- 2 mm mm 4096 Jul 25 13:41 download
  mm@janus:~/download/download-test/test $
  
  Expected behaviour:
  sftp should use local umask or given umask for creating files and directories.
  Only when it has been told to by option, it should set the remote permissions of directories and files, but only after their content has been downloaded, so that local files and directories can be created for download, even when the remote directory does not have write permission enabled.
  Thus it could even download and reproduce a directory tree without write permissions.

** Description changed:

  Ubuntu: 14.04 LTS
  The problem occurs always, but only with remote site reporting wrong/broken file permissions:
  
  sftp downloads files with those wrong permissions. The download succeeds for a single file or directory, but to access the local file/directory, you have to chmod it locally.
- Recursive downloads fail reproducibly, because the local directory lacks permission to add the remote files to be downloaded into it.
+ Recursive downloads fail reproducibly, because the local directory created by sftp during the download lacks permission to add the remote files to be downloaded into it.
+ If the local directory already exists with the right permissions, the permissions are unchanged by sftp and the remote files and directories can be created and downloaded into it, but both with the wrong permissions.
  
  A network resource wasting workaround for a manual download of a
  directory could be to chmod +rwX the local directories after a failed
  download and try the download command again, then chmod the local
  download tree again, try the download again, ... , until the download
  was finally successful.
  
  The remote site reports wrong permissions (no permission at all) for each directory and file.
  sftp takes these permissions for the download, even when it is not told to do so via option.
  As a result the downloaded directories have no write permissions and downloading the contained files fails.
  
  sftp> ls -l
  d---------   32 0        0            8192 Sep 25 18:45 download
  sftp>
  
  sftp> get -r download/
  Fetching /home/test/download/ to download
  Retrieving /home/test/download
  Retrieving /home/test/download/20140821
  mkdir download/20140821: Permission denied
  Retrieving /home/test/download/20140826
  mkdir download/20140826: Permission denied
  Retrieving /home/test/download/20140828
  mkdir download/20140828: Permission denied
  Retrieving /home/test/download/20140902
  mkdir download/20140902: Permission denied
  Retrieving /home/test/download/20140903
  mkdir download/20140903: Permission denied
  Retrieving /home/test/download/20140904
  mkdir download/20140904: Permission denied
  Retrieving /home/test/download/20140909
  mkdir download/20140909: Permission denied
  Retrieving /home/test/download/20140910
  mkdir download/20140910: Permission denied
  Retrieving /home/test/download/20140911
  mkdir download/20140911: Permission denied
  Retrieving /home/test/download/20140916
  mkdir download/20140916: Permission denied
  Retrieving /home/test/download/20140917
  mkdir download/20140917: Permission denied
  Retrieving /home/test/download/20140918
  mkdir download/20140918: Permission denied
  Retrieving /home/test/download/20140923
  mkdir download/20140923: Permission denied
  Retrieving /home/test/download/20140925
  mkdir download/20140925: Permission denied
  Retrieving /home/test/download/20140717
  mkdir download/20140717: Permission denied
  Retrieving /home/test/download/20140722
  mkdir download/20140722: Permission denied
  Retrieving /home/test/download/20140723
  mkdir download/20140723: Permission denied
  Retrieving /home/test/download/20140729
  mkdir download/20140729: Permission denied
  Retrieving /home/test/download/20140730
  mkdir download/20140730: Permission denied
  Retrieving /home/test/download/20140731
  mkdir download/20140731: Permission denied
  Retrieving /home/test/download/20140806
  mkdir download/20140806: Permission denied
  Retrieving /home/test/download/20140807
  mkdir download/20140807: Permission denied
  Retrieving /home/test/download/20140812
  mkdir download/20140812: Permission denied
  Retrieving /home/test/download/20140814
  mkdir download/20140814: Permission denied
  Retrieving /home/test/download/20140819
  mkdir download/20140819: Permission denied
  Retrieving /home/test/download/20140820
  mkdir download/20140820: Permission denied
  Retrieving /home/test/download/20140827
  mkdir download/20140827: Permission denied
  Retrieving /home/test/download/20140924
  mkdir download/20140924: Permission denied
  Retrieving /home/test/download/20140929
  mkdir download/20140929: Permission denied
  Retrieving /home/test/download/20140724
  mkdir download/20140724: Permission denied
  sftp>
  
  The directory has been created, but with empty permissions, thus
  downloading the content fails, because the local files/directories could
  not be created.
  
  mm@janus:~/download/download-test/test $ ll
  total 4
  d--------- 2 mm mm 4096 Jul 25 13:41 download
  mm@janus:~/download/download-test/test $
  
  Expected behaviour:
  sftp should use local umask or given umask for creating files and directories.
  Only when it has been told to by option, it should set the remote permissions of directories and files, but only after their content has been downloaded, so that local files and directories can be created for download, even when the remote directory does not have write permission enabled.
  Thus it could even download and reproduce a directory tree without write permissions.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to openssh in Ubuntu.
https://bugs.launchpad.net/bugs/1374386

Title:
  sftp client stores files and directories with wrong permissions
  received by the server and lets download fail

Status in “openssh” package in Ubuntu:
  Confirmed

Bug description:
  Ubuntu: 14.04 LTS
  The problem occurs always, but only with remote site reporting wrong/broken file permissions:

  sftp downloads files with those wrong permissions. The download succeeds for a single file or directory, but to access the local file/directory, you have to chmod it locally.
  Recursive downloads fail reproducibly, because the local directory created by sftp during the download lacks permission to add the remote files to be downloaded into it.
  If the local directory already exists with the right permissions, the permissions are unchanged by sftp and the remote files and directories can be created and downloaded into it, but both with the wrong permissions.

  A network resource wasting workaround for a manual download of a
  directory could be to chmod +rwX the local directories after a failed
  download and try the download command again, then chmod the local
  download tree again, try the download again, ... , until the download
  was finally successful.

  The remote site reports wrong permissions (no permission at all) for each directory and file.
  sftp takes these permissions for the download, even when it is not told to do so via option.
  As a result the downloaded directories have no write permissions and downloading the contained files fails.

  sftp> ls -l
  d---------   32 0        0            8192 Sep 25 18:45 download
  sftp>

  sftp> get -r download/
  Fetching /home/test/download/ to download
  Retrieving /home/test/download
  Retrieving /home/test/download/20140821
  mkdir download/20140821: Permission denied
  Retrieving /home/test/download/20140826
  mkdir download/20140826: Permission denied
  Retrieving /home/test/download/20140828
  mkdir download/20140828: Permission denied
  Retrieving /home/test/download/20140902
  mkdir download/20140902: Permission denied
  Retrieving /home/test/download/20140903
  mkdir download/20140903: Permission denied
  Retrieving /home/test/download/20140904
  mkdir download/20140904: Permission denied
  Retrieving /home/test/download/20140909
  mkdir download/20140909: Permission denied
  Retrieving /home/test/download/20140910
  mkdir download/20140910: Permission denied
  Retrieving /home/test/download/20140911
  mkdir download/20140911: Permission denied
  Retrieving /home/test/download/20140916
  mkdir download/20140916: Permission denied
  Retrieving /home/test/download/20140917
  mkdir download/20140917: Permission denied
  Retrieving /home/test/download/20140918
  mkdir download/20140918: Permission denied
  Retrieving /home/test/download/20140923
  mkdir download/20140923: Permission denied
  Retrieving /home/test/download/20140925
  mkdir download/20140925: Permission denied
  Retrieving /home/test/download/20140717
  mkdir download/20140717: Permission denied
  Retrieving /home/test/download/20140722
  mkdir download/20140722: Permission denied
  Retrieving /home/test/download/20140723
  mkdir download/20140723: Permission denied
  Retrieving /home/test/download/20140729
  mkdir download/20140729: Permission denied
  Retrieving /home/test/download/20140730
  mkdir download/20140730: Permission denied
  Retrieving /home/test/download/20140731
  mkdir download/20140731: Permission denied
  Retrieving /home/test/download/20140806
  mkdir download/20140806: Permission denied
  Retrieving /home/test/download/20140807
  mkdir download/20140807: Permission denied
  Retrieving /home/test/download/20140812
  mkdir download/20140812: Permission denied
  Retrieving /home/test/download/20140814
  mkdir download/20140814: Permission denied
  Retrieving /home/test/download/20140819
  mkdir download/20140819: Permission denied
  Retrieving /home/test/download/20140820
  mkdir download/20140820: Permission denied
  Retrieving /home/test/download/20140827
  mkdir download/20140827: Permission denied
  Retrieving /home/test/download/20140924
  mkdir download/20140924: Permission denied
  Retrieving /home/test/download/20140929
  mkdir download/20140929: Permission denied
  Retrieving /home/test/download/20140724
  mkdir download/20140724: Permission denied
  sftp>

  The directory has been created, but with empty permissions, thus
  downloading the content fails, because the local files/directories
  could not be created.

  mm@janus:~/download/download-test/test $ ll
  total 4
  d--------- 2 mm mm 4096 Jul 25 13:41 download
  mm@janus:~/download/download-test/test $

  Expected behaviour:
  sftp should use local umask or given umask for creating files and directories.
  Only when it has been told to by option, it should set the remote permissions of directories and files, but only after their content has been downloaded, so that local files and directories can be created for download, even when the remote directory does not have write permission enabled.
  Thus it could even download and reproduce a directory tree without write permissions.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1374386/+subscriptions


References