Bug 3070

Summary: Using recursive put always copies permissions
Product: Portable OpenSSH Reporter: Marijn Meijles <marijn>
Component: sftpAssignee: Assigned to nobody <unassigned-bugs>
Status: NEW ---    
Severity: normal CC: djm
Priority: P5    
Version: -current   
Hardware: All   
OS: All   

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.