From eb28846737c3d038d5d4be2ee91ae12223b5d259 Mon Sep 17 00:00:00 2001 From: Salil Chandra Date: Tue, 12 May 2026 11:45:22 -0400 Subject: [PATCH] {183667510} Update -C qa to remove externalauth tunable Signed-off-by: Salil Chandra --- tools/comdb2ar/comdb2ar.cpp | 3 +++ tools/comdb2ar/comdb2ar.h | 1 + tools/comdb2ar/deserialise.cpp | 25 +++++++++++++++++-------- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/tools/comdb2ar/comdb2ar.cpp b/tools/comdb2ar/comdb2ar.cpp index 625c325ca7..4b08878350 100644 --- a/tools/comdb2ar/comdb2ar.cpp +++ b/tools/comdb2ar/comdb2ar.cpp @@ -98,6 +98,7 @@ int main(int argc, char *argv[]) bool support_files_only = false; bool strip_cluster_info = false; bool strip_consumer_info = false; + bool strip_external_auth = false; bool run_full_recovery = true; bool run_with_done_file = false; bool force_mode = false; @@ -155,6 +156,7 @@ int main(int argc, char *argv[]) } else if(std::strcmp(optarg, "qa") == 0) { strip_consumer_info = true; strip_cluster_info = true; + strip_external_auth = true; } else { std::cerr << "Unrecognised parameter to -C: " << optarg << std::endl; @@ -346,6 +348,7 @@ int main(int argc, char *argv[]) p_datadest, strip_cluster_info, strip_consumer_info, + strip_external_auth, run_full_recovery, comdb2_task, percent_full, diff --git a/tools/comdb2ar/comdb2ar.h b/tools/comdb2ar/comdb2ar.h index 1ed9b1a97d..e7dd3437f4 100644 --- a/tools/comdb2ar/comdb2ar.h +++ b/tools/comdb2ar/comdb2ar.h @@ -126,6 +126,7 @@ void deserialise_database( const std::string *p_datadestdir, bool strip_cluster_info, bool strip_consumer_info, + bool strip_external_auth, bool run_full_recovery, const std::string& comdb2_task, unsigned percent_full, diff --git a/tools/comdb2ar/deserialise.cpp b/tools/comdb2ar/deserialise.cpp index 326b9c6632..ffe155e412 100644 --- a/tools/comdb2ar/deserialise.cpp +++ b/tools/comdb2ar/deserialise.cpp @@ -173,6 +173,7 @@ static void process_lrl( const std::string& lrltext, bool strip_cluster_info, bool strip_consumer_info, + bool strip_external_auth, std::string& datadestdir, const std::string& lrldestdir, std::string& dbname, @@ -202,6 +203,14 @@ static void process_lrl( std::string tok; if(liness >> tok) { + std::string config_tok(tok); + if(tok == "if") { + std::string machine_type; + liness >> machine_type; + if(!(liness >> config_tok)) { + config_tok.clear(); + } + } if(tok == "name" && dbname.empty()) { // Get the db name from the first lrl file found, @@ -287,18 +296,17 @@ static void process_lrl( // changes tok, it needs to be the last test line.insert(0, "# "); } else if (strip_consumer_info) { - if (tok == "if") { - liness >> tok; /* consume machine type */ - liness >> tok; /* read real option */ - } - - if (tok == "queue" || tok == "procedure" || tok == "consumer") + if (config_tok == "queue" || config_tok == "procedure" || + config_tok == "consumer") line.insert(0, "# "); /* Also strip ssl config from the LRL for QA mode. */ - if(strncasecmp(tok.c_str(), "ssl", 3) == 0) + if(strncasecmp(config_tok.c_str(), "ssl", 3) == 0) line.insert(0, "# "); } + + if(strip_external_auth && config_tok == "externalauth") + line.insert(0, "# "); } if(!(of << line << std::endl)) { @@ -362,6 +370,7 @@ void deserialise_database( const std::string *p_datadestdir, bool strip_cluster_info, bool strip_consumer_info, + bool strip_external_auth, bool run_full_recovery, const std::string& comdb2_task, unsigned percent_full, @@ -886,7 +895,7 @@ void deserialise_database( } else if (is_lrl) { std::ostringstream lrldata; process_lrl(lrldata, filename, text, strip_cluster_info, - strip_consumer_info, datadestdir, lrldestdir, dbname, + strip_consumer_info, strip_external_auth, datadestdir, lrldestdir, dbname, table_set); if (!datadestdir.empty()) { make_dirs(datadestdir);