From 8c48ee883b98b1e610c80ea7daf746dff0b222fd Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Tue, 8 Jan 2013 14:32:11 +0100 Subject: [PATCH] Fix getPropertyAt() returns Null instead of empty array (patch by Jan Safranek) --- pegasus-2.12.0-empty_arrays.patch | 29 +++++++++++++++++++++++++++++ tog-pegasus.spec | 8 +++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 pegasus-2.12.0-empty_arrays.patch diff --git a/pegasus-2.12.0-empty_arrays.patch b/pegasus-2.12.0-empty_arrays.patch new file mode 100644 index 0000000..6e94c8a --- /dev/null +++ b/pegasus-2.12.0-empty_arrays.patch @@ -0,0 +1,29 @@ +diff -up pegasus/src/Pegasus/ProviderManager2/CMPI/CMPISCMOUtilities.cpp.test pegasus/src/Pegasus/ProviderManager2/CMPI/CMPISCMOUtilities.cpp +--- pegasus/src/Pegasus/ProviderManager2/CMPI/CMPISCMOUtilities.cpp.test 2012-12-03 16:48:34.469370334 +0100 ++++ pegasus/src/Pegasus/ProviderManager2/CMPI/CMPISCMOUtilities.cpp 2012-12-03 16:47:41.000000000 +0100 +@@ -358,12 +358,6 @@ CMPIrc CMPISCMOUtilities::scmoValue2CMPI + data->value.uint64 = 0; + data->state = CMPI_goodValue; + +- //Check for NULL CIMValue +- if( scmoValue == 0 ) +- { +- data->state = CMPI_nullValue; +- return CMPI_RC_OK; +- } + + if (type & CMPI_ARRAY) + { +@@ -398,6 +392,12 @@ CMPIrc CMPISCMOUtilities::scmoValue2CMPI + } + else + { ++ //Check for NULL CIMValue ++ if( scmoValue == 0 ) ++ { ++ data->state = CMPI_nullValue; ++ return CMPI_RC_OK; ++ } + // Check for encpsulated type, which need special handling + if (type&CMPI_ENC) + { diff --git a/tog-pegasus.spec b/tog-pegasus.spec index d9a93a7..12f8a78 100644 --- a/tog-pegasus.spec +++ b/tog-pegasus.spec @@ -8,7 +8,7 @@ Name: tog-pegasus Version: %{major_ver}.0 -Release: 9%{?dist} +Release: 10%{?dist} Epoch: 2 Summary: OpenPegasus WBEM Services for Linux @@ -74,6 +74,8 @@ Patch23: pegasus-2.12.0-enable_interop_provider.patch # Fixes tracing for CMPI messages with CMPI_DEV_DEBUG severity # Patch24: pegasus-2.12.0-cmpi-trace.patch +# 25: bz#883030, getPropertyAt() returns Null instead of empty array +Patch25: pegasus-2.12.0-empty_arrays.patch BuildRequires: bash, sed, grep, coreutils, procps, gcc, gcc-c++ BuildRequires: libstdc++, make, pam-devel @@ -203,6 +205,7 @@ rm -rf pegasus/ %patch22 -p1 -b .null_value %patch23 -p1 -b .enable_interop_provider %patch24 -p1 -b .cmpi-trace +%patch25 -p1 -b .empty_arrays %build @@ -468,6 +471,9 @@ fi %changelog +* Tue Jan 08 2013 Vitezslav Crhonek - 2:2.12.0-10 +- Fix getPropertyAt() returns Null instead of empty array (patch by Jan Safranek) + * Tue Dec 18 2012 Vitezslav Crhonek - 2:2.12.0-9 - Add cimprovagt wrapper for possibility of confining providers in SELinux, update README.RedHat.Security accordingly, add provider specific wrapper