Bug 688383

Summary: SELinux is preventing /usr/bin/nautilus from 'write' accesses on the directory backups.
Product: [Fedora] Fedora Reporter: Joachim Katzer <jokatzer>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:82947b2d403d4d8d3b70a1b21e7777880ef92bd7f8e9d46243a66c89f39f752a
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-17 13:55:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Joachim Katzer 2011-03-16 22:34:52 UTC
SELinux is preventing /usr/bin/nautilus from 'write' accesses on the directory backups.

I have written a policy module "moneyplex" that prevents a confined user (staff_u, user_u) from writing to certain directories and files in home directory. Why does Nautilus tries to open a directory in write or read/write mode when it just list its contents? 


*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that nautilus should be allowed write access on the backups directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep nautilus /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                staff_u:staff_r:staff_t:s0
Target Context                system_u:object_r:moneyplex_rw_t:s0
Target Objects                backups [ dir ]
Source                        nautilus
Source Path                   /usr/bin/nautilus
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           nautilus-2.32.2.1-2.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-31.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.11-83.fc14.i686 #1 SMP Mon
                              Feb 7 07:04:18 UTC 2011 i686 i686
Alert Count                   1
First Seen                    Mi 16 Mär 2011 23:25:59 CET
Last Seen                     Mi 16 Mär 2011 23:25:59 CET
Local ID                      2a6434aa-2c46-42af-9582-ecd86bf65eb9

Raw Audit Messages
type=AVC msg=audit(1300314359.251:30760): avc:  denied  { write } for  pid=7505 comm="nautilus" name="backups" dev=dm-4 ino=14 scontext=staff_u:staff_r:staff_t:s0 tcontext=system_u:object_r:moneyplex_rw_t:s0 tclass=dir


type=SYSCALL msg=audit(1300314359.251:30760): arch=i386 syscall=access success=no exit=EACCES a0=97e6d00 a1=2 a2=a0f27c a3=0 items=0 ppid=6972 pid=7505 auid=502 uid=502 gid=502 euid=502 suid=502 fsuid=502 egid=502 sgid=502 fsgid=502 tty=(none) ses=8 comm=nautilus exe=/usr/bin/nautilus subj=staff_u:staff_r:staff_t:s0 key=(null)

Hash: nautilus,staff_t,moneyplex_rw_t,dir,write

audit2allow

#============= staff_t ==============
#!!!! The source type 'staff_t' can write to a 'dir' of the following types:
# nfsd_rw_t, xdm_tmp_t, gpg_pinentry_tmp_t, screen_var_run_t, httpd_user_content_t, sandbox_file_type, tmp_t, user_home_dir_t, sandbox_file_type, httpd_user_script_exec_t, mail_spool_t, user_tmpfs_t, tmpfs_t, mqueue_spool_t, gpg_agent_tmp_t, user_tmp_t, user_fonts_t, httpd_user_ra_content_t, httpd_user_rw_content_t, user_fonts_config_t, user_fonts_cache_t, ssh_home_t, user_tmp_t, user_home_type, screen_home_t, noxattrfs, dosfs_t

allow staff_t moneyplex_rw_t:dir write;

audit2allow -R

#============= staff_t ==============
#!!!! The source type 'staff_t' can write to a 'dir' of the following types:
# nfsd_rw_t, xdm_tmp_t, gpg_pinentry_tmp_t, screen_var_run_t, httpd_user_content_t, sandbox_file_type, tmp_t, user_home_dir_t, sandbox_file_type, httpd_user_script_exec_t, mail_spool_t, user_tmpfs_t, tmpfs_t, mqueue_spool_t, gpg_agent_tmp_t, user_tmp_t, user_fonts_t, httpd_user_ra_content_t, httpd_user_rw_content_t, user_fonts_config_t, user_fonts_cache_t, ssh_home_t, user_tmp_t, user_home_type, screen_home_t, noxattrfs, dosfs_t

allow staff_t moneyplex_rw_t:dir write;

Comment 1 Daniel Walsh 2011-03-17 13:55:28 UTC
It doesn't it is just checking for write access.

dontaudit unpriv_userdomain moneyplex_rw_t:dir_file_class_set audit_access;