Bug 983639 - R-Studio generated files are not accessible to samba because of default label they get stuck with
R-Studio generated files are not accessible to samba because of default label...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.3
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-11 11:22 EDT by lejeczek
Modified: 2013-11-21 05:45 EST (History)
3 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-210.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 05:45:35 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description lejeczek 2013-07-11 11:22:56 EDT
Description of problem:

R-Studio (server through local httpd proxy - one standard option to run R-Studio server) creates files in user's home directory and these newly created files are labeled:
system_u:object_r:user_home_dir_t:s0

one thing that I know of which has problems with it is samba, clients don't get to see these files

now if user runs R from ssh-bash sessions files are labeled:
unconfined_u:object_r:user_home_t:s0

I yum-updated several packages in one go thus cannot pinpoint where but I believe something must have changed as we had not had this problem before

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

selinux-policy-3.7.19-195.el6_4.12.noarch
selinux-policy-targeted-3.7.19-195.el6_4.12.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

would there be a quick-permanent fix? restorecon fixes it but temporarily, naturally.
Comment 1 lejeczek 2013-07-11 11:26:07 EDT
running process gets labeled:

LABEL                           UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
system_u:system_r:initrc_t:s0   pe243    61205  4292  7 959577 66084  1 16:23 ?        00:00:02 /usr/lib/rstudio-server/bin/rsession -u me
Comment 2 lejeczek 2013-07-11 11:29:25 EDT
but when manually 

service rstudio-server restart

then

LABEL                           UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pe243 61533 61448 10 959572 68196 1 16:27 ? 00:00:02 /usr/lib/rstudio-server/bin/rsession -u pe243
Comment 4 Daniel Walsh 2013-07-16 13:50:35 EDT
Can you set this up to create files in a subdir of the homedir and set the label correctly.

Miroslav we probably need to make sure initrc_t creating content in user_home_dir_t transitions to user_home_t.
Comment 5 lejeczek 2013-07-17 10:56:02 EDT
it seems like when rstudio-server gets started by init it's users sessions/process run with
system_u:system_r:initrc_t:s0
this results in
system_u:object_r:user_home_dir_t:s0

whereas if re/started manually these sessions/processes run as
unconfined_u:unconfined_r:unconfined
which results in
unconfined_u:object_r:user_home_t:s0

this unconfined_u makes the difference, at least to samba, with system_u samba does not see the files

should I try to get the authors of RStudio involved?
Comment 6 Miroslav Grepl 2013-07-22 09:24:01 EDT
(In reply to Daniel Walsh from comment #4)
> Can you set this up to create files in a subdir of the homedir and set the
> label correctly.
> 
> Miroslav we probably need to make sure initrc_t creating content in
> user_home_dir_t transitions to user_home_t.

Yes, we will need to add

#Make sure that home content is created with user_home_t
userdom_user_home_dir_filetrans_pattern(initrc_t, { dir file lnk_file }
Comment 10 errata-xmlrpc 2013-11-21 05:45:35 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1598.html

Note You need to log in before you can comment on or make changes to this bug.