diff options
author | Max Kellermann <max@duempel.org> | 2014-11-18 21:47:20 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-11-18 21:47:20 +0100 |
commit | 26382713c26139e474bda5e74798e1201e036b82 (patch) | |
tree | da03a95d2cf840843e1e02052d2d87d8e513ee0f | |
parent | f37481f843c3ae7aa0c43591c9c7fc4a501c1f5b (diff) | |
parent | d6bc5c35a730a9542af79118369022115009eddd (diff) | |
download | mpd-26382713c26139e474bda5e74798e1201e036b82.tar.gz mpd-26382713c26139e474bda5e74798e1201e036b82.tar.xz mpd-26382713c26139e474bda5e74798e1201e036b82.zip |
Merge tag 'v0.19.4'
-rw-r--r-- | NEWS | 15 | ||||
-rw-r--r-- | src/client/Client.hxx | 2 | ||||
-rw-r--r-- | src/client/ClientFile.cxx | 2 | ||||
-rw-r--r-- | src/command/QueueCommands.cxx | 11 | ||||
-rw-r--r-- | src/decoder/plugins/OpusDecoderPlugin.cxx | 7 | ||||
-rw-r--r-- | src/event/ServerSocket.cxx | 2 | ||||
-rw-r--r-- | src/fs/AllocatedPath.cxx | 6 |
7 files changed, 40 insertions, 5 deletions
@@ -5,6 +5,15 @@ ver 0.20 (not yet released) * output - pulse: set channel map to WAVE-EX +ver 0.19.4 (2014/11/18) +* protocol + - workaround for buggy clients that send "add /" +* decoder + - ffmpeg: support opus + - opus: add MIME types audio/ogg and application/ogg +* fix crash on failed filename charset conversion +* fix local socket detection from uid=0 (root) + ver 0.19.3 (2014/11/11) * protocol - fix "(null)" result string to "list" when AlbumArtist is disabled @@ -127,6 +136,12 @@ ver 0.19 (2014/10/10) * install systemd unit for socket activation * Android port +ver 0.18.18 (2014/11/18) +* 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 - don't allow empty playlist name diff --git a/src/client/Client.hxx b/src/client/Client.hxx index 849a11ed4..c0a940ded 100644 --- a/src/client/Client.hxx +++ b/src/client/Client.hxx @@ -127,7 +127,7 @@ public: * a local (UNIX domain) socket? */ bool IsLocal() const { - return uid > 0; + return uid >= 0; } unsigned GetPermission() const { diff --git a/src/client/ClientFile.cxx b/src/client/ClientFile.cxx index eba64d09c..3ea8034d2 100644 --- a/src/client/ClientFile.cxx +++ b/src/client/ClientFile.cxx @@ -41,7 +41,7 @@ Client::AllowFile(Path path_fs, Error &error) const instance */ return true; - if (uid <= 0) { + if (uid < 0) { /* unauthenticated client */ error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied"); return false; 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; 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 }; diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index ce70a969b..313f0a6cf 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -130,7 +130,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 diff --git a/src/fs/AllocatedPath.cxx b/src/fs/AllocatedPath.cxx index 30ce7e3a9..ceaad73ea 100644 --- a/src/fs/AllocatedPath.cxx +++ b/src/fs/AllocatedPath.cxx @@ -46,7 +46,11 @@ AllocatedPath AllocatedPath::FromUTF8(const char *path_utf8) { #ifdef HAVE_GLIB - return AllocatedPath(Donate(), ::PathFromUTF8(path_utf8)); + char *path = ::PathFromUTF8(path_utf8); + if (path == nullptr) + return AllocatedPath::Null(); + + return AllocatedPath(Donate(), path); #else return FromFS(path_utf8); #endif |