Bug 1436 - scp -p does not preserve sticky bit (01000)
Summary: scp -p does not preserve sticky bit (01000)
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: 4.7p1
Hardware: All Linux
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-04 22:02 AEDT by openssh-bugzilla
Modified: 2011-01-24 12:33 AEDT (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 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