summaryrefslogtreecommitdiff
path: root/community/murmur/0004-fix-username-validation.patch
blob: 493f78ba560b575856f4770a11761ad55df57ba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;