From d92f5d4bb5df460f65b7ff293722c6c4c27f6461 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Tue, 14 Apr 2020 11:53:38 +0200 Subject: [PATCH 1/5] Removed unneeded files --- server/environment/geoloc | 1 - server/environment/providers | 1 - server/environment/resources | 1 - server/repro/env/TeaSpeakServer | 1 - server/repro/env/certs | 1 - server/repro/env/commanddocs | 1 - server/repro/env/geoloc | 1 - server/repro/env/install_music.sh | 1 - server/repro/env/providers | 1 - server/repro/env/resources | 1 - server/repro/env/tealoop.sh | 1 - server/repro/env/teastart.sh | 1 - server/repro/env/teastart_autorestart.sh | 1 - server/repro/env/teastart_minimal.sh | 1 - 14 files changed, 14 deletions(-) delete mode 120000 server/environment/geoloc delete mode 120000 server/environment/providers delete mode 120000 server/environment/resources delete mode 120000 server/repro/env/TeaSpeakServer delete mode 120000 server/repro/env/certs delete mode 120000 server/repro/env/commanddocs delete mode 120000 server/repro/env/geoloc delete mode 120000 server/repro/env/install_music.sh delete mode 120000 server/repro/env/providers delete mode 120000 server/repro/env/resources delete mode 120000 server/repro/env/tealoop.sh delete mode 120000 server/repro/env/teastart.sh delete mode 120000 server/repro/env/teastart_autorestart.sh delete mode 120000 server/repro/env/teastart_minimal.sh diff --git a/server/environment/geoloc b/server/environment/geoloc deleted file mode 120000 index 6be1434..0000000 --- a/server/environment/geoloc +++ /dev/null @@ -1 +0,0 @@ -../repro/env/geoloc/ \ No newline at end of file diff --git a/server/environment/providers b/server/environment/providers deleted file mode 120000 index c041e20..0000000 --- a/server/environment/providers +++ /dev/null @@ -1 +0,0 @@ -../../music/bin/providers/ \ No newline at end of file diff --git a/server/environment/resources b/server/environment/resources deleted file mode 120000 index 9cca8cc..0000000 --- a/server/environment/resources +++ /dev/null @@ -1 +0,0 @@ -../repro/env/resources/ \ No newline at end of file diff --git a/server/repro/env/TeaSpeakServer b/server/repro/env/TeaSpeakServer deleted file mode 120000 index ce88778..0000000 --- a/server/repro/env/TeaSpeakServer +++ /dev/null @@ -1 +0,0 @@ -../../environment/TeaSpeakServer \ No newline at end of file diff --git a/server/repro/env/certs b/server/repro/env/certs deleted file mode 120000 index 7a4f740..0000000 --- a/server/repro/env/certs +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/certs/ \ No newline at end of file diff --git a/server/repro/env/commanddocs b/server/repro/env/commanddocs deleted file mode 120000 index 4891fe4..0000000 --- a/server/repro/env/commanddocs +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/commanddocs/ \ No newline at end of file diff --git a/server/repro/env/geoloc b/server/repro/env/geoloc deleted file mode 120000 index f3e1b9d..0000000 --- a/server/repro/env/geoloc +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/geoloc/ \ No newline at end of file diff --git a/server/repro/env/install_music.sh b/server/repro/env/install_music.sh deleted file mode 120000 index f99f7ee..0000000 --- a/server/repro/env/install_music.sh +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/install_music.sh \ No newline at end of file diff --git a/server/repro/env/providers b/server/repro/env/providers deleted file mode 120000 index 4dedb55..0000000 --- a/server/repro/env/providers +++ /dev/null @@ -1 +0,0 @@ -../../../music/bin/providers/ \ No newline at end of file diff --git a/server/repro/env/resources b/server/repro/env/resources deleted file mode 120000 index bb21fde..0000000 --- a/server/repro/env/resources +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/resources/ \ No newline at end of file diff --git a/server/repro/env/tealoop.sh b/server/repro/env/tealoop.sh deleted file mode 120000 index bea769c..0000000 --- a/server/repro/env/tealoop.sh +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/tealoop.sh \ No newline at end of file diff --git a/server/repro/env/teastart.sh b/server/repro/env/teastart.sh deleted file mode 120000 index 0d98912..0000000 --- a/server/repro/env/teastart.sh +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/teastart.sh \ No newline at end of file diff --git a/server/repro/env/teastart_autorestart.sh b/server/repro/env/teastart_autorestart.sh deleted file mode 120000 index 8f17a38..0000000 --- a/server/repro/env/teastart_autorestart.sh +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/teastart_autorestart.sh \ No newline at end of file diff --git a/server/repro/env/teastart_minimal.sh b/server/repro/env/teastart_minimal.sh deleted file mode 120000 index 7536805..0000000 --- a/server/repro/env/teastart_minimal.sh +++ /dev/null @@ -1 +0,0 @@ -../../../git-teaspeak/default_files/teastart_minimal.sh \ No newline at end of file From bb935dd214cc98edbcc5a7dec064494b6ebe6444 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 15 Apr 2020 15:02:59 +0200 Subject: [PATCH 2/5] Fixed some crashes (1.4.12b4) --- MusicBot/src/MusicPlayer.cpp | 7 ++++++- git-teaspeak | 2 +- music | 2 +- server/environment/resources | 1 - server/src/client/voice/VoiceClientConnection.cpp | 7 +++++++ shared | 2 +- 6 files changed, 16 insertions(+), 5 deletions(-) delete mode 120000 server/environment/resources diff --git a/MusicBot/src/MusicPlayer.cpp b/MusicBot/src/MusicPlayer.cpp index 1af89c9..d7ab79f 100644 --- a/MusicBot/src/MusicPlayer.cpp +++ b/MusicBot/src/MusicPlayer.cpp @@ -78,11 +78,16 @@ void manager::loadProviders(const std::string& path) { } deque paths; - for(const auto& entry : fs::directory_iterator(dir)){ + error_code error_code{}; + for(const auto& entry : fs::directory_iterator(dir, error_code)){ if(!entry.path().has_extension()) continue; if(entry.path().extension().string() == ".so") paths.push_back(entry.path()); } + if(error_code) { + log::log(log::err, "Failed to scan the target directory (" + dir.string() + "): " + error_code.message()); + return; + } std::sort(paths.begin(), paths.end(), [](const fs::path& a, const fs::path& b){ return a.filename().string() < b.filename().string(); }); int index = 0; diff --git a/git-teaspeak b/git-teaspeak index cc874a4..e7befd4 160000 --- a/git-teaspeak +++ b/git-teaspeak @@ -1 +1 @@ -Subproject commit cc874a443ac40fabf0342b410dae5ae46045fa4f +Subproject commit e7befd4fc9c96b966b459ea5ad8530dc8fe9345b diff --git a/music b/music index 7ef7ea7..8e1ce32 160000 --- a/music +++ b/music @@ -1 +1 @@ -Subproject commit 7ef7ea785aebc26d3f9c6e396270e7b03eccf587 +Subproject commit 8e1ce32ae0b03f54efc54e76cd118cf01057159c diff --git a/server/environment/resources b/server/environment/resources deleted file mode 120000 index 9cca8cc..0000000 --- a/server/environment/resources +++ /dev/null @@ -1 +0,0 @@ -../repro/env/resources/ \ No newline at end of file diff --git a/server/src/client/voice/VoiceClientConnection.cpp b/server/src/client/voice/VoiceClientConnection.cpp index eed6e7a..0549e40 100644 --- a/server/src/client/voice/VoiceClientConnection.cpp +++ b/server/src/client/voice/VoiceClientConnection.cpp @@ -369,6 +369,13 @@ bool VoiceClientConnection::next_reassembled_command(unique_lockclient->getServerId(), "{} Failed to calculate decompressed size for received command. Dropping packet.", CLIENT_STR_LOG_PREFIX_(this->client)); + return false; + } else if(decompressed_size > 20 * 1024 * 1024) { /* max 20MB */ + logTrace(this->client->getServerId(), "{} Command packet has a too large compressed size. Dropping packet.", CLIENT_STR_LOG_PREFIX_(this->client)); + return false; + } auto buffer = buffer::allocate_buffer(decompressed_size); if(!compression::qlz_decompress_payload(payload.data_ptr(), buffer.data_ptr(), &decompressed_size)) { logTrace(this->client->getServerId(), "{} Failed to decompress received command. Dropping packet.", CLIENT_STR_LOG_PREFIX_(this->client)); diff --git a/shared b/shared index ee7f26b..16c2272 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit ee7f26b7ed883027f0a81ece1c2aacd41053ce1e +Subproject commit 16c2272fe4b479c55e6db6642d039a42b0774325 From afa2b40b50ac5bfe09d09e19b59a3c314ec421a5 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 15 Apr 2020 15:14:00 +0200 Subject: [PATCH 3/5] Fixed build script --- server/repro/build.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/repro/build.sh b/server/repro/build.sh index 5c46d98..80c4649 100755 --- a/server/repro/build.sh +++ b/server/repro/build.sh @@ -6,6 +6,18 @@ if [[ -z "${BUILD_PATH}" ]]; then exit 1 fi +rm -r env +mkdir env && de env +[[ $? -ne 0 ]] && { + echo "Failed to create the env" + exit 1 +} +cp -r ../../../git-teaspeak/default_files/{certs,commanddocs,geoloc,resources,*.sh} . +[[ $? -ne 0 ]] && { + echo "Failed to copy env" + exit 1 +} + ./generate_version.sh "${BUILD_PATH}" || { echo "Failed to generate version! ($?)" exit 1 From b7cbf4b20aa1ffcc71c720c52fcffb1d46b7ecac Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 15 Apr 2020 15:16:42 +0200 Subject: [PATCH 4/5] Updated env build script --- server/repro/build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/repro/build.sh b/server/repro/build.sh index 80c4649..914cdc9 100755 --- a/server/repro/build.sh +++ b/server/repro/build.sh @@ -17,6 +17,12 @@ cp -r ../../../git-teaspeak/default_files/{certs,commanddocs,geoloc,resources,*. echo "Failed to copy env" exit 1 } + cp ../../environment/TeaSpeakServer . +[[ $? -ne 0 ]] && { + echo "Failed to copy server" + exit 1 +} +cd .. ./generate_version.sh "${BUILD_PATH}" || { echo "Failed to generate version! ($?)" From 6d19526458e38413897dfac95e911466369c3e97 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 15 Apr 2020 15:56:16 +0200 Subject: [PATCH 5/5] Fixed build script --- server/repro/build.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/repro/build.sh b/server/repro/build.sh index 914cdc9..8e66b5f 100755 --- a/server/repro/build.sh +++ b/server/repro/build.sh @@ -12,12 +12,19 @@ mkdir env && de env echo "Failed to create the env" exit 1 } -cp -r ../../../git-teaspeak/default_files/{certs,commanddocs,geoloc,resources,*.sh} . +cp -r ../../../git-teaspeak/default_files/{certs,commanddocs,geoloc,resources,,*.sh} . [[ $? -ne 0 ]] && { echo "Failed to copy env" exit 1 } - cp ../../environment/TeaSpeakServer . + +cp -r ../../../music/providers . +[[ $? -ne 0 ]] && { + echo "Failed to copy providers" + exit 1 +} +# +cp ../../environment/TeaSpeakServer . [[ $? -ne 0 ]] && { echo "Failed to copy server" exit 1