mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-23 18:14:51 +08:00
murmur: new version
This commit is contained in:
parent
50ad6b3d1b
commit
4e5a2fcf7d
@ -1,42 +0,0 @@
|
||||
commit 6b33dda344f89e5a039b7d79eb43925040654242
|
||||
Author: Benjamin Jemlich <pcgod@users.sourceforge.net>
|
||||
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<msg.names_size();++i) {
|
||||
QString name = u8(msg.names(i));
|
||||
+ if (!validateUserName(name)) {
|
||||
+ continue;
|
||||
+ }
|
||||
int id = getUserID(name);
|
||||
if (id >= 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();
|
@ -1,36 +0,0 @@
|
||||
commit 5c40cfeb4b5f8911df926c19f2dd628703840f64
|
||||
Author: Stefan Hacker <dd0t@users.sourceforge.net>
|
||||
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<msg.names_size();++i) {
|
||||
QString name = u8(msg.names(i));
|
||||
- if (!validateUserName(name)) {
|
||||
- continue;
|
||||
- }
|
||||
int id = getUserID(name);
|
||||
if (id >= 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;
|
@ -4,53 +4,45 @@
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
|
||||
# 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/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|" \
|
||||
@ -60,19 +52,27 @@ package() {
|
||||
-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"
|
||||
|
||||
# vim: sw=2:ts=2 et:
|
||||
# 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"
|
||||
}
|
||||
|
@ -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() {
|
||||
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
|
||||
}
|
||||
|
@ -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
|
||||
|
13
murmur/murmur.service
Normal file
13
murmur/murmur.service
Normal file
@ -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
|
1
murmur/murmur.tmpfiles.conf
Normal file
1
murmur/murmur.tmpfiles.conf
Normal file
@ -0,0 +1 @@
|
||||
d /run/murmur 0775 murmur murmur -
|
Loading…
Reference in New Issue
Block a user