diff --git a/murmur/0003-fix-long-username-query.patch b/murmur/0003-fix-long-username-query.patch deleted file mode 100644 index 2fc52f70c..000000000 --- a/murmur/0003-fix-long-username-query.patch +++ /dev/null @@ -1,42 +0,0 @@ -commit 6b33dda344f89e5a039b7d79eb43925040654242 -Author: Benjamin Jemlich -Date: Tue Jun 29 14:49:14 2010 +0200 - - Don't crash on long usernames - -diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp -index f12867a..de307ea 100644 ---- a/src/murmur/Messages.cpp -+++ b/src/murmur/Messages.cpp -@@ -1231,6 +1231,9 @@ void Server::msgQueryUsers(ServerUser *uSource, MumbleProto::QueryUsers &msg) { - - for (int i=0;i= 0) { - name = getUserName(id); -diff --git a/src/murmur/ServerDB.cpp b/src/murmur/ServerDB.cpp -index 11b6906..7e15def 100644 ---- a/src/murmur/ServerDB.cpp -+++ b/src/murmur/ServerDB.cpp -@@ -810,7 +810,7 @@ int Server::authenticate(QString &name, const QString &pw, const QStringList &em - TransactionHolder th; - QSqlQuery &query = *th.qsqQuery; - -- SQLPREP("SELECT `user_id`,`name`,`pw` FROM `%1users` WHERE `server_id` = ? AND `name` like ?"); -+ SQLPREP("SELECT `user_id`,`name`,`pw` FROM `%1users` WHERE `server_id` = ? AND LOWER(`name`) = LOWER(?)"); - query.addBindValue(iServerNum); - query.addBindValue(name); - SQLEXEC(); -@@ -1051,7 +1051,7 @@ int Server::getUserID(const QString &name) { - TransactionHolder th; - - QSqlQuery &query = *th.qsqQuery; -- SQLPREP("SELECT `user_id` FROM `%1users` WHERE `server_id` = ? AND `name` like ?"); -+ SQLPREP("SELECT `user_id` FROM `%1users` WHERE `server_id` = ? AND LOWER(`name`) = LOWER(?)"); - query.addBindValue(iServerNum); - query.addBindValue(name); - SQLEXEC(); diff --git a/murmur/0004-fix-username-validation.patch b/murmur/0004-fix-username-validation.patch deleted file mode 100644 index 493f78ba5..000000000 --- a/murmur/0004-fix-username-validation.patch +++ /dev/null @@ -1,36 +0,0 @@ -commit 5c40cfeb4b5f8911df926c19f2dd628703840f64 -Author: Stefan Hacker -Date: Tue Jun 29 23:39:16 2010 +0200 - - Don't validate the name before we are sure it wasn't already validated by an authenticator - -diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp -index de307ea..f12867a 100644 ---- a/src/murmur/Messages.cpp -+++ b/src/murmur/Messages.cpp -@@ -1231,9 +1231,6 @@ void Server::msgQueryUsers(ServerUser *uSource, MumbleProto::QueryUsers &msg) { - - for (int i=0;i= 0) { - name = getUserName(id); -diff --git a/src/murmur/ServerDB.cpp b/src/murmur/ServerDB.cpp -index 7e15def..70b4ca4 100644 ---- a/src/murmur/ServerDB.cpp -+++ b/src/murmur/ServerDB.cpp -@@ -1048,6 +1048,11 @@ int Server::getUserID(const QString &name) { - qhUserNameCache.insert(id, name); - return id; - } -+ -+ if (!validateUserName(name)) { -+ return id; -+ } -+ - TransactionHolder th; - - QSqlQuery &query = *th.qsqQuery; diff --git a/murmur/PKGBUILD b/murmur/PKGBUILD index cf3bef738..eadf43c9b 100644 --- a/murmur/PKGBUILD +++ b/murmur/PKGBUILD @@ -4,75 +4,75 @@ # maintainer (i686): Phil Miller # maintainer (x86_64): Manuel Tortosa -# include global config -source ../_buildscripts/${current_repo}-${_arch}-cfg.conf - pkgname=murmur -pkgver=1.2.2 +pkgver=1.2.3 pkgrel=1 pkgdesc="The voice chat application server for Mumble" arch=('i686' 'x86_64') url="http://mumble.sourceforge.net" license=('GPL') -depends=('avahi' 'lsb-release' 'protobuf' 'qt>=4.4.0') +depends=('avahi' 'lsb-release' 'protobuf' 'qt>=4.4.0' 'icu') makedepends=('boost') conflicts=('murmur-ice' 'murmur-static' 'murmur-git') categories=('communication') backup=("etc/murmur.ini" - "etc/logrotate.d/murmur" - "etc/conf.d/murmur" ) -install="murmur.install" -source=("http://downloads.sourceforge.net/mumble/mumble-$pkgver.tar.gz" + "etc/logrotate.d/murmur" + "etc/conf.d/murmur") +install="${pkgname}.install" +source=("http://downloads.sourceforge.net/mumble/mumble-${pkgver}.tar.gz" "murmur.rc.d" "murmur.conf.d" "murmur.dbus.conf" "murmur.logrotate.d" - "0003-fix-long-username-query.patch" - "0004-fix-username-validation.patch" -) -md5sums=('de30ee85170e183b66568b53b04c5727' - 'b99061be67c54bf0bb4a061fd1280281' - '11c1cc875e8021739ec2087252cf0533' - 'eddea4cdbd0bde4b960a67e16b5d5478' - 'c56726cb267ead68f37f35c28e36e6fa' - '6285045568457cd4858232d9c2b23616' - '088ade43d532f37c3d989590c0e428ab') + "murmur.service" + "murmur.tmpfiles.conf") +sha256sums=('05895122ae4abec3fb62ef24ed9d167ffd768e7080ed179c8bf3afca96d18a5c' + '6278deb8376922f27b169a48f908846087edcda3c4a967002e5f64193d48d785' + '44b4d0e63cadff37d94043bca5e63cfef2a49d16862c7dee99efd377ce5c4fa9' + '472c5be5aaa6a954c5327e747a9cac75851595adff3fdb81e9abd620329d3bf5' + '56dc6bb5b7d199dfc444ba2e23a51687263a6244beaaa1e998024314698fd79f' + 'f7b5e69f4baa1167ce1af54731d1c12193f937ab43c8f567e1bfd30009abd2a3' + 'c33388d062d5b0fa8cc46d4c45c6484ee6485f771dc33fa05e22c0e0a0a9f147') build() { - cd ${srcdir}/mumble-$pkgver - - # Le security fixes. - patch -Np1 < "${srcdir}/0003-fix-long-username-query.patch" - patch -Np1 < "${srcdir}/0004-fix-username-validation.patch" + cd "${srcdir}/mumble-${pkgver}" qmake main.pro CONFIG+="no-client no-ice" - make + make release } package() { - cd ${srcdir}/mumble-$pkgver + cd "${srcdir}/mumble-${pkgver}" - sed -e "1i# vi:ft=cfg" \ - -e "s|database=|database=/var/lib/murmur/murmur.sqlite|" \ - -e "s|dbus=session|#dbus=system|" \ - -e "s|#logfile=murmur.log|logfile=/var/log/murmur/murmur.log|" \ - -e "s|#pidfile=|pidfile=/var/run/murmur/murmur.pid|" \ - -e "s|#uname=|uname=murmur|" \ - -i scripts/murmur.ini + sed -e "1i# vi:ft=cfg" \ + -e "s|database=|database=/var/lib/murmur/murmur.sqlite|" \ + -e "s|dbus=session|#dbus=system|" \ + -e "s|#logfile=murmur.log|logfile=/var/log/murmur/murmur.log|" \ + -e "s|#pidfile=|pidfile=/var/run/murmur/murmur.pid|" \ + -e "s|#uname=|uname=murmur|" \ + -i scripts/murmur.ini - install -dm755 ${pkgdir}/var/lib/murmur - install -dm755 ${pkgdir}/var/log/murmur - install -dm755 ${pkgdir}/var/run/murmur - install -Dm755 release/murmurd ${pkgdir}/usr/sbin/murmurd - install -Dm644 scripts/murmur.ini ${pkgdir}/etc/murmur.ini - install -Dm755 ${srcdir}/murmur.rc.d ${pkgdir}/etc/rc.d/murmur - install -Dm644 ${srcdir}/murmur.conf.d ${pkgdir}/etc/conf.d/murmur - install -Dm644 ${srcdir}/murmur.dbus.conf \ - ${pkgdir}/etc/dbus-1/system.d/murmur.conf - install -Dm644 ${srcdir}/murmur.logrotate.d \ - ${pkgdir}/etc/logrotate.d/murmur - install -Dm644 README ${pkgdir}/usr/share/doc/murmur/README - install -Dm644 man/murmurd.1 ${pkgdir}/usr/share/man/man1/murmurd.1 + # Create directories + install -dm755 "${pkgdir}/var/lib/murmur" + install -dm755 "${pkgdir}/var/log/murmur" + + # Install executable + install -Dm755 "release/murmurd" "${pkgdir}/usr/sbin/murmurd" + + # Install rc.d script + install -Dm755 "${srcdir}/murmur.rc.d" "${pkgdir}/etc/rc.d/murmur" + + # Install Systemd units + install -Dm644 ${srcdir}/murmur.tmpfiles.conf ${pkgdir}/usr/lib/tmpfiles.d/murmur.conf + install -Dm644 ${srcdir}/murmur.service ${pkgdir}/usr/lib/systemd/system/murmur.service + + # Copy config files + install -Dm644 "scripts/murmur.ini" "${pkgdir}/etc/murmur.ini" + install -Dm644 "${srcdir}/murmur.conf.d" "${pkgdir}/etc/conf.d/murmur" + install -Dm644 "${srcdir}/murmur.dbus.conf" "${pkgdir}/etc/dbus-1/system.d/murmur.conf" + install -Dm644 "${srcdir}/murmur.logrotate.d" "${pkgdir}/etc/logrotate.d/murmur" + + # Install Readme and man page + install -Dm644 README "${pkgdir}/usr/share/doc/murmur/README" + install -Dm644 man/murmurd.1 "${pkgdir}/usr/share/man/man1/murmurd.1" } - -# vim: sw=2:ts=2 et: diff --git a/murmur/murmur.install b/murmur/murmur.install index 9e1446d2e..f44210021 100644 --- a/murmur/murmur.install +++ b/murmur/murmur.install @@ -2,14 +2,14 @@ post_install() { # bug: dbus reload here doesn't work # workaround: it seems to work if you do it a few seconds later, manually - /etc/rc.d/dbus reload > /dev/null + reload_dbus - /usr/bin/getent group murmur > /dev/null || /usr/sbin/groupadd murmur + /usr/bin/getent group murmur > /dev/null || \ + /usr/sbin/groupadd -r -g 86 murmur 1>/dev/null /usr/bin/getent passwd murmur > /dev/null || \ - /usr/sbin/useradd -d /var/lib/murmur -g murmur -s /bin/false murmur + /usr/sbin/useradd -r -u 86 -d /var/lib/murmur -g murmur -s /bin/false murmur 1>/dev/null chown -R murmur:murmur /var/lib/murmur - chown -R murmur:murmur /var/run/murmur chown -R murmur:murmur /var/log/murmur echo @@ -22,12 +22,26 @@ post_upgrade() { } pre_remove() { - [ -f /var/run/daemons/murmur ] && /etc/rc.d/murmur stop > /dev/null + systemd-notify + + if [[ "$?" -eq 0 ]]; then + [ -f /var/run/daemons/murmur ] && systemctl stop murmur.service + else + [ -f /var/run/daemons/murmur ] && /etc/rc.d/murmur stop > /dev/null + fi killall -u murmur -5 sleep 1 } post_remove() { - /etc/rc.d/dbus reload > /dev/null - /usr/sbin/userdel murmur > /dev/null + reload_dbus + getent passwd murmur > /dev/null && userdel murmur 1>/dev/null + getent group murmur > /dev/null && groupdel murmur 1>/dev/null +} + +reload_dbus() { + /usr/bin/dbus-send \ + --system --type=method_call \ + --dest=org.freedesktop.DBus \ + /org.freedesktop.DBus.ReloadConfig } diff --git a/murmur/murmur.logrotate.d b/murmur/murmur.logrotate.d index e113175ab..d597b38a4 100644 --- a/murmur/murmur.logrotate.d +++ b/murmur/murmur.logrotate.d @@ -1,6 +1,6 @@ /var/log/murmur/murmur.log { missingok postrotate - /bin/kill -HUP `cat /var/run/murmur/murmur.pid 2>/dev/null` 2> /dev/null || true + /bin/kill -HUP `cat /var/run/murmur/murmur.pid 2>/dev/null` 2> /dev/null || true endscript } diff --git a/murmur/murmur.rc.d b/murmur/murmur.rc.d index 7a41e77da..ffa1fbd10 100644 --- a/murmur/murmur.rc.d +++ b/murmur/murmur.rc.d @@ -11,6 +11,10 @@ PID=$(pidof -o %PPID /usr/sbin/murmurd) case "$1" in start) stat_busy "Starting murmur" + + [ -d /var/run/murmur ] || mkdir -p /var/run/murmur + chown murmur:murmur /var/run/murmur + [ -z "$PID" ] && /usr/sbin/murmurd $PARAMS if [ $? -gt 0 ]; then stat_fail diff --git a/murmur/murmur.service b/murmur/murmur.service new file mode 100644 index 000000000..60670f9fb --- /dev/null +++ b/murmur/murmur.service @@ -0,0 +1,13 @@ +[Unit] +Description=Mumble Daemon +After=network.target + +[Service] +Type=forking +PIDFile=/run/murmur/murmur.pid +EnvironmentFile=/etc/conf.d/murmur +ExecStart=/usr/sbin/murmurd $PARAMS +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/murmur/murmur.tmpfiles.conf b/murmur/murmur.tmpfiles.conf new file mode 100644 index 000000000..03e50e995 --- /dev/null +++ b/murmur/murmur.tmpfiles.conf @@ -0,0 +1 @@ +d /run/murmur 0775 murmur murmur - \ No newline at end of file