Bug 1436

Summary: scp -p does not preserve sticky bit (01000)
Product: Portable OpenSSH Reporter: openssh-bugzilla
Component: scpAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED WONTFIX    
Severity: normal CC: djm
Priority: P2    
Version: 4.7p1   
Hardware: All   
OS: Linux   

Description openssh-bugzilla 2008-02-04 22:02:30 AEDT
Overview:
When using scp -rp to copy a directory with sticky bit on (such as /tmp), the sticky bit is not preserved.

Reproduction:
Create a directory dir with permissions 1777. Then use
scp -rp dir user@otherhost:
The resulting directory on the otherhost will have permissions of 0777 instead of 1777. From the security point of view this may considered a serious problem.

Location of the problem:
in scp.c the FILEMODEMASK does not include the sticky bit (S_ISVTX).
Comment 1 Damien Miller 2010-11-24 11:37:25 AEDT
I don't think we will change this behaviour, as it is inherited from 27-year old rcp(1) and doing so could break all sorts of assumptions and scripts.
Comment 2 Damien Miller 2011-01-24 12:33:49 AEDT
Move resolved bugs to CLOSED after 5.7 release