From 4a043a915f369cc49d40aef4c6d97f2dbab71c5f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 10 Nov 2014 17:59:06 +0100 Subject: [PATCH 01/10] configure.ac: prepare for 0.18.1 --- NEWS | 2 ++ configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 9be75c42e..ed4bbf101 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.18.18 (not yet released) + ver 0.18.17 (2014/11/02) * playlist - don't allow empty playlist name diff --git a/configure.ac b/configure.ac index 05a4f5050..ca3d9b24f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.18.17, mpd-devel@musicpd.org) +AC_INIT(mpd, 0.18.18, mpd-devel@musicpd.org) VERSION_MAJOR=0 VERSION_MINOR=18 -VERSION_REVISION=17 +VERSION_REVISION=18 VERSION_EXTRA=0 AC_CONFIG_SRCDIR([src/Main.cxx]) From c64ad78c7bfa83585775617c692367e247966330 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Nov 2014 19:22:26 +0100 Subject: [PATCH 02/10] decoder/ffmpeg: support opus --- NEWS | 2 ++ src/decoder/FfmpegDecoderPlugin.cxx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ed4bbf101..a9440b844 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.18.18 (not yet released) +* decoder + - ffmpeg: support opus ver 0.18.17 (2014/11/02) * playlist diff --git a/src/decoder/FfmpegDecoderPlugin.cxx b/src/decoder/FfmpegDecoderPlugin.cxx index 104129ad9..69e7a6c8b 100644 --- a/src/decoder/FfmpegDecoderPlugin.cxx +++ b/src/decoder/FfmpegDecoderPlugin.cxx @@ -620,7 +620,7 @@ static const char *const ffmpeg_suffixes[] = { "mj2", "mjpeg", "mjpg", "mka", "mkv", "mlp", "mm", "mmf", "mov", "mp+", "mp1", "mp2", "mp3", "mp4", "mpc", "mpeg", "mpg", "mpga", "mpp", "mpu", "mve", "mvi", "mxf", "nc", "nsv", "nut", "nuv", "oga", "ogm", "ogv", - "ogx", "oma", "ogg", "omg", "psp", "pva", "qcp", "qt", "r3d", "ra", + "ogx", "oma", "ogg", "omg", "opus", "psp", "pva", "qcp", "qt", "r3d", "ra", "ram", "rl2", "rm", "rmvb", "roq", "rpl", "rvc", "shn", "smk", "snd", "sol", "son", "spx", "str", "swf", "tgi", "tgq", "tgv", "thp", "ts", "tsp", "tta", "xa", "xvid", "uv", "uv2", "vb", "vid", "vob", "voc", @@ -654,6 +654,7 @@ static const char *const ffmpeg_mime_types[] = { "audio/mpeg", "audio/musepack", "audio/ogg", + "audio/opus", "audio/qcelp", "audio/vorbis", "audio/vorbis+ogg", From 7e7b403043b55c2e1bb9227fce725ad87626ae97 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 11 Nov 2014 17:03:29 +0100 Subject: [PATCH 03/10] Construct a Null AllocatedPath if the filename conversion into UTF8 failed --- NEWS | 1 + src/fs/AllocatedPath.cxx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a9440b844..e1c499860 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.18.18 (not yet released) * decoder - ffmpeg: support opus +* fix crash on failed filename charset conversion ver 0.18.17 (2014/11/02) * playlist diff --git a/src/fs/AllocatedPath.cxx b/src/fs/AllocatedPath.cxx index 37b79a685..4651ea625 100644 --- a/src/fs/AllocatedPath.cxx +++ b/src/fs/AllocatedPath.cxx @@ -46,7 +46,11 @@ AllocatedPath::Build(const_pointer a, const_pointer b) AllocatedPath AllocatedPath::FromUTF8(const char *path_utf8) { - return AllocatedPath(Donate(), ::PathFromUTF8(path_utf8)); + char *path = ::PathFromUTF8(path_utf8); + if (path == nullptr) + return AllocatedPath::Null(); + + return AllocatedPath(Donate(), path); } AllocatedPath From 82460aa49f94c9a0d343a0c864727ac6fee93a1b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 12 Nov 2014 15:16:07 +0100 Subject: [PATCH 04/10] configure.ac: prepare for 0.19.4 --- NEWS | 2 ++ configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index bf6bf11b6..57da4d7ae 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +ver 0.19.4 (not yet released) + ver 0.19.3 (2014/11/11) * protocol - fix "(null)" result string to "list" when AlbumArtist is disabled diff --git a/configure.ac b/configure.ac index a0c1e32ed..bdbfa9beb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.19.3, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.19.4, musicpd-dev-team@lists.sourceforge.net) VERSION_MAJOR=0 VERSION_MINOR=19 -VERSION_REVISION=3 +VERSION_REVISION=4 VERSION_EXTRA=0 AC_CONFIG_SRCDIR([src/Main.cxx]) From 7c6b991de7824d79dc3d71587db8139c485deb86 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 12 Nov 2014 15:14:34 +0100 Subject: [PATCH 05/10] decoder/opus: add MIME types audio/ogg and application/ogg --- NEWS | 2 ++ src/decoder/plugins/OpusDecoderPlugin.cxx | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 57da4d7ae..cd69a7a6e 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.19.4 (not yet released) +* decoder + - opus: add MIME types audio/ogg and application/ogg ver 0.19.3 (2014/11/11) * protocol diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx index b6b2e0465..25497fe8a 100644 --- a/src/decoder/plugins/OpusDecoderPlugin.cxx +++ b/src/decoder/plugins/OpusDecoderPlugin.cxx @@ -510,6 +510,13 @@ static const char *const opus_suffixes[] = { }; static const char *const opus_mime_types[] = { + /* the official MIME type (RFC 5334) */ + "audio/ogg", + + /* deprecated (RFC 5334) */ + "application/ogg", + + /* deprecated; from an early draft */ "audio/opus", nullptr }; From 3f5f96ac91f570a6aa8b73d20f406410d8a79ed4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Nov 2014 20:53:59 +0100 Subject: [PATCH 06/10] event/ServerSocket: fix get_remote_uid() error value Must return -1 on error, not 0. 0 is root. --- src/event/ServerSocket.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index 781d29181..361aba886 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -141,7 +141,7 @@ get_remote_uid(int fd) socklen_t len = sizeof (cred); if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cred, &len) < 0) - return 0; + return -1; return cred.uid; #else From c8b93d6573550ec3735b070245769970db62a312 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Nov 2014 20:56:27 +0100 Subject: [PATCH 07/10] Client: assume uid==0 is local socket A negative uid value means it's not a "local socket" (PF_LOCAL). uid==0 means user "root" connected. --- NEWS | 1 + src/Client.hxx | 2 +- src/ClientFile.cxx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index e1c499860..13f0fe746 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.18.18 (not yet released) * decoder - ffmpeg: support opus * fix crash on failed filename charset conversion +* fix local socket detection from uid=0 (root) ver 0.18.17 (2014/11/02) * playlist diff --git a/src/Client.hxx b/src/Client.hxx index f0bc6b0f7..fd81b59e0 100644 --- a/src/Client.hxx +++ b/src/Client.hxx @@ -109,7 +109,7 @@ public: * a local (UNIX domain) socket? */ bool IsLocal() const { - return uid > 0; + return uid >= 0; } unsigned GetPermission() const { diff --git a/src/ClientFile.cxx b/src/ClientFile.cxx index 382b76083..7a5dd37a6 100644 --- a/src/ClientFile.cxx +++ b/src/ClientFile.cxx @@ -47,7 +47,7 @@ client_allow_file(const Client &client, Path path_fs, Error &error) instance */ return true; - if (uid <= 0) { + if (uid < 0) { /* unauthenticated client */ error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied"); return false; From 460cfba6ff76ed58e6f6778cfeb9dd424d7fe75a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Nov 2014 21:26:31 +0100 Subject: [PATCH 08/10] QueueCommands: workaround for buggy clients that send "add /" --- NEWS | 2 ++ src/command/QueueCommands.cxx | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index cd69a7a6e..dae99f74a 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.19.4 (not yet released) +* protocol + - workaround for buggy clients that send "add /" * decoder - opus: add MIME types audio/ogg and application/ogg diff --git a/src/command/QueueCommands.cxx b/src/command/QueueCommands.cxx index 36c8ac84f..d0b789eb1 100644 --- a/src/command/QueueCommands.cxx +++ b/src/command/QueueCommands.cxx @@ -61,7 +61,16 @@ translate_uri(Client &client, const char *uri) CommandResult handle_add(Client &client, gcc_unused unsigned argc, char *argv[]) { - const char *const uri = translate_uri(client, argv[1]); + const char *uri = argv[1]; + if (memcmp(uri, "/", 2) == 0) + /* this URI is malformed, but some clients are buggy + and use "add /" to add the whole database, which + was never intended to work, but once did; in order + to retain backwards compatibility, work around this + here */ + uri = ""; + + uri = translate_uri(client, uri); if (uri == nullptr) return CommandResult::ERROR; From 7aa2104596f283c6af22b7b721267065cda86237 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Nov 2014 21:34:03 +0100 Subject: [PATCH 09/10] release v0.18.18 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 13f0fe746..21b44eec3 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.18.18 (not yet released) +ver 0.18.18 (2014/11/18) * decoder - ffmpeg: support opus * fix crash on failed filename charset conversion From d6bc5c35a730a9542af79118369022115009eddd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Nov 2014 21:40:52 +0100 Subject: [PATCH 10/10] release v0.19.4 --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ccb0f3905..762d18086 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.19.4 (not yet released) +ver 0.19.4 (2014/11/18) * protocol - workaround for buggy clients that send "add /" * decoder