Fix unsanitized value updated on inherited FRUs
This commit fixes unsanitized user input values getting updated on
inherited FRUs and common interfaces via Manager updateKeyword API.
The keyword value on inherited FRUs and on common interfaces should be
updated with same value as written on hardware and base FRU.
Change-Id: I4bdb650deed685174b55c91349beec5d9643fe3e
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/include/parser.hpp b/vpd-manager/include/parser.hpp
index 9af3088..2e32ca5 100644
--- a/vpd-manager/include/parser.hpp
+++ b/vpd-manager/include/parser.hpp
@@ -70,6 +70,29 @@
int updateVpdKeyword(const types::WriteVpdParams& i_paramsToWriteData);
/**
+ * @brief Update keyword value.
+ *
+ * This API is used to update keyword value on the EEPROM path and its
+ * redundant path(s) if any taken from system config JSON. And also updates
+ * keyword value on DBus.
+ *
+ * To update IPZ type VPD, input parameter for writing should be in the form
+ * of (Record, Keyword, Value). Eg: ("VINI", "SN", {0x01, 0x02, 0x03}).
+ *
+ * To update Keyword type VPD, input parameter for writing should be in the
+ * form of (Keyword, Value). Eg: ("PE", {0x01, 0x02, 0x03}).
+ *
+ * @param[in] i_paramsToWriteData - Input details.
+ * @param[in] o_updatedValue - Actual value which has been updated on
+ * hardware.
+ *
+ * @return On success returns number of bytes written, on failure returns
+ * -1.
+ */
+ int updateVpdKeyword(const types::WriteVpdParams& i_paramsToWriteData,
+ types::DbusVariantType& o_updatedValue);
+
+ /**
* @brief Update keyword value on hardware.
*
* This API is used to update keyword value on the hardware path.