diff -Nru mpd-0.19.19/configure mpd-0.19.21/configure --- mpd-0.19.19/configure 2016-08-15 08:00:53.000000000 +0000 +++ mpd-0.19.21/configure 2016-12-13 07:55:28.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for mpd 0.19.19. +# Generated by GNU Autoconf 2.69 for mpd 0.19.21. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='mpd' PACKAGE_TARNAME='mpd' -PACKAGE_VERSION='0.19.19' -PACKAGE_STRING='mpd 0.19.19' +PACKAGE_VERSION='0.19.21' +PACKAGE_STRING='mpd 0.19.21' PACKAGE_BUGREPORT='musicpd-dev-team@lists.sourceforge.net' PACKAGE_URL='' @@ -918,6 +918,9 @@ AM_CXXFLAGS AM_CFLAGS AM_CPPFLAGS +HAVE_SYSTEMD_USER_FALSE +HAVE_SYSTEMD_USER_TRUE +systemduserunitdir HAVE_SYSTEMD_FALSE HAVE_SYSTEMD_TRUE systemdsystemunitdir @@ -1021,6 +1024,7 @@ enable_silent_rules enable_dependency_tracking with_systemdsystemunitdir +with_systemduserunitdir with_android_sdk enable_eventfd enable_signalfd @@ -1759,7 +1763,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures mpd 0.19.19 to adapt to many kinds of systems. +\`configure' configures mpd 0.19.21 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1830,7 +1834,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mpd 0.19.19:";; + short | recursive ) echo "Configuration of mpd 0.19.21:";; esac cat <<\_ACEOF @@ -1936,6 +1940,8 @@ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-systemdsystemunitdir=DIR Directory for systemd service files + --with-systemduserunitdir=DIR + Directory for systemd service files --with-android-sdk=DIR Directory for Android SDK --with-pollmethod=[epoll|poll|winselect|auto] specify poll method for internal event loop @@ -2175,7 +2181,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mpd configure 0.19.19 +mpd configure 0.19.21 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2628,7 +2634,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by mpd $as_me 0.19.19, which was +It was created by mpd $as_me 0.19.21, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2979,7 +2985,7 @@ VERSION_MAJOR=0 VERSION_MINOR=19 -VERSION_REVISION=19 +VERSION_REVISION=21 VERSION_EXTRA=0 @@ -3498,7 +3504,7 @@ # Define the identity of the package. PACKAGE='mpd' - VERSION='0.19.19' + VERSION='0.19.21' cat >>confdefs.h <<_ACEOF @@ -5620,6 +5626,37 @@ fi + +# Check whether --with-systemduserunitdir was given. +if test "${with_systemduserunitdir+set}" = set; then : + withval=$with_systemduserunitdir; +else + with_systemduserunitdir=no +fi + +if test "x$with_systemduserunitdir" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd" >&5 +$as_echo_n "checking for systemd... " >&6; } + with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd) + if test -z "$with_systemduserunitdir"; then + as_fn_error $? "Failed to detect systemd" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemduserunitdir" >&5 +$as_echo "$with_systemduserunitdir" >&6; } +fi +if test "x$with_systemduserunitdir" != xno; then + systemduserunitdir=$with_systemduserunitdir + +fi + if test -n "$with_systemduserunitdir" -a "x$with_systemduserunitdir" != xno ; then + HAVE_SYSTEMD_USER_TRUE= + HAVE_SYSTEMD_USER_FALSE='#' +else + HAVE_SYSTEMD_USER_TRUE='#' + HAVE_SYSTEMD_USER_FALSE= +fi + + AM_CPPFLAGS="" AM_CFLAGS="" @@ -20115,7 +20152,9 @@ ac_config_files="$ac_config_files doc/doxygen.conf" -ac_config_files="$ac_config_files systemd/mpd.service" +ac_config_files="$ac_config_files systemd/system/mpd.service" + +ac_config_files="$ac_config_files systemd/user/mpd.service" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -20258,6 +20297,10 @@ as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_SYSTEMD_USER_TRUE}" && test -z "${HAVE_SYSTEMD_USER_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SYSTEMD_USER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ANDROID_TRUE}" && test -z "${ANDROID_FALSE}"; then as_fn_error $? "conditional \"ANDROID\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -20963,7 +21006,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mpd $as_me 0.19.19, which was +This file was extended by mpd $as_me 0.19.21, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21029,7 +21072,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mpd config.status 0.19.19 +mpd config.status 0.19.21 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -21163,7 +21206,8 @@ "src/win32/mpd_win32_rc.rc") CONFIG_FILES="$CONFIG_FILES src/win32/mpd_win32_rc.rc" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/doxygen.conf") CONFIG_FILES="$CONFIG_FILES doc/doxygen.conf" ;; - "systemd/mpd.service") CONFIG_FILES="$CONFIG_FILES systemd/mpd.service" ;; + "systemd/system/mpd.service") CONFIG_FILES="$CONFIG_FILES systemd/system/mpd.service" ;; + "systemd/user/mpd.service") CONFIG_FILES="$CONFIG_FILES systemd/user/mpd.service" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff -Nru mpd-0.19.19/configure.ac mpd-0.19.21/configure.ac --- mpd-0.19.19/configure.ac 2016-08-15 08:00:15.000000000 +0000 +++ mpd-0.19.21/configure.ac 2016-12-13 07:54:51.000000000 +0000 @@ -1,10 +1,10 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.19.19, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.19.21, musicpd-dev-team@lists.sourceforge.net) VERSION_MAJOR=0 VERSION_MINOR=19 -VERSION_REVISION=19 +VERSION_REVISION=21 VERSION_EXTRA=0 AC_CONFIG_SRCDIR([src/Main.cxx]) @@ -52,6 +52,22 @@ fi AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) +AC_ARG_WITH([systemduserunitdir], + AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd service files]), + [], [with_systemduserunitdir=no]) +if test "x$with_systemduserunitdir" = xyes; then + AC_MSG_CHECKING(for systemd) + with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd) + if test -z "$with_systemduserunitdir"; then + AC_MSG_ERROR([Failed to detect systemd]) + fi + AC_MSG_RESULT([$with_systemduserunitdir]) +fi +if test "x$with_systemduserunitdir" != xno; then + AC_SUBST([systemduserunitdir], [$with_systemduserunitdir]) +fi +AM_CONDITIONAL(HAVE_SYSTEMD_USER, [test -n "$with_systemduserunitdir" -a "x$with_systemduserunitdir" != xno ]) + dnl --------------------------------------------------------------------------- dnl Declare Variables dnl --------------------------------------------------------------------------- @@ -1905,7 +1921,8 @@ dnl --------------------------------------------------------------------------- AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(doc/doxygen.conf) -AC_CONFIG_FILES(systemd/mpd.service) +AC_CONFIG_FILES(systemd/system/mpd.service) +AC_CONFIG_FILES(systemd/user/mpd.service) AC_OUTPUT echo 'MPD is ready for compilation, type "make" to begin.' diff -Nru mpd-0.19.19/debian/changelog mpd-0.19.21/debian/changelog --- mpd-0.19.19/debian/changelog 2016-09-12 19:19:06.000000000 +0000 +++ mpd-0.19.21/debian/changelog 2016-12-13 20:36:28.000000000 +0000 @@ -1,3 +1,15 @@ +mpd (0.19.21-1) unstable; urgency=medium + + * New upstream version 0.19.20, 0.19.21 + * Drop also-dis_en_able-socket.patch, protect_system.patch applied upstream + * Re-enable tests on mips*, assertion failure has been fixed (cf. #767863) + * Disable smb support on hurd-i386 + * Add hurd_pthread.patch + * Install system user unit from upstream + * Refresh patches + + -- Florian Schlichting Tue, 13 Dec 2016 21:36:28 +0100 + mpd (0.19.19-1) unstable; urgency=medium * Override a spelling-error lintian warning that is verbatim diff -Nru mpd-0.19.19/debian/control mpd-0.19.21/debian/control --- mpd-0.19.19/debian/control 2016-08-30 20:27:13.000000000 +0000 +++ mpd-0.19.21/debian/control 2016-12-12 21:59:22.000000000 +0000 @@ -50,7 +50,7 @@ libshout3-dev, libsidplayfp-dev, libsidutils-dev, - libsmbclient-dev, + libsmbclient-dev [!hurd-i386], libsndfile1-dev, libsoxr-dev, libsqlite3-dev, @@ -70,7 +70,7 @@ Vcs-Git: https://anonscm.debian.org/git/pkg-mpd/pkg-mpd.git Package: mpd -Architecture: linux-any kfreebsd-any +Architecture: any Depends: adduser, lsb-base, ${misc:Depends}, ${shlibs:Depends} Suggests: avahi-daemon, icecast2, mpd-client, pulseaudio Breaks: avahi-daemon (<< 0.6.31-3) diff -Nru mpd-0.19.19/debian/mpd.service.user mpd-0.19.21/debian/mpd.service.user --- mpd-0.19.19/debian/mpd.service.user 2016-09-12 19:19:06.000000000 +0000 +++ mpd-0.19.21/debian/mpd.service.user 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -[Unit] -Description=Music Player Daemon (user unit) -Documentation=man:mpd(1) man:mpd.conf(5) -Documentation=file:///usr/share/doc/mpd/user-manual.html - -[Service] -ExecStart=/usr/bin/mpd --no-daemon - -# disallow writing to /usr, /bin, /sbin, ... -ProtectSystem=yes - -[Install] -WantedBy=default.target diff -Nru mpd-0.19.19/debian/patches/also-dis_en_able-socket.patch mpd-0.19.21/debian/patches/also-dis_en_able-socket.patch --- mpd-0.19.19/debian/patches/also-dis_en_able-socket.patch 2015-11-06 19:03:18.000000000 +0000 +++ mpd-0.19.21/debian/patches/also-dis_en_able-socket.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -Description: also disable mpd.socket when disabling mpd.service - e.g. when running 'update-rc.d mpd disable' -Author: Clément B. -Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769951 -Forwarded: http://mailman.blarg.de/pipermail/mpd-devel/2015-June/000363.html - ---- a/systemd/mpd.service.in -+++ b/systemd/mpd.service.in -@@ -12,3 +12,4 @@ - - [Install] - WantedBy=multi-user.target -+Also=mpd.socket diff -Nru mpd-0.19.19/debian/patches/curl-proxy.patch mpd-0.19.21/debian/patches/curl-proxy.patch --- mpd-0.19.19/debian/patches/curl-proxy.patch 2016-04-30 21:50:23.000000000 +0000 +++ mpd-0.19.21/debian/patches/curl-proxy.patch 2016-12-13 20:33:41.000000000 +0000 @@ -5,7 +5,7 @@ --- a/doc/user.xml +++ b/doc/user.xml -@@ -1777,6 +1777,13 @@ +@@ -1804,6 +1804,13 @@ Opens remote files or streams over HTTP. diff -Nru mpd-0.19.19/debian/patches/hurd_pthread.patch mpd-0.19.21/debian/patches/hurd_pthread.patch --- mpd-0.19.19/debian/patches/hurd_pthread.patch 1970-01-01 00:00:00.000000000 +0000 +++ mpd-0.19.21/debian/patches/hurd_pthread.patch 2016-12-12 21:59:29.000000000 +0000 @@ -0,0 +1,38 @@ +Description: fix compilation errors on Debian GNU/Hurd + Apparently on hurd-i386 __GLIBC__ is defined, but the pthread implementation + is special and cannot be used with constexpr. Hence exclude __gnu_hurd__. +Author: Florian Schlichting + +--- a/src/notify.hxx ++++ b/src/notify.hxx +@@ -28,7 +28,7 @@ + Cond cond; + bool pending; + +-#ifdef __GLIBC__ ++#if defined(__GLIBC__) && !defined(__gnu_hurd__) + constexpr + #endif + notify():pending(false) {} +--- a/src/thread/PosixCond.hxx ++++ b/src/thread/PosixCond.hxx +@@ -41,7 +41,7 @@ + pthread_cond_t cond; + + public: +-#ifdef __GLIBC__ ++#if defined(__GLIBC__) && !defined(__gnu_hurd__) + /* optimized constexpr constructor for pthread implementations + that support it */ + constexpr PosixCond():cond(PTHREAD_COND_INITIALIZER) {} +--- a/src/thread/PosixMutex.hxx ++++ b/src/thread/PosixMutex.hxx +@@ -41,7 +41,7 @@ + pthread_mutex_t mutex; + + public: +-#ifdef __GLIBC__ ++#if defined(__GLIBC__) && !defined(__gnu_hurd__) + /* optimized constexpr constructor for pthread implementations + that support it */ + constexpr PosixMutex():mutex(PTHREAD_MUTEX_INITIALIZER) {} diff -Nru mpd-0.19.19/debian/patches/libsystemd.patch mpd-0.19.21/debian/patches/libsystemd.patch --- mpd-0.19.19/debian/patches/libsystemd.patch 2016-09-12 18:46:10.000000000 +0000 +++ mpd-0.19.21/debian/patches/libsystemd.patch 2016-12-13 20:33:20.000000000 +0000 @@ -8,7 +8,7 @@ --- a/configure.ac +++ b/configure.ac -@@ -570,10 +570,10 @@ +@@ -586,10 +586,10 @@ MPD_DEPENDS([enable_sqlite], [enable_glib], [Cannot use --enable-sqlite with --disable-glib]) @@ -23,7 +23,7 @@ AC_ARG_ENABLE(tcp, AS_HELP_STRING([--disable-tcp], -@@ -754,11 +754,11 @@ +@@ -770,11 +770,11 @@ AC_MSG_ERROR([No client interfaces configured!]) fi diff -Nru mpd-0.19.19/debian/patches/mpd.service.documentation.patch mpd-0.19.21/debian/patches/mpd.service.documentation.patch --- mpd-0.19.19/debian/patches/mpd.service.documentation.patch 2016-04-24 20:08:20.000000000 +0000 +++ mpd-0.19.21/debian/patches/mpd.service.documentation.patch 2016-12-13 20:32:42.000000000 +0000 @@ -3,10 +3,17 @@ Author: Wieland Hoffmann Origin: upstream -diff --git a/systemd/mpd.service.in b/systemd/mpd.service.in -index a72eb92..caf0d67 100644 ---- a/systemd/mpd.service.in -+++ b/systemd/mpd.service.in +--- a/systemd/system/mpd.service.in ++++ b/systemd/system/mpd.service.in +@@ -1,5 +1,6 @@ + [Unit] + Description=Music Player Daemon ++Documentation=man:mpd(1) man:mpd.conf(5) + After=network.target sound.target + + [Service] +--- a/systemd/user/mpd.service.in ++++ b/systemd/user/mpd.service.in @@ -1,5 +1,6 @@ [Unit] Description=Music Player Daemon diff -Nru mpd-0.19.19/debian/patches/mpd.service.documentation.user.patch mpd-0.19.21/debian/patches/mpd.service.documentation.user.patch --- mpd-0.19.19/debian/patches/mpd.service.documentation.user.patch 2016-04-24 20:28:21.000000000 +0000 +++ mpd-0.19.21/debian/patches/mpd.service.documentation.user.patch 2016-12-13 20:33:10.000000000 +0000 @@ -2,8 +2,18 @@ Author: Florian Schlichting Forwarded: not-needed ---- a/systemd/mpd.service.in -+++ b/systemd/mpd.service.in +--- a/systemd/system/mpd.service.in ++++ b/systemd/system/mpd.service.in +@@ -1,6 +1,7 @@ + [Unit] + Description=Music Player Daemon + Documentation=man:mpd(1) man:mpd.conf(5) ++Documentation=file:///usr/share/doc/mpd/user-manual.html + After=network.target sound.target + + [Service] +--- a/systemd/user/mpd.service.in ++++ b/systemd/user/mpd.service.in @@ -1,6 +1,7 @@ [Unit] Description=Music Player Daemon diff -Nru mpd-0.19.19/debian/patches/protect_system.patch mpd-0.19.21/debian/patches/protect_system.patch --- mpd-0.19.19/debian/patches/protect_system.patch 2015-12-21 15:52:29.000000000 +0000 +++ mpd-0.19.21/debian/patches/protect_system.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Description: Protect /usr when running under systemd -Author: Florian Schlichting -Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771634 -Forwarded: http://mailman.blarg.de/pipermail/mpd-devel/2015-June/000363.html - ---- a/systemd/mpd.service.in -+++ b/systemd/mpd.service.in -@@ -10,6 +10,9 @@ - LimitRTPRIO=50 - LimitRTTIME=infinity - -+# disallow writing to /usr, /bin, /sbin, ... -+ProtectSystem=yes -+ - [Install] - WantedBy=multi-user.target - Also=mpd.socket diff -Nru mpd-0.19.19/debian/patches/prune-doc-data.patch mpd-0.19.21/debian/patches/prune-doc-data.patch --- mpd-0.19.19/debian/patches/prune-doc-data.patch 2016-09-12 18:46:10.000000000 +0000 +++ mpd-0.19.21/debian/patches/prune-doc-data.patch 2016-12-13 20:33:47.000000000 +0000 @@ -4,7 +4,7 @@ --- a/Makefile.am +++ b/Makefile.am -@@ -2104,7 +2104,7 @@ +@@ -2109,7 +2109,7 @@ # man_MANS = doc/mpd.1 doc/mpd.conf.5 diff -Nru mpd-0.19.19/debian/patches/series mpd-0.19.21/debian/patches/series --- mpd-0.19.19/debian/patches/series 2016-09-12 18:46:10.000000000 +0000 +++ mpd-0.19.21/debian/patches/series 2016-12-12 21:59:29.000000000 +0000 @@ -1,9 +1,8 @@ systemd_honor_MPDCONF.patch -also-dis_en_able-socket.patch -protect_system.patch libsystemd.patch curl-proxy.patch bind-to-address-socket-activation.patch prune-doc-data.patch mpd.service.documentation.patch mpd.service.documentation.user.patch +hurd_pthread.patch diff -Nru mpd-0.19.19/debian/patches/systemd_honor_MPDCONF.patch mpd-0.19.21/debian/patches/systemd_honor_MPDCONF.patch --- mpd-0.19.19/debian/patches/systemd_honor_MPDCONF.patch 2015-03-09 20:55:30.000000000 +0000 +++ mpd-0.19.21/debian/patches/systemd_honor_MPDCONF.patch 2016-12-13 20:29:32.000000000 +0000 @@ -2,8 +2,8 @@ Author: Florian Schlichting Forwarded: not-needed ---- a/systemd/mpd.service.in -+++ b/systemd/mpd.service.in +--- a/systemd/system/mpd.service.in ++++ b/systemd/system/mpd.service.in @@ -3,7 +3,8 @@ After=network.target sound.target diff -Nru mpd-0.19.19/debian/rules mpd-0.19.21/debian/rules --- mpd-0.19.19/debian/rules 2016-09-12 19:19:06.000000000 +0000 +++ mpd-0.19.21/debian/rules 2016-12-13 20:28:11.000000000 +0000 @@ -12,28 +12,23 @@ WITH_TREMOR=--with-tremor --disable-vorbis --enable-shine-encoder endif -# work around ld assertion fail ../../bfd/elf-strtab.c:254/:272 on mips/mipsel -RUN_TESTS=--enable-test -ifeq ($(DEB_HOST_ARCH), mips) - RUN_TESTS=--disable-test -endif -ifeq ($(DEB_HOST_ARCH), mipsel) - RUN_TESTS=--disable-test -endif -ifeq ($(DEB_HOST_ARCH), mips64el) - RUN_TESTS=--disable-test -endif - # no systemd and no alsa on non-linux arches ifeq ($(DEB_HOST_ARCH_OS), linux) -WITH_SYSTEMD=--enable-systemd --with-systemdsystemunitdir=/lib/systemd/system --enable-alsa +WITH_SYSTEMD=--enable-systemd --with-systemdsystemunitdir=/lib/systemd/system --with-systemduserunitdir=/usr/lib/systemd/user --enable-alsa else WITH_SYSTEMD=--disable-systemd --disable-alsa endif +# no smbclient on hurd-i386 (#815441) +ENABLE_SMBCLIENT=--enable-smbclient +ifeq ($(DEB_HOST_ARCH), hurd-i386) + ENABLE_SMBCLIENT=--disable-smbclient +endif + ############################################################### ## Define Debian feature set (in configure summary order) +RUN_TESTS=--enable-test # Archive support ENABLE_ARCHIVES=--enable-bzip2 \ @@ -44,7 +39,7 @@ # Autodiscovery support ENABLE_AUTODISCOVERY=--enable-neighbor-plugins \ --enable-nfs \ - --enable-smbclient \ + ${ENABLE_SMBCLIENT} \ --enable-upnp \ --with-zeroconf=avahi @@ -142,11 +137,6 @@ /usr/bin/xmlto --stringparam chunker.output.encoding=utf-8 html-nochunks $(CURDIR)/doc/user.xml mv user.html user-manual.html -override_dh_auto_install: - dh_auto_install - test -f $(CURDIR)/debian/mpd/lib/systemd/system/mpd.service && \ - install -Dm644 $(CURDIR)/debian/mpd.service.user $(CURDIR)/debian/mpd/usr/lib/systemd/user/mpd.service - override_dh_strip: # can be dropped after Stretch dh_strip --ddeb-migration='mpd-dbg (<< 0.19.14-1~)' diff -Nru mpd-0.19.19/doc/doxygen.conf mpd-0.19.21/doc/doxygen.conf --- mpd-0.19.19/doc/doxygen.conf 2016-08-15 08:00:57.000000000 +0000 +++ mpd-0.19.21/doc/doxygen.conf 2016-12-13 09:52:11.000000000 +0000 @@ -31,7 +31,7 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.19.19 +PROJECT_NUMBER = 0.19.21 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff -Nru mpd-0.19.19/doc/mpdconf.example mpd-0.19.21/doc/mpdconf.example --- mpd-0.19.19/doc/mpdconf.example 2016-07-29 08:51:02.000000000 +0000 +++ mpd-0.19.21/doc/mpdconf.example 2016-10-20 13:02:36.000000000 +0000 @@ -164,7 +164,7 @@ # Permissions ################################################################# # # If this setting is set, MPD will require password authorization. The password -# can setting can be specified multiple times for different password profiles. +# setting can be specified multiple times for different password profiles. # #password "password@read,add,control,admin" # diff -Nru mpd-0.19.19/doc/protocol.xml mpd-0.19.21/doc/protocol.xml --- mpd-0.19.19/doc/protocol.xml 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/doc/protocol.xml 2016-11-16 20:25:45.000000000 +0000 @@ -66,8 +66,8 @@ strcpy just fine with UTF-8 encoded strings. For example: OK encoded in UTF-8 is simply OK. For more - information on UTF=8: - http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8) + information on UTF-8: + ) diff -Nru mpd-0.19.19/doc/user.xml mpd-0.19.21/doc/user.xml --- mpd-0.19.19/doc/user.xml 2016-07-29 17:43:33.000000000 +0000 +++ mpd-0.19.21/doc/user.xml 2016-12-13 09:40:57.000000000 +0000 @@ -151,7 +151,7 @@ systemd unit files: a "service" unit and a "socket" unit. These will only be installed when MPD was configured with - --with-systemdsystemunitdir=/lib/systemd. + --with-systemdsystemunitdir=/lib/systemd/system. @@ -167,6 +167,33 @@ port settings. + +
+ <filename>systemd</filename> user unit + + + You can launch MPD as a + systemd user unit. The service file will + only be installed when MPD was + configured with + --with-systemduserunitdir=/usr/lib/systemd/user + or + --with-systemduserunitdir=$HOME/.local/share/systemd/user. + + + + Once the user unit is installed, you can start and stop + MPD like any other service: + + + systemctl --user start mpd + + + To auto-start MPD upon login, type: + + + systemctl --user enable mpd +
diff -Nru mpd-0.19.19/Makefile.am mpd-0.19.21/Makefile.am --- mpd-0.19.19/Makefile.am 2016-08-05 15:48:36.000000000 +0000 +++ mpd-0.19.21/Makefile.am 2016-12-13 09:53:32.000000000 +0000 @@ -1449,8 +1449,13 @@ if HAVE_SYSTEMD systemdsystemunit_DATA = \ - systemd/mpd.socket \ - systemd/mpd.service + systemd/system/mpd.socket \ + systemd/system/mpd.service +endif + +if HAVE_SYSTEMD_USER +systemduserunit_DATA = \ + systemd/user/mpd.service endif @@ -2166,7 +2171,7 @@ $(wildcard $(srcdir)/scripts/*.rb) \ $(man_MANS) $(DOCBOOK_FILES) doc/mpdconf.example doc/doxygen.conf \ $(wildcard $(srcdir)/doc/include/*.xml) \ - systemd/mpd.socket \ + systemd/system/mpd.socket \ android/AndroidManifest.xml \ android/build.py \ android/custom_rules.xml \ diff -Nru mpd-0.19.19/Makefile.in mpd-0.19.21/Makefile.in --- mpd-0.19.19/Makefile.in 2016-08-15 08:00:54.000000000 +0000 +++ mpd-0.19.21/Makefile.in 2016-12-13 09:54:19.000000000 +0000 @@ -587,7 +587,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = src/win32/mpd_win32_rc.rc doc/doxygen.conf \ - systemd/mpd.service + systemd/system/mpd.service systemd/user/mpd.service CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru @@ -1747,7 +1747,8 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(developerdir)" \ "$(DESTDIR)$(docdir)" "$(DESTDIR)$(protocoldir)" \ - "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(userdir)" + "$(DESTDIR)$(systemdsystemunitdir)" \ + "$(DESTDIR)$(systemduserunitdir)" "$(DESTDIR)$(userdir)" @ENABLE_CURL_TRUE@@ENABLE_TEST_TRUE@am__EXEEXT_1 = test/test_icy_parser$(EXEEXT) @ENABLE_DATABASE_TRUE@@ENABLE_TEST_TRUE@am__EXEEXT_2 = test/test_translate_song$(EXEEXT) @ENABLE_ARCHIVE_TRUE@@ENABLE_TEST_TRUE@am__EXEEXT_3 = test/test_archive$(EXEEXT) @@ -2575,7 +2576,7 @@ NROFF = nroff MANS = $(man_MANS) DATA = $(developer_DATA) $(doc_DATA) $(noinst_DATA) $(protocol_DATA) \ - $(systemdsystemunit_DATA) $(user_DATA) + $(systemdsystemunit_DATA) $(systemduserunit_DATA) $(user_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -2781,9 +2782,10 @@ $(top_srcdir)/build/test-driver \ $(top_srcdir)/doc/doxygen.conf.in \ $(top_srcdir)/src/win32/mpd_win32_rc.rc.in \ - $(top_srcdir)/systemd/mpd.service.in AUTHORS COPYING INSTALL \ - NEWS README build/compile build/config.guess build/config.sub \ - build/depcomp build/install-sh build/missing + $(top_srcdir)/systemd/system/mpd.service.in \ + $(top_srcdir)/systemd/user/mpd.service.in AUTHORS COPYING \ + INSTALL NEWS README build/compile build/config.guess \ + build/config.sub build/depcomp build/install-sh build/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -3032,6 +3034,7 @@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ +systemduserunitdir = @systemduserunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ @@ -3732,8 +3735,11 @@ # systemd unit # @HAVE_SYSTEMD_TRUE@systemdsystemunit_DATA = \ -@HAVE_SYSTEMD_TRUE@ systemd/mpd.socket \ -@HAVE_SYSTEMD_TRUE@ systemd/mpd.service +@HAVE_SYSTEMD_TRUE@ systemd/system/mpd.socket \ +@HAVE_SYSTEMD_TRUE@ systemd/system/mpd.service + +@HAVE_SYSTEMD_USER_TRUE@systemduserunit_DATA = \ +@HAVE_SYSTEMD_USER_TRUE@ systemd/user/mpd.service # @@ -4311,7 +4317,7 @@ $(wildcard $(srcdir)/scripts/*.rb) \ $(man_MANS) $(DOCBOOK_FILES) doc/mpdconf.example doc/doxygen.conf \ $(wildcard $(srcdir)/doc/include/*.xml) \ - systemd/mpd.socket \ + systemd/system/mpd.socket \ android/AndroidManifest.xml \ android/build.py \ android/custom_rules.xml \ @@ -4378,7 +4384,9 @@ cd $(top_builddir) && $(SHELL) ./config.status $@ doc/doxygen.conf: $(top_builddir)/config.status $(top_srcdir)/doc/doxygen.conf.in cd $(top_builddir) && $(SHELL) ./config.status $@ -systemd/mpd.service: $(top_builddir)/config.status $(top_srcdir)/systemd/mpd.service.in +systemd/system/mpd.service: $(top_builddir)/config.status $(top_srcdir)/systemd/system/mpd.service.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +systemd/user/mpd.service: $(top_builddir)/config.status $(top_srcdir)/systemd/user/mpd.service.in cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstLIBRARIES: @@ -13401,6 +13409,27 @@ @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir) +install-systemduserunitDATA: $(systemduserunit_DATA) + @$(NORMAL_INSTALL) + @list='$(systemduserunit_DATA)'; test -n "$(systemduserunitdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(systemduserunitdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(systemduserunitdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemduserunitdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(systemduserunitdir)" || exit $$?; \ + done + +uninstall-systemduserunitDATA: + @$(NORMAL_UNINSTALL) + @list='$(systemduserunit_DATA)'; test -n "$(systemduserunitdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(systemduserunitdir)'; $(am__uninstall_files_from_dir) install-userDATA: $(user_DATA) @$(NORMAL_INSTALL) @list='$(user_DATA)'; test -n "$(userdir)" || list=; \ @@ -13899,7 +13928,7 @@ all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA) config.h \ all-local installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(developerdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(protocoldir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(userdir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(developerdir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(protocoldir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(systemduserunitdir)" "$(DESTDIR)$(userdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -14053,9 +14082,9 @@ @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -@ANDROID_FALSE@@ENABLE_DOCUMENTATION_FALSE@clean-local: -@ENABLE_DOCUMENTATION_FALSE@install-data-local: @ENABLE_DOCUMENTATION_FALSE@uninstall-local: +@ENABLE_DOCUMENTATION_FALSE@install-data-local: +@ANDROID_FALSE@@ENABLE_DOCUMENTATION_FALSE@clean-local: clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-local \ @@ -14082,7 +14111,8 @@ install-data-am: install-data-local install-developerDATA \ install-docDATA install-man install-protocolDATA \ - install-systemdsystemunitDATA install-userDATA + install-systemdsystemunitDATA install-systemduserunitDATA \ + install-userDATA install-dvi: install-dvi-am @@ -14132,7 +14162,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-developerDATA \ uninstall-docDATA uninstall-local uninstall-man \ uninstall-protocolDATA uninstall-systemdsystemunitDATA \ - uninstall-userDATA + uninstall-systemduserunitDATA uninstall-userDATA uninstall-man: uninstall-man1 uninstall-man5 @@ -14153,14 +14183,15 @@ install-info-am install-man install-man1 install-man5 \ install-pdf install-pdf-am install-protocolDATA install-ps \ install-ps-am install-strip install-systemdsystemunitDATA \ - install-userDATA installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - recheck tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-developerDATA \ - uninstall-docDATA uninstall-local uninstall-man uninstall-man1 \ - uninstall-man5 uninstall-protocolDATA \ - uninstall-systemdsystemunitDATA uninstall-userDATA + install-systemduserunitDATA install-userDATA installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-developerDATA uninstall-docDATA uninstall-local \ + uninstall-man uninstall-man1 uninstall-man5 \ + uninstall-protocolDATA uninstall-systemdsystemunitDATA \ + uninstall-systemduserunitDATA uninstall-userDATA .PRECIOUS: Makefile diff -Nru mpd-0.19.19/NEWS mpd-0.19.21/NEWS --- mpd-0.19.19/NEWS 2016-08-23 08:19:37.000000000 +0000 +++ mpd-0.19.21/NEWS 2016-12-13 09:54:11.000000000 +0000 @@ -1,3 +1,21 @@ +ver 0.19.21 (2016/12/13) +* decoder + - ffmpeg: fix crash bug +* fix unit test failure after recent "setprio" change +* systemd: add user unit + +ver 0.19.20 (2016/12/09) +* protocol + - "setprio" re-enqueues old song if priority has been raised +* decoder + - ffmpeg: ignore empty packets + - pcm: fix corruption bug with partial frames (after short read) + - sidplay: fix playback speed with libsidplayfp +* output + - winmm: fix 8 bit playback +* fix gcc 7.0 -Wimplicit-fallthrough +* systemd: paranoid security settings + ver 0.19.19 (2016/08/23) * decoder - ffmpeg: bug fix for FFmpeg 3.1 support diff -Nru mpd-0.19.19/src/decoder/plugins/FfmpegDecoderPlugin.cxx mpd-0.19.21/src/decoder/plugins/FfmpegDecoderPlugin.cxx --- mpd-0.19.19/src/decoder/plugins/FfmpegDecoderPlugin.cxx 2016-08-23 08:15:28.000000000 +0000 +++ mpd-0.19.21/src/decoder/plugins/FfmpegDecoderPlugin.cxx 2016-12-13 07:32:47.000000000 +0000 @@ -71,7 +71,6 @@ int err = avformat_open_input(&context, filename, fmt, nullptr); if (err < 0) { - avformat_free_context(context); SetFfmpegError(error, err, "avformat_open_input() failed"); return nullptr; } @@ -643,7 +642,7 @@ /* end of file */ break; - if (packet.stream_index == audio_stream) { + if (packet.size > 0 && packet.stream_index == audio_stream) { cmd = ffmpeg_send_packet(decoder, input, packet, *codec_context, diff -Nru mpd-0.19.19/src/decoder/plugins/PcmDecoderPlugin.cxx mpd-0.19.21/src/decoder/plugins/PcmDecoderPlugin.cxx --- mpd-0.19.19/src/decoder/plugins/PcmDecoderPlugin.cxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/src/decoder/plugins/PcmDecoderPlugin.cxx 2016-11-17 21:20:17.000000000 +0000 @@ -23,10 +23,28 @@ #include "input/InputStream.hxx" #include "util/Error.hxx" #include "util/ByteReverse.hxx" +#include "util/StaticFifoBuffer.hxx" #include "Log.hxx" +#include #include +template +static bool +FillBuffer(Decoder &decoder, InputStream &is, B &buffer) +{ + buffer.Shift(); + auto w = buffer.Write(); + assert(!w.IsEmpty()); + + size_t nbytes = decoder_read(decoder, is, w.data, w.size); + if (nbytes == 0 && is.LockIsEOF()) + return false; + + buffer.Append(nbytes); + return true; +} + static void pcm_stream_decode(Decoder &decoder, InputStream &is) { @@ -50,25 +68,27 @@ decoder_initialized(decoder, audio_format, is.IsSeekable(), total_time); + StaticFifoBuffer buffer; + DecoderCommand cmd; do { - char buffer[4096]; - - size_t nbytes = decoder_read(decoder, is, - buffer, sizeof(buffer)); - - if (nbytes == 0 && is.LockIsEOF()) + if (!FillBuffer(decoder, is, buffer)) break; + auto r = buffer.Read(); + /* round down to the nearest frame size, because we + must not pass partial frames to decoder_data() */ + r.size -= r.size % frame_size; + buffer.Consume(r.size); + if (reverse_endian) /* make sure we deliver samples in host byte order */ - reverse_bytes_16((uint16_t *)buffer, - (uint16_t *)buffer, - (uint16_t *)(buffer + nbytes)); - - cmd = nbytes > 0 - ? decoder_data(decoder, is, - buffer, nbytes, 0) + reverse_bytes_16((uint16_t *)r.data, + (uint16_t *)r.data, + (uint16_t *)(r.data + r.size)); + + cmd = !r.IsEmpty() + ? decoder_data(decoder, is, r.data, r.size, 0) : decoder_get_command(decoder); if (cmd == DecoderCommand::SEEK) { uint64_t frame = decoder_seek_where_frame(decoder); @@ -76,6 +96,7 @@ Error error; if (is.LockSeek(offset, error)) { + buffer.Clear(); decoder_command_finished(decoder); } else { LogError(error); diff -Nru mpd-0.19.19/src/decoder/plugins/SidplayDecoderPlugin.cxx mpd-0.19.21/src/decoder/plugins/SidplayDecoderPlugin.cxx --- mpd-0.19.19/src/decoder/plugins/SidplayDecoderPlugin.cxx 2016-07-29 18:09:07.000000000 +0000 +++ mpd-0.19.21/src/decoder/plugins/SidplayDecoderPlugin.cxx 2016-10-27 18:40:26.000000000 +0000 @@ -354,12 +354,19 @@ DecoderCommand cmd; do { short buffer[4096]; - size_t nbytes; - nbytes = player.play(buffer, ARRAY_SIZE(buffer)); - if (nbytes == 0) + const auto result = player.play(buffer, ARRAY_SIZE(buffer)); + if (result <= 0) break; +#ifdef HAVE_SIDPLAYFP + /* libsidplayfp returns the number of samples */ + const size_t nbytes = result * sizeof(buffer[0]); +#else + /* libsidplay2 returns the number of bytes */ + const size_t nbytes = result; +#endif + decoder_timestamp(decoder, (double)player.time() / timebase); cmd = decoder_data(decoder, nullptr, buffer, nbytes, 0); @@ -376,12 +383,9 @@ } /* ignore data until target time is reached */ - while(data_time 0) data_time = player.time(); - } decoder_command_finished(decoder); } diff -Nru mpd-0.19.19/src/input/plugins/AlsaInputPlugin.cxx mpd-0.19.21/src/input/plugins/AlsaInputPlugin.cxx --- mpd-0.19.19/src/input/plugins/AlsaInputPlugin.cxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/src/input/plugins/AlsaInputPlugin.cxx 2016-11-16 18:49:26.000000000 +0000 @@ -247,6 +247,10 @@ case -EPIPE: LogDebug(alsa_input_domain, "Buffer Overrun"); // drop through +#if GCC_CHECK_VERSION(7,0) + [[fallthrough]]; +#endif + case -ESTRPIPE: case -EINTR: err = snd_pcm_recover(capture_handle, err, 1); diff -Nru mpd-0.19.19/src/LogInit.cxx mpd-0.19.21/src/LogInit.cxx --- mpd-0.19.19/src/LogInit.cxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/src/LogInit.cxx 2016-12-04 19:13:24.000000000 +0000 @@ -51,7 +51,7 @@ #ifndef ANDROID -static int out_fd; +static int out_fd = -1; static AllocatedPath out_path = AllocatedPath::Null(); static void redirect_logs(int fd) diff -Nru mpd-0.19.19/src/output/plugins/AlsaOutputPlugin.cxx mpd-0.19.21/src/output/plugins/AlsaOutputPlugin.cxx --- mpd-0.19.19/src/output/plugins/AlsaOutputPlugin.cxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/src/output/plugins/AlsaOutputPlugin.cxx 2016-11-16 18:49:48.000000000 +0000 @@ -760,6 +760,9 @@ if (err == -EAGAIN) return 0; /* fall-through to snd_pcm_prepare: */ +#if GCC_CHECK_VERSION(7,0) + [[fallthrough]]; +#endif case SND_PCM_STATE_SETUP: case SND_PCM_STATE_XRUN: ad->period_position = 0; diff -Nru mpd-0.19.19/src/output/plugins/WinmmOutputPlugin.cxx mpd-0.19.21/src/output/plugins/WinmmOutputPlugin.cxx --- mpd-0.19.19/src/output/plugins/WinmmOutputPlugin.cxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/src/output/plugins/WinmmOutputPlugin.cxx 2016-11-07 07:53:39.000000000 +0000 @@ -148,10 +148,10 @@ } switch (audio_format.format) { - case SampleFormat::S8: case SampleFormat::S16: break; + case SampleFormat::S8: case SampleFormat::S24_P32: case SampleFormat::S32: case SampleFormat::FLOAT: diff -Nru mpd-0.19.19/src/queue/Queue.cxx mpd-0.19.21/src/queue/Queue.cxx --- mpd-0.19.19/src/queue/Queue.cxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/src/queue/Queue.cxx 2016-12-09 12:01:30.000000000 +0000 @@ -426,14 +426,15 @@ if (_order < (unsigned)after_order) { /* the specified song has been played already - - enqueue it only if its priority has just - become bigger than the current one's */ + - enqueue it only if its priority has been + increased and is now bigger than the + current one's */ const unsigned after_position = OrderToPosition(after_order); const Item *after_item = &items[after_position]; - if (old_priority > after_item->priority || + if (priority <= old_priority || priority <= after_item->priority) /* priority hasn't become bigger */ return true; diff -Nru mpd-0.19.19/src/storage/CompositeStorage.cxx mpd-0.19.21/src/storage/CompositeStorage.cxx --- mpd-0.19.19/src/storage/CompositeStorage.cxx 2016-08-23 07:47:48.000000000 +0000 +++ mpd-0.19.21/src/storage/CompositeStorage.cxx 2016-10-27 19:26:32.000000000 +0000 @@ -265,22 +265,13 @@ return result; } -CompositeStorage::FindResult -CompositeStorage::FindStorage(const char *uri, Error &error) const -{ - auto result = FindStorage(uri); - if (result.directory == nullptr) - error.Set(composite_domain, "No such directory"); - return result; -} - bool CompositeStorage::GetInfo(const char *uri, bool follow, FileInfo &info, Error &error) { const ScopeLock protect(mutex); - auto f = FindStorage(uri, error); + auto f = FindStorage(uri); if (f.directory->storage != nullptr && f.directory->storage->GetInfo(f.uri, follow, info, error)) return true; @@ -295,6 +286,8 @@ return true; } + if (!error.IsDefined()) + error.Set(composite_domain, "No such directory"); return false; } @@ -304,13 +297,15 @@ { const ScopeLock protect(mutex); - auto f = FindStorage(uri, error); + auto f = FindStorage(uri); const Directory *directory = f.directory->Find(f.uri); if (directory == nullptr || directory->children.empty()) { /* no virtual directories here */ - if (f.directory->storage == nullptr) + if (f.directory->storage == nullptr) { + error.Set(composite_domain, "No such directory"); return nullptr; + } return f.directory->storage->OpenDirectory(f.uri, error); } diff -Nru mpd-0.19.19/src/storage/CompositeStorage.hxx mpd-0.19.21/src/storage/CompositeStorage.hxx --- mpd-0.19.19/src/storage/CompositeStorage.hxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/src/storage/CompositeStorage.hxx 2016-10-27 17:55:20.000000000 +0000 @@ -45,7 +45,7 @@ */ struct Directory { /** - * The #Storage mounted n this virtual directory. All + * The #Storage mounted in this virtual directory. All * "leaf" Directory instances must have a #Storage. * Other Directory instances may have one, and child * mounts will be "mixed" in. @@ -155,9 +155,16 @@ } } + /** + * Follow the given URI path, and find the outermost directory + * which is a #Storage mount point. If there are no mounts, + * it returns the root directory (with a nullptr "storage" + * attribute, of course). FindResult::uri contains the + * remaining unused part of the URI (may be empty if all of + * the URI was used). + */ gcc_pure FindResult FindStorage(const char *uri) const; - FindResult FindStorage(const char *uri, Error &error) const; const char *MapToRelativeUTF8(const Directory &directory, const char *uri) const; diff -Nru mpd-0.19.19/src/tag/TagItem.hxx mpd-0.19.21/src/tag/TagItem.hxx --- mpd-0.19.19/src/tag/TagItem.hxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/src/tag/TagItem.hxx 2016-10-26 16:28:15.000000000 +0000 @@ -21,7 +21,6 @@ #define MPD_TAG_ITEM_HXX #include "TagType.h" -#include "Compiler.h" /** * One tag value. It is a mapping of #TagType to am arbitrary string @@ -35,11 +34,14 @@ /** * the value of this tag; this is a variable length string */ - char value[sizeof(long) - sizeof(type)]; + char value[1]; TagItem() = default; TagItem(const TagItem &other) = delete; TagItem &operator=(const TagItem &other) = delete; -} gcc_packed; +}; + +static_assert(sizeof(TagItem) == 2, "Unexpected size"); +static_assert(alignof(TagItem) == 1, "Unexpected alignment"); #endif diff -Nru mpd-0.19.19/src/tag/TagPool.cxx mpd-0.19.21/src/tag/TagPool.cxx --- mpd-0.19.19/src/tag/TagPool.cxx 2016-08-23 07:47:48.000000000 +0000 +++ mpd-0.19.21/src/tag/TagPool.cxx 2016-10-26 16:24:11.000000000 +0000 @@ -50,7 +50,7 @@ static TagPoolSlot *Create(TagPoolSlot *_next, TagType type, const char *value, size_t length); -} gcc_packed; +}; TagPoolSlot * TagPoolSlot::Create(TagPoolSlot *_next, TagType type, diff -Nru mpd-0.19.19/systemd/mpd.service.in mpd-0.19.21/systemd/mpd.service.in --- mpd-0.19.19/systemd/mpd.service.in 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/systemd/mpd.service.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -[Unit] -Description=Music Player Daemon -After=network.target sound.target - -[Service] -ExecStart=@prefix@/bin/mpd --no-daemon - -# allow MPD to use real-time priority 50 -LimitRTPRIO=50 -LimitRTTIME=infinity - -[Install] -WantedBy=multi-user.target diff -Nru mpd-0.19.19/systemd/mpd.socket mpd-0.19.21/systemd/mpd.socket --- mpd-0.19.19/systemd/mpd.socket 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/systemd/mpd.socket 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -[Socket] -ListenStream=/run/mpd/socket -ListenStream=6600 -Backlog=5 -KeepAlive=true -PassCredentials=true - -[Install] -WantedBy=sockets.target diff -Nru mpd-0.19.19/systemd/system/mpd.service.in mpd-0.19.21/systemd/system/mpd.service.in --- mpd-0.19.19/systemd/system/mpd.service.in 1970-01-01 00:00:00.000000000 +0000 +++ mpd-0.19.21/systemd/system/mpd.service.in 2016-12-09 09:48:44.000000000 +0000 @@ -0,0 +1,26 @@ +[Unit] +Description=Music Player Daemon +After=network.target sound.target + +[Service] +ExecStart=@prefix@/bin/mpd --no-daemon + +# allow MPD to use real-time priority 50 +LimitRTPRIO=50 +LimitRTTIME=infinity + +# disallow writing to /usr, /bin, /sbin, ... +ProtectSystem=yes + +# more paranoid security settings +NoNewPrivileges=yes +ProtectKernelTunables=yes +ProtectControlGroups=yes +ProtectKernelModules=yes +# AF_NETLINK is required by libsmbclient, or it will exit() .. *sigh* +RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK +RestrictNamespaces=yes + +[Install] +WantedBy=multi-user.target +Also=mpd.socket diff -Nru mpd-0.19.19/systemd/system/mpd.socket mpd-0.19.21/systemd/system/mpd.socket --- mpd-0.19.19/systemd/system/mpd.socket 1970-01-01 00:00:00.000000000 +0000 +++ mpd-0.19.21/systemd/system/mpd.socket 2016-07-29 08:01:52.000000000 +0000 @@ -0,0 +1,9 @@ +[Socket] +ListenStream=/run/mpd/socket +ListenStream=6600 +Backlog=5 +KeepAlive=true +PassCredentials=true + +[Install] +WantedBy=sockets.target diff -Nru mpd-0.19.19/systemd/user/mpd.service.in mpd-0.19.21/systemd/user/mpd.service.in --- mpd-0.19.19/systemd/user/mpd.service.in 1970-01-01 00:00:00.000000000 +0000 +++ mpd-0.19.21/systemd/user/mpd.service.in 2016-12-13 09:38:30.000000000 +0000 @@ -0,0 +1,29 @@ +[Unit] +Description=Music Player Daemon +After=network.target sound.target + +[Service] +ExecStart=@prefix@/bin/mpd --no-daemon + +# allow MPD to use real-time priority 50 +LimitRTPRIO=50 +LimitRTTIME=infinity + +# disallow writing to /usr, /bin, /sbin, ... +ProtectSystem=yes + +# more paranoid security settings +NoNewPrivileges=yes +ProtectKernelTunables=yes +ProtectControlGroups=yes +# AF_NETLINK is required by libsmbclient, or it will exit() .. *sigh* +RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK +RestrictNamespaces=yes + +# Note that "ProtectKernelModules=yes" is missing in the user unit +# because systemd 232 is unable to reduce its own capabilities +# ("Failed at step CAPABILITIES spawning /usr/bin/mpd: Operation not +# permitted") + +[Install] +WantedBy=default.target diff -Nru mpd-0.19.19/test/test_queue_priority.cxx mpd-0.19.21/test/test_queue_priority.cxx --- mpd-0.19.19/test/test_queue_priority.cxx 2016-07-29 08:01:52.000000000 +0000 +++ mpd-0.19.21/test/test_queue_priority.cxx 2016-12-13 07:36:02.000000000 +0000 @@ -164,21 +164,6 @@ check_descending_priority(&queue, current_order + 1); - /* priority=60 for the old prio50 item; must not be moved, - because it's before the current song, and it's status - hasn't changed (it was already higher before) */ - - unsigned c_order = 0; - unsigned c_position = queue.OrderToPosition(c_order); - CPPUNIT_ASSERT_EQUAL(50u, unsigned(queue.items[c_position].priority)); - queue.SetPriority(c_position, 60, current_order); - - current_order = queue.PositionToOrder(current_position); - CPPUNIT_ASSERT_EQUAL(3u, current_order); - - c_order = queue.PositionToOrder(c_position); - CPPUNIT_ASSERT_EQUAL(0u, c_order); - /* move the prio=20 item back */ a_order = queue.PositionToOrder(a_position);