Ask Your Question

MPD and selinux

asked 2014-09-24 04:19:29 -0500

vodolaz095 gravatar image

updated 2014-09-30 15:07:59 -0500

mether gravatar image

I have Fedora 20 linux with Music Player Daemon 0.18.11 installed. THis player works ok when selinux is disabled. But when selinux is enabled, i get this in /var/log/mpd

# tail /var/log/mpd/mpd.log
Sep 24 13:07 : errno: Failed to open "/home/shared/music/Sveta/Soundtrack/Flowers.mp3": Permission denied

I have music files in /home/shared/music directory. I think it have the wrong security context for it.

I viewed the security context for mpd home directory

[root@steel mpd]# ls -Z /var/lib/mpd/
-rw-r--r--. mpd mpd system_u:object_r:mpd_var_lib_t:s0 mpd.db
-rw-r--r--. mpd mpd system_u:object_r:mpd_var_lib_t:s0 mpdstate
drwxr-xr-x. mpd mpd system_u:object_r:mpd_data_t:s0  music
drwxr-xr-x. mpd mpd system_u:object_r:mpd_data_t:s0  playlists

I tried to set the context of mpd_data_t to /home/shared/music:

[root@steel mpd]# chcon /home/shared/music/ -t mpd_data_t -R

And after reboot i have the same result - mpd is unable to access the music files in directory with selinux enabled, and able, when selinux is disabled

edit retag flag offensive close merge delete


UPD: the access rights are set properly by chmod and chown

vodolaz095 gravatar imagevodolaz095 ( 2014-09-24 04:49:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-09-24 09:12:31 -0500

vodolaz095 gravatar image

updated 2014-09-24 09:13:56 -0500

it turned out that i have to set boolean variable

[root@steel]# setsebool -P mpd_enable_homedirs true

I hope my research will help anybody

edit flag offensive delete link more


Thank you!

Difrex gravatar imageDifrex ( 2014-10-14 06:33:14 -0500 )edit

Question Tools


Asked: 2014-09-24 04:19:29 -0500

Seen: 1,312 times

Last updated: Oct 14 '14