On Sun, Apr 26, 2020 at 08:16:23PM +0200, Jeremie Courreges-Anglas wrote:

Moving this to ports,

That is something we discussed with chrisz@.  One concern I had was that
changing the home directory in the PLIST won't affect upgrades and more
generally machines where the _mpd is present in master.passwd.
And forcefully changing the home dir with usermod -d isn't nice to
people who have already dealt with this problem.

This is something we could document in a README, along with the special
setup needed to share sndiod access.  Diff below.

Or it _might_ be possible to workaround
by having mpd talk to sndiod over a TCP socket instead (like
https://undeadly.org/cgi?action=article;sid=20180410063454 but using
127.0.0.1 instead of an external address).

I'm afraid (not sure) that this won't address the cookie issue.


So building up on the discussion with Christopher, here's a diff that
changes _mpd's home dir to /var/spool/mpd and documents a bit what
people need to do.  Feedback and improvements welcome.

No idea if I should leave @sample /var/spool/mpd in the PLIST, portcheck
also warns about VARBASE...

(Unrelated, drop the tremor FLAVOR from DESCR while here.)

-@newuser _mpd:560:560:daemon:Music Player Daemon:/var/empty:/sbin/nologin
+@newuser _mpd:560:560:daemon:Music Player Daemon:/var/spool/mpd:/sbin/nologin

I'm afraid we'll provoke security(8) warnings about a group-writable home. Does /var/spool/mpd actually need to be group-writable? If no, @mode should be changed to 650, if yes, this would be my probosal:

Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/mpd/pkg/PLIST,v
retrieving revision 1.13
diff -u -p -r1.13 PLIST
--- pkg/PLIST   15 Aug 2019 05:44:37 -0000      1.13
+++ pkg/PLIST   26 Apr 2020 18:52:20 -0000
@@ -1,7 +1,7 @@
 @comment $OpenBSD: PLIST,v 1.13 2019/08/15 05:44:37 landry Exp $
 @pkgpath audio/mpd,tremor
 @newgroup _mpd:560
-@newuser _mpd:560:560:daemon:Music Player Daemon:/var/empty:/sbin/nologin
+@newuser _mpd:560:560:daemon:Music Player 
Daemon:/var/spool/mpd/home:/sbin/nologin
 @extraunexec rm -rf /var/log/mpd/*
 @extraunexec find /var/spool/mpd \! -name playlists -mindepth 1 -exec rm -rf 
"{}" \;
 @rcscript ${RCDIR}/mpd
@@ -22,3 +22,6 @@ share/examples/mpd/mpd.conf
 @sample /var/log/mpd/
 @sample /var/spool/mpd/
 @sample /var/spool/mpd/playlists/
+@comment Home to allow storage of an sndio cookie. See sndio(7) AUTHENTICATION.
+@mode 550
+@sample /var/spool/mpd/home


--
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
CB07 DA40 B0B6 571D 35E2  0DEF 87E2 92A7 13E5 DEE1

Reply via email to