Added ACL post.
authorW. Trevor King <wking@drexel.edu>
Sat, 11 Dec 2010 22:54:43 +0000 (17:54 -0500)
committerW. Trevor King <wking@drexel.edu>
Sat, 11 Dec 2010 22:54:43 +0000 (17:54 -0500)
posts/ACL.mdwn [new file with mode: 0644]

diff --git a/posts/ACL.mdwn b/posts/ACL.mdwn
new file mode 100644 (file)
index 0000000..a2d86a7
--- /dev/null
@@ -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]]