Bug 782078

Summary: Please backport sftp+chroot+SELinux changes for Rawihde/RHEL6 to Fedora16
Product: [Fedora] Fedora Reporter: Miroslav Grepl <mgrepl>
Component: opensshAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: mattias.ellert, mgrepl, plautrba, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openssh-5.8p2-24.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-08 17:55:58 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Miroslav Grepl 2012-01-16 08:22:30 EST
Description of problem:

In a chrooted sftp environment, SELinux is preventing users from uploading new files to their home directories.

sftp/chroot option either runs in the old sftpd_t domain or in the sshd_t domain which is not correct.


Version-Release number of selected component (if applicable):


How reproducible:

https://bugzilla.redhat.com/show_bug.cgi?id=729648

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Petr Lautrbach 2012-02-02 11:24:10 EST
With removed openssh-5.8p1-sftpcontext.patch and with added openssh-5.8p2-sftp-chroot.patch (similar to openssh-5.9p1-sftp-chroot.patch from Rawhide) I get this behaviour:

1.
ChrootDirectory none
Subsystem       sftp internal-sftp

system_u:system_r:sshd_t:s0-s0:c0.c1023  /usr/sbin/sshd -D
system_u:system_r:sshd_t:s0-s0:c0.c1023   \_ sshd: staff [priv]
system_u:system_r:sshd_t:s0-s0:c0.c1023       \_ sshd: staff@notty
staff_u:staff_r:staff_t:s0                      \_ sshd: staff@internal-sftp

2.
ChrootDirectory none
Subsystem       sftp    /usr/libexec/openssh/sftp-server

system_u:system_r:sshd_t:s0-s0:c0.c1023  /usr/sbin/sshd -D
system_u:system_r:sshd_t:s0-s0:c0.c1023   \_ sshd: staff [priv]
system_u:system_r:sshd_t:s0-s0:c0.c1023       \_ sshd: staff@notty
staff_u:staff_r:staff_t:s0                     \_ /usr/libexec/openssh/sftp-server

3. 
ChrootDirectory /chroot
Subsystem       sftp internal-sftp

system_u:system_r:sshd_t:s0-s0:c0.c1023      /usr/sbin/sshd -D
system_u:system_r:sshd_t:s0-s0:c0.c1023       \_ sshd: staff [priv]
system_u:system_r:chroot_user_t:s0-s0:c0.c1023  \_ sshd: staff@notty
system_u:system_r:chroot_user_t:s0-s0:c0.c1023    \_ sshd: staff@internal-sftp


Is this what you expect?
Comment 2 Miroslav Grepl 2012-02-02 11:28:09 EST
ad 1) yes
ad 2) yes
ad 3) yes
Comment 3 Fedora Update System 2012-02-06 16:43:30 EST
openssh-5.8p2-24.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/openssh-5.8p2-24.fc16
Comment 4 Fedora Update System 2012-02-07 02:59:01 EST
Package openssh-5.8p2-24.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openssh-5.8p2-24.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-1421/openssh-5.8p2-24.fc16
then log in and leave karma (feedback).
Comment 5 Fedora Update System 2012-02-08 17:55:58 EST
openssh-5.8p2-24.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.