From: W. Trevor King Date: Sat, 11 Dec 2010 22:54:43 +0000 (-0500) Subject: Added ACL post. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4120bcc12e61f9060f3f92f703161f24933c172b;p=mw2txt.git Added ACL post. --- diff --git a/posts/ACL.mdwn b/posts/ACL.mdwn new file mode 100644 index 0000000..a2d86a7 --- /dev/null +++ b/posts/ACL.mdwn @@ -0,0 +1,43 @@ +[[!meta title="Access Control Lists"]] + +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][ACL] ([nice +howto][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 + +[ACL]: http://en.wikipedia.org/wiki/Access_control_list +[howto]: http://wiki.kaspersandberg.com/doku.php?id=howtos:acl + +[[!tag tags/linux]]