From fc7a7f3f35c36318bb658f94be5a737a1e8c3592 Mon Sep 17 00:00:00 2001 From: Andreas Rogge Date: Tue, 28 Apr 2020 16:33:06 +0200 Subject: [PATCH] filed: remove support for bVarDistName The plugin interface allowed to query the platform, distribution and version of the filedaemon using bVarDistName. This has not been used by any plugin and the provided value was of questionable quality. This patch removes support for bVarDistName. Querying it will now raise an error. The related dist_name from message.cc that was used solely for this purpose has also been removed. --- core/src/filed/fd_plugins.cc | 5 ++--- core/src/lib/message.cc | 1 - core/src/tests/test_fd_plugins.cc | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/src/filed/fd_plugins.cc b/core/src/filed/fd_plugins.cc index c7ebef147cf..aa71a35db02 100644 --- a/core/src/filed/fd_plugins.cc +++ b/core/src/filed/fd_plugins.cc @@ -61,7 +61,6 @@ extern boffset_t (*plugin_blseek)(BareosWinFilePacket* bfd, int whence); extern char* exepath; -extern char* dist_name; namespace filedaemon { @@ -2077,8 +2076,8 @@ static bRC bareosGetValue(bpContext* ctx, bVariable var, void* value) *(const char**)value = kBareosVersionStrings.FullWithDate; break; case bVarDistName: - *(char**)value = dist_name; - break; + /* removed, as this value was never used by any plugin */ + return bRC_Error; default: if (!ctx) { /* Other variables need context */ return bRC_Error; diff --git a/core/src/lib/message.cc b/core/src/lib/message.cc index adc7acd0eda..26eeba97da0 100644 --- a/core/src/lib/message.cc +++ b/core/src/lib/message.cc @@ -53,7 +53,6 @@ int debug_level = 0; /* debug level */ bool dbg_timestamp = false; /* print timestamp in debug output */ bool prt_kaboom = false; /* Print kaboom output */ utime_t daemon_start_time = 0; /* Daemon start time */ -const char* dist_name = PLATFORM " " DISTVER; char my_name[128] = {0}; /* daemon name is stored here */ char host_name[256] = {0}; /* host machine name */ char* exepath = (char*)NULL; diff --git a/core/src/tests/test_fd_plugins.cc b/core/src/tests/test_fd_plugins.cc index 1cbc8ee5596..bc1cc34dfcb 100644 --- a/core/src/tests/test_fd_plugins.cc +++ b/core/src/tests/test_fd_plugins.cc @@ -70,7 +70,6 @@ extern boffset_t (*plugin_blseek)(BareosWinFilePacket* bfd, extern char* exepath; extern char* version; -extern char* dist_name; namespace filedaemon {