diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-08 11:50:35 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-08 11:50:35 +0100 |
commit | b716fe885307411abcb9dea18dd2982fecd26d8c (patch) | |
tree | 28e8f819d1317227bfe6d280bb649799779e5c39 /src | |
parent | 666600c6bbc0d1064f434d5113a8efc9144e0de6 (diff) | |
download | abrt-b716fe885307411abcb9dea18dd2982fecd26d8c.tar.gz abrt-b716fe885307411abcb9dea18dd2982fecd26d8c.tar.xz abrt-b716fe885307411abcb9dea18dd2982fecd26d8c.zip |
remove binary files from report if client did not include them
This is not used at the moment, but will be needed when
GUI will reinstate "Attachments" checkboxes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Daemon/MiddleWare.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index e0687fd5..3e1b1ea6 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -414,6 +414,25 @@ report_status_t Report(const map_crash_data_t& client_report, } } + /* Remove BIN filenames from stored_report if they are not present in client's data */ + map_crash_data_t::const_iterator its = stored_report.begin(); + while (its != stored_report.end()) + { + if (its->second[CD_TYPE] == CD_BIN) + { + std::string key = its->first; + if (get_crash_data_item_content_or_NULL(client_report, key.c_str()) == NULL) + { + /* client does not have it -> does not want it passed to reporters */ + VERB3 log("Won't report BIN file %s:'%s'", key.c_str(), its->second[CD_CONTENT].c_str()); + its++; /* move off the element we will erase */ + stored_report.erase(key); + continue; + } + } + its++; + } + const std::string& analyzer = get_crash_data_item_content(stored_report, FILENAME_ANALYZER); std::string dup_hash = GetGlobalUUID(analyzer.c_str(), pDumpDir.c_str()); |