On Gentoo, MPD runs as mpd.audio
, and it creates playlists with
644 permissions (-rw-r--r--
). However, I wanted other members of
the audio group (i.e. me), to also have read/write permissions. This
would allow me to sort/shuffle/create/etc. playlists from the command
line without going through MPD.
Browsing around, I ran across Access Control Lists (nice howto). The solution is to add a default ACL to the playlist directory:
$ setfacl -d -m g:audio:rw- playlist
$ getfacl --omit-header playlists
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:group:audio:rw-
default:mask::rwx
default:other::r-x
after which new files created in playlist will have audio
read/write
permissions:
$ getfacl --omit-header playlists/xyz.m3u
user::rw-
group::rwx #effective:rw-
group:audio:rw-
mask::rw-
other::r--
Several other utilities have special ACL handling (see acl(5)
). For
example, ls
shows the presence of an ACL with a +
:
$ ls -l playlists/xyz.m3u
-rw-rw-r--+ 1 wking wking 0 Dec 11 17:41 playlists/xyz.m3u