Bug 817612 - SELinux is preventing /bin/systemd-tmpfiles from 'rmdir' accesses on the directory long.
SELinux is preventing /bin/systemd-tmpfiles from 'rmdir' accesses on the dire...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2012-04-30 12:06 EDT by long
Modified: 2012-06-22 09:15 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-22 09:15:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description long 2012-04-30 12:06:26 EDT
SELinux is preventing /bin/systemd-tmpfiles from 'rmdir' accesses on the directory long.

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

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

Additional Information:
Source Context                system_u:system_r:systemd_tmpfiles_t:s0
Target Context                unconfined_u:object_r:user_home_dir_t:s0
Target Objects                long [ dir ]
Source                        systemd-tmpfile
Source Path                   /bin/systemd-tmpfiles
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-units-26-18.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-52.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) #1
                              SMP Tue Mar 20 16:30:08 UTC 2012 x86_64 x86_64
Alert Count                   1
First Seen                    Mon 30 Apr 2012 10:13:00 AM CDT
Last Seen                     Mon 30 Apr 2012 10:13:00 AM CDT
Local ID                      b3be392d-79a1-47db-9575-753544407b6f

Raw Audit Messages
type=AVC msg=audit(1335798780.495:100): avc:  denied  { rmdir } for  pid=4289 comm="systemd-tmpfile" name="long" dev=sdb3 ino=8519716 scontext=system_u:system_r:systemd_tmpfiles_t:s0 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir

type=SYSCALL msg=audit(1335798780.495:100): arch=x86_64 syscall=unlinkat success=yes exit=0 a0=5 a1=1ddf4ab a2=200 a3=200 items=0 ppid=1 pid=4289 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=systemd-tmpfile exe=/bin/systemd-tmpfiles subj=system_u:system_r:systemd_tmpfiles_t:s0 key=(null)

Hash: systemd-tmpfile,systemd_tmpfiles_t,user_home_dir_t,dir,rmdir


#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t user_home_dir_t:dir rmdir;

audit2allow -R

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t user_home_dir_t:dir rmdir;
Comment 1 Daniel Walsh 2012-05-01 14:17:10 EDT
Did you mv your homedir to /tmp?

rm -rf /tmp/long

Should clean this up. We really do not want to allow systemd-tmpfiles to delete the contents of homedirs.
Comment 2 long 2012-05-01 16:11:38 EDT
That's what I'm confused about.  There is no /tmp/long (at least now, I have no idea if there was one there or not) and I can't tell from the audit message what it was trying to delete?
Comment 3 Daniel Walsh 2012-05-02 13:58:01 EDT
Well the only way I can imagine this happening would be if you have a directory like /home/long and you mv'd it to /tmp.  Then eventually systemd-tmpfiles see it as old and attempts to remove it.

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