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 df91da7..e7befd4 160000 --- a/git-teaspeak +++ b/git-teaspeak @@ -1 +1 @@ -Subproject commit df91da75149777e774da60e948439ef426a690dc +Subproject commit e7befd4fc9c96b966b459ea5ad8530dc8fe9345b 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/build.sh b/server/repro/build.sh index 5c46d98..8e66b5f 100755 --- a/server/repro/build.sh +++ b/server/repro/build.sh @@ -6,6 +6,31 @@ 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 +} + +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 +} +cd .. + ./generate_version.sh "${BUILD_PATH}" || { echo "Failed to generate version! ($?)" exit 1 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 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 707736d..16c2272 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit 707736d896f46489133e6da6b7543238274c37e6 +Subproject commit 16c2272fe4b479c55e6db6642d039a42b0774325