From b3460f3f549d4368ce2823cdc8111987d4d915f1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Feb 2016 20:13:34 +0100 Subject: [PATCH 1/5] configure.ac, unix/Daemon: check for initgroups() at configure time The initgroups() manpage says we need to check for _BSD_SOURCE. The thing is that glibc deprecated this macro, and doesn't define it anymore, effectively breaking all MPD supplementary groups. The real fix is to check for initgroups() availability at configure time, instead of relying on the deprecated _BSD_SOURCE macro. --- NEWS | 1 + configure.ac | 1 + src/unix/Daemon.cxx | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index c1cd6cb25..bca7dc259 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.19.13 (not yet released) - aiff, riff: fix ID3 chunk padding * decoder - ffmpeg: support the TAK codec +* initialize supplementary groups with glibc 2.19+ ver 0.19.12 (2015/12/15) * fix assertion failure on malformed UTF-8 tag diff --git a/configure.ac b/configure.ac index 10e77ca79..39f2aaf0c 100644 --- a/configure.ac +++ b/configure.ac @@ -206,6 +206,7 @@ if test x$host_is_linux = xyes; then fi AC_CHECK_FUNCS(getpwnam_r getpwuid_r) +AC_CHECK_FUNCS(initgroups) AC_CHECK_FUNCS(strndup) if test x$host_is_linux = xyes; then diff --git a/src/unix/Daemon.cxx b/src/unix/Daemon.cxx index d283108ed..67704a9a1 100644 --- a/src/unix/Daemon.cxx +++ b/src/unix/Daemon.cxx @@ -110,7 +110,7 @@ daemonize_set_user(void) (int)user_gid); } -#ifdef _BSD_SOURCE +#ifdef HAVE_INITGROUPS /* init supplementary groups * (must be done before we change our uid) */ From f3cefaf043562b85c79a493d8af70e852d9e694f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Feb 2016 20:57:56 +0100 Subject: [PATCH 2/5] tag/Tag: move code to MoveItemsFrom() --- src/tag/Tag.hxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx index f1d3d5767..8f0856bc3 100644 --- a/src/tag/Tag.hxx +++ b/src/tag/Tag.hxx @@ -80,9 +80,17 @@ struct Tag { Tag &operator=(Tag &&other) { duration = other.duration; has_playlist = other.has_playlist; + MoveItemsFrom(std::move(other)); + return *this; + } + + /** + * Similar to the move operator, but move only the #TagItem + * array. + */ + void MoveItemsFrom(Tag &&other) { std::swap(items, other.items); std::swap(num_items, other.num_items); - return *this; } /** From e1d7a5cbf51a1a7f54a9a36c736bcf52e6947579 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Feb 2016 20:59:23 +0100 Subject: [PATCH 3/5] DetachedSong: add method MoveTagItemsFrom() --- src/DetachedSong.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/DetachedSong.hxx b/src/DetachedSong.hxx index 021b5de29..0d1393fbf 100644 --- a/src/DetachedSong.hxx +++ b/src/DetachedSong.hxx @@ -188,6 +188,14 @@ public: tag = std::move(other.tag); } + /** + * Similar to the MoveTagFrom(), but move only the #TagItem + * array. + */ + void MoveTagItemsFrom(DetachedSong &&other) { + tag.MoveItemsFrom(std::move(other.tag)); + } + time_t GetLastModified() const { return mtime; } From 39fa949345feed0a9e1d4f63035eea0e9bad8c9b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Feb 2016 21:01:55 +0100 Subject: [PATCH 4/5] queue/Playlist: move only the tag items in TagModified() Fixes disappearing duration of remote songs during playback. See http://bugs.musicpd.org/view.php?id=4492 --- NEWS | 1 + src/queue/Playlist.cxx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index bca7dc259..5d77dee00 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.19.13 (not yet released) - aiff, riff: fix ID3 chunk padding * decoder - ffmpeg: support the TAK codec +* fix disappearing duration of remote songs during playback * initialize supplementary groups with glibc 2.19+ ver 0.19.12 (2015/12/15) diff --git a/src/queue/Playlist.cxx b/src/queue/Playlist.cxx index b2fd673b4..a9e8f5209 100644 --- a/src/queue/Playlist.cxx +++ b/src/queue/Playlist.cxx @@ -37,7 +37,7 @@ playlist::TagModified(DetachedSong &&song) DetachedSong ¤t_song = queue.GetOrder(current); if (song.IsSame(current_song)) - current_song.MoveTagFrom(std::move(song)); + current_song.MoveTagItemsFrom(std::move(song)); queue.ModifyAtOrder(current); queue.IncrementVersion(); From 79f2f8cddce56cf986d3914bb46a790486457a64 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 23 Feb 2016 22:06:13 +0100 Subject: [PATCH 5/5] release v0.19.13 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5d77dee00..96d8ec8bd 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.19.13 (not yet released) +ver 0.19.13 (2016/02/23) * tags - aiff, riff: fix ID3 chunk padding * decoder