Bug 3070 - Using recursive put always copies permissions
Summary: Using recursive put always copies permissions
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: -current
Hardware: All All
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-12 18:24 AEST by Marijn Meijles
Modified: 2020-08-07 14:30 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marijn Meijles 2019-09-12 18:24:11 AEST
The -p option of the sftp put command is supposed to copy timestamps and permissions, thereby implying that they are not copied when you leave out the -p option.

This is only partly the case when you use the recursive option. When using -r, permissions are always copied, regardless of the -p option.

Patch is located at https://patch-diff.githubusercontent.com/raw/openssh/openssh-portable/pull/145.patch
Comment 1 Damien Miller 2020-08-07 14:30:51 AEST
I think that's a bit of an overbroad hammer - IMO users generally want some permissions to be preserved, e.g. X bits.

Unfortunately, the sftp protocol doesn't have notions of umask or changing only a subset of permission bits - either the client specifies all of them or none of them.