diff options
Diffstat (limited to 'media-sound/murmur/files/strict_version.patch')
-rw-r--r-- | media-sound/murmur/files/strict_version.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/media-sound/murmur/files/strict_version.patch b/media-sound/murmur/files/strict_version.patch new file mode 100644 index 0000000..544e9fd --- /dev/null +++ b/media-sound/murmur/files/strict_version.patch @@ -0,0 +1,38 @@ +diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp +index f8472fa3..97d4de2a 100644 +--- a/src/murmur/Messages.cpp ++++ b/src/murmur/Messages.cpp +@@ -1492,8 +1492,14 @@ void Server::msgContextAction(ServerUser *uSource, MumbleProto::ContextAction &m + } + + void Server::msgVersion(ServerUser *uSource, MumbleProto::Version &msg) { ++ bool ok = true; + if (msg.has_version()) + uSource->uiVersion=msg.version(); ++ else ++ ok = false; ++ if(ok) ++ if(msg.version() < 0x010300) ++ ok = false; + if (msg.has_release()) + uSource->qsRelease = u8(msg.release()); + if (msg.has_os()) { +@@ -1501,6 +1507,18 @@ void Server::msgVersion(ServerUser *uSource, MumbleProto::Version &msg) { + if (msg.has_os_version()) + uSource->qsOSVersion = u8(msg.os_version()); + } ++ if (! ok) { ++ QString reason = "worng version"; ++ log(uSource, QString("Rejected connection from %1: %2") ++ .arg(addressToString(uSource->peerAddress(), uSource->peerPort()), reason)); ++ MumbleProto::Reject mpr; ++ mpr.set_reason(u8(reason)); ++ mpr.set_type(MumbleProto::Reject::RejectType::Reject_RejectType_WrongVersion); ++ sendMessage(uSource, mpr); ++ uSource->disconnectSocket(); ++ return; ++ } ++ + + log(uSource, QString("Client version %1 (%2: %3)").arg(MumbleVersion::toString(uSource->uiVersion)).arg(uSource->qsOS).arg(uSource->qsRelease)); + } |