summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0009-virtual_media-Fix-for-bmcweb-crash.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0009-virtual_media-Fix-for-bmcweb-crash.patch')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0009-virtual_media-Fix-for-bmcweb-crash.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0009-virtual_media-Fix-for-bmcweb-crash.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0009-virtual_media-Fix-for-bmcweb-crash.patch
new file mode 100644
index 000000000..a2a120c22
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0009-virtual_media-Fix-for-bmcweb-crash.patch
@@ -0,0 +1,47 @@
+From 348186f045f23d59405ac0011e983aea8334598a Mon Sep 17 00:00:00 2001
+From: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+Date: Thu, 4 May 2023 13:56:27 +0000
+Subject: [PATCH] virtual_media: Fix for bmcweb crash
+
+This is ported from main line.
+https://gerrit.openbmc.org/c/openbmc/bmcweb/+/62593
+
+bmcweb crashes when user not providing userName or password while
+posting ISO form Redfish.
+
+This fix provides to avoid bmcweb crash when user try to post ISO images
+from Redfish without providing username or password.
+
+Tested:
+Redfish validator passed with this change.
+Verified by Posting ISO from Redfish.
+
+Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+---
+ redfish-core/lib/virtual_media.hpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
+index 6dfc726b..838a08b1 100644
+--- a/redfish-core/lib/virtual_media.hpp
++++ b/redfish-core/lib/virtual_media.hpp
+@@ -1069,6 +1069,16 @@ inline void requestNBDVirtualMediaRoutes(App& app)
+ return true;
+ }
+
++ if (!actionParams.userName)
++ {
++ actionParams.userName = "";
++ }
++
++ if (!actionParams.password)
++ {
++ actionParams.password = "";
++ }
++
+ // manager is irrelevant for
+ // VirtualMedia dbus calls
+ doMountVmLegacy(asyncResp, service, resName,
+--
+2.17.1
+