From 60c03f0c2be7657e425b7a62e8a6cf6b1774a8b6 Mon Sep 17 00:00:00 2001 From: eportnov Date: Thu, 20 Oct 2022 16:33:18 +0300 Subject: bmcweb-smtp disable from field --- .../bmcweb/0023-smtp-disable-from-field.patch | 66 ++++++++++++++++++++++ .../recipes-phosphor/interfaces/bmcweb_%.bbappend | 1 + 2 files changed, 67 insertions(+) create mode 100644 meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0023-smtp-disable-from-field.patch diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0023-smtp-disable-from-field.patch b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0023-smtp-disable-from-field.patch new file mode 100644 index 0000000000..d2d9c8c0a1 --- /dev/null +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb/0023-smtp-disable-from-field.patch @@ -0,0 +1,66 @@ +From 1d097f5df898fc1be12bcf793aab8c000903c03b Mon Sep 17 00:00:00 2001 +From: claiff +Date: Thu, 20 Oct 2022 16:29:32 +0300 +Subject: [PATCH] smtp disable from field + +--- + redfish-core/lib/smtp.hpp | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +diff --git a/redfish-core/lib/smtp.hpp b/redfish-core/lib/smtp.hpp +index 83bbf9b5..16e3898a 100644 +--- a/redfish-core/lib/smtp.hpp ++++ b/redfish-core/lib/smtp.hpp +@@ -33,7 +33,7 @@ namespace redfish + return function_with_parameters.substr( ZERO_POSITION, position ); + } + +- inline void SendMail( std::string const& from, std::string const& subject, ++ inline void SendMail( std::string const& subject, + std::string const& text, std::shared_ptr const& asyncResp ) + { + static const std::string SEND_MAIL_METHOD_NAME = "SendMail"; +@@ -56,7 +56,6 @@ namespace redfish + }, + SERVICE_PATH, OBJECT_MESSENGER_PATH, INTERFACE_MESSENGER_PATH, + SEND_MAIL_METHOD_NAME, +- from, + subject, + text); + } +@@ -247,7 +246,6 @@ namespace redfish + const std::string& params) + { + static constexpr std::string_view SEND_MAIL_METHOD_NAME = "SendMail"; +- static constexpr std::string_view FROM_FIELD = "from"; + static constexpr std::string_view SUBJECT_FIELD = "subject"; + static constexpr std::string_view TEXT_FIELD = "text"; + +@@ -262,16 +260,15 @@ namespace redfish + return; + } + +- std::string from, subject, text; ++ std::string subject, text; + if (!json_util::readJsonPatch(req, asyncResp->res, +- FROM_FIELD, from, + SUBJECT_FIELD, subject, + TEXT_FIELD, text)) + { + asyncResp->res.jsonValue["result"] = false; + return; + } +- smtp::SendMail(from, subject, text, asyncResp); ++ smtp::SendMail(subject, text, asyncResp); + return; + + }); +@@ -286,8 +283,6 @@ namespace redfish + const std::shared_ptr& asyncResp, + const std::string& params) + { +- +- + static constexpr std::string_view GET_SETTINGS_METHOD_NAME = "GetSettings"; + static constexpr std::string_view SET_SETTINGS_METHOD_NAME = "SetSettings"; + diff --git a/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend index 2a87ee4fcf..7b2d8eb43a 100644 --- a/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend +++ b/meta-ibs/meta-cp2-5422/recipes-phosphor/interfaces/bmcweb_%.bbappend @@ -19,6 +19,7 @@ SRC_URI += "\ file://0020-set-smtp-send-post-request.patch \ file://0021-Fix-getting-properties-from-DBUS-for-CPU-and-DIMM.patch \ file://0022-add-caching-pcie.patch \ + file://0023-smtp-disable-from-field.patch \ " #SRC_URI += "\ -- cgit v1.2.3