Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

3 changed files with 205 additions and 15 deletions

View File

@ -0,0 +1,63 @@
diff -up sblim-cmpi-base-1.6.4/OSBase_OperatingSystem.c.orig sblim-cmpi-base-1.6.4/OSBase_OperatingSystem.c
--- sblim-cmpi-base-1.6.4/OSBase_OperatingSystem.c.orig 2020-02-04 13:55:31.565801631 +0100
+++ sblim-cmpi-base-1.6.4/OSBase_OperatingSystem.c 2020-02-04 13:58:39.514189758 +0100
@@ -88,13 +88,21 @@ int get_operatingsystem_data( struct cim
bytes_read = fread(buf, 1, sizeof(buf)-1, fhd);
buf[bytes_read] = 0; /* safeguard end of buffer */
ptr = strstr(buf,"MemTotal");
- sscanf(ptr, "%*s %lld", &((*sptr)->totalPhysMem));
+ if( ptr != NULL ) {
+ sscanf(ptr, "%*s %lld", &((*sptr)->totalPhysMem));
+ }
ptr = strstr(buf,"MemFree");
- sscanf(ptr, "%*s %lld", &((*sptr)->freePhysMem));
+ if( ptr != NULL ) {
+ sscanf(ptr, "%*s %lld", &((*sptr)->freePhysMem));
+ }
ptr = strstr(buf,"SwapTotal");
- sscanf(ptr, "%*s %lld", &((*sptr)->totalSwapMem));
+ if( ptr != NULL ) {
+ sscanf(ptr, "%*s %lld", &((*sptr)->totalSwapMem));
+ }
ptr = strstr(buf,"SwapFree");
- sscanf(ptr, "%*s %lld", &((*sptr)->freeSwapMem));
+ if( ptr != NULL ) {
+ sscanf(ptr, "%*s %lld", &((*sptr)->freeSwapMem));
+ }
fclose(fhd);
}
/* TotalVirtualMemorySize */
diff -up sblim-cmpi-base-1.6.4/OSBase_OperatingSystemStatisticalData.c.orig sblim-cmpi-base-1.6.4/OSBase_OperatingSystemStatisticalData.c
--- sblim-cmpi-base-1.6.4/OSBase_OperatingSystemStatisticalData.c.orig 2020-02-04 13:55:31.557801615 +0100
+++ sblim-cmpi-base-1.6.4/OSBase_OperatingSystemStatisticalData.c 2020-02-04 14:09:01.613474453 +0100
@@ -109,13 +109,15 @@ int get_queue_info_24(struct os_statisti
if ((f = fopen("/proc/loadavg","r")) != NULL) {
fgets(buf,127,f);
strptr = strstr(buf,"/");
- *strptr = '\0';
- while (*strptr != ' ') {
- strptr--;
+ if (strptr != NULL) {
+ *strptr = '\0';
+ while (*strptr != ' ') {
+ strptr--;
+ }
+ stats->run_queue_length = atoll(strptr);
+ res = 1;
}
- stats->run_queue_length = atoll(strptr);
fclose(f);
- res = 1;
} else {
_OSBASE_TRACE(1,("get_queue_info: could not open /proc/loadavg: %s",strerror(errno)));
}
@@ -173,7 +175,8 @@ int get_cpu_page_data_24(struct os_stati
*
* page <in> <out>
*/
- if (sscanf(strptr,"page %lld %lld",&pages_in, &pages_out) == 2) {
+ if (strptr != NULL &&
+ sscanf(strptr,"page %lld %lld",&pages_in, &pages_out) == 2) {
stats->pages_in = pages_in;
stats->pages_out = pages_out;
res = 1;

View File

@ -0,0 +1,88 @@
diff -up sblim-cmpi-base-1.6.4/provider-register.sh.orig sblim-cmpi-base-1.6.4/provider-register.sh
--- sblim-cmpi-base-1.6.4/provider-register.sh.orig 2025-09-12 09:02:08.864655498 +0200
+++ sblim-cmpi-base-1.6.4/provider-register.sh 2025-09-12 09:05:12.403814496 +0200
@@ -221,6 +221,20 @@ pegasus_install()
echo "Failed to build pegasus registration MOF." >&2
return 1
fi
+
+ # Image Mode: Update factory directory with current Pegasus repository state
+ if [ -d /usr/share/factory/var/lib/Pegasus ]
+ then
+ chatter "Image Mode detected: updating tmpfiles factory"
+ if [ -w /usr/share/factory/var/lib ] && [ -r /var/lib/Pegasus ]
+ then
+ rm -rf /usr/share/factory/var/lib/Pegasus &&
+ cp -a /var/lib/Pegasus /usr/share/factory/var/lib/Pegasus
+ [ $? -eq 0 ] && chatter "Image Mode: factory directory updated successfully"
+ else
+ echo "Warning: Image Mode factory directory update failed - insufficient permissions" >&2
+ fi
+ fi
}
pegasus_uninstall()
@@ -316,6 +330,21 @@ EOFX
EOFE
$WBEMEXEC > /dev/null $_DELETE_NAME
done
+
+ # Image Mode: Update factory directory with current Pegasus repository state
+ if [ -d /usr/share/factory/var/lib/Pegasus ]
+ then
+ chatter "Image Mode detected: updating tmpfiles factory after uninstall"
+ if [ -w /usr/share/factory/var/lib ] && [ -r /var/lib/Pegasus ]
+ then
+ rm -rf /usr/share/factory/var/lib/Pegasus &&
+ cp -a /var/lib/Pegasus /usr/share/factory/var/lib/Pegasus
+ [ $? -eq 0 ] && chatter "Image Mode: factory directory updated successfully"
+ else
+ echo "Warning: Image Mode factory directory update failed - insufficient permissions" >&2
+ fi
+ fi
+
else
echo "Sorry, cimserver must be running to deregister the providers." >&2
return 1
@@ -433,6 +462,20 @@ sfcb_install()
echo "Failed to build sfcb registration file." >&2
return 1
fi
+
+ # Image Mode: Update factory directory with current sfcb repository state
+ if [ -d /usr/share/factory/var/lib/sfcb ]
+ then
+ chatter "Image Mode detected: updating tmpfiles factory"
+ if [ -w /usr/share/factory/var/lib ] && [ -r /var/lib/sfcb ]
+ then
+ rm -rf /usr/share/factory/var/lib/sfcb &&
+ cp -a /var/lib/sfcb /usr/share/factory/var/lib/sfcb
+ [ $? -eq 0 ] && chatter "Image Mode: factory directory updated successfully"
+ else
+ echo "Warning: Image Mode factory directory update failed - insufficient permissions" >&2
+ fi
+ fi
}
sfcb_uninstall()
@@ -459,6 +502,20 @@ sfcb_uninstall()
# Rebuild repository
sfcb_rebuild
+
+ # Image Mode: Update factory directory with current sfcb repository state
+ if [ -d /usr/share/factory/var/lib/sfcb ]
+ then
+ chatter "Image Mode detected: updating tmpfiles factory after uninstall"
+ if [ -w /usr/share/factory/var/lib ] && [ -r /var/lib/sfcb ]
+ then
+ rm -rf /usr/share/factory/var/lib/sfcb &&
+ cp -a /var/lib/sfcb /usr/share/factory/var/lib/sfcb
+ [ $? -eq 0 ] && chatter "Image Mode: factory directory updated successfully"
+ else
+ echo "Warning: Image Mode factory directory update failed - insufficient permissions" >&2
+ fi
+ fi
}
openwbem_transform()

View File

@ -1,6 +1,8 @@
%global with_test_subpackage 0
Name: sblim-cmpi-base Name: sblim-cmpi-base
Version: 1.6.4 Version: 1.6.4
Release: 14%{?dist} Release: 21%{?dist}
Summary: SBLIM CMPI Base Providers Summary: SBLIM CMPI Base Providers
License: EPL-1.0 License: EPL-1.0
@ -22,7 +24,12 @@ Patch7: sblim-cmpi-base-1.6.4-dont-install-license.patch
# Patch8: fixes getting of InstallDate property, improves it to work # Patch8: fixes getting of InstallDate property, improves it to work
# on non en_US locales and updates support for Fedora # on non en_US locales and updates support for Fedora
Patch8: sblim-cmpi-base-1.6.4-fix-get-os-install-date.patch Patch8: sblim-cmpi-base-1.6.4-fix-get-os-install-date.patch
# Patch9: fixes possible null pointer dereferences after strstr calls
Patch9: sblim-cmpi-base-1.6.4-fix-possible-null-dereference.patch
# Patch10: adds support for Image Mode
Patch10: sblim-cmpi-base-1.6.4-image-mode.patch
Requires: cim-server sblim-indication_helper Requires: cim-server sblim-indication_helper
BuildRequires: make
BuildRequires: perl-generators BuildRequires: perl-generators
BuildRequires: sblim-cmpi-devel sblim-indication_helper-devel BuildRequires: sblim-cmpi-devel sblim-indication_helper-devel
BuildRequires: autoconf automake libtool pkgconfig BuildRequires: autoconf automake libtool pkgconfig
@ -42,6 +49,7 @@ SBLIM (Standards Based Linux Instrumentation for Manageability)
CMPI (Common Manageability Programming Interface) Base Provider CMPI (Common Manageability Programming Interface) Base Provider
development header files and link libraries. development header files and link libraries.
%if 0%{?with_test_subpackage}
%package test %package test
Summary: SBLIM CMPI Base Providers Test Cases Summary: SBLIM CMPI Base Providers Test Cases
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
@ -51,22 +59,29 @@ Requires: sblim-testsuite
SBLIM (Standards Based Linux Instrumentation for Manageability) SBLIM (Standards Based Linux Instrumentation for Manageability)
CMPI (Common Manageability Programming Interface) Base Provider CMPI (Common Manageability Programming Interface) Base Provider
Testcase Files for the SBLIM Testsuite. Testcase Files for the SBLIM Testsuite.
%endif
%prep %prep
%setup -q %setup -q
autoreconf --install --force autoreconf --install --force
%patch0 -p0 -b .missing-fclose %patch -P 0 -p0 -b .missing-fclose
%patch1 -p0 -b .methods-enable %patch -P 1 -p0 -b .methods-enable
%patch2 -p1 -b .double-fclose %patch -P 2 -p1 -b .double-fclose
%patch3 -p1 -b .docdir %patch -P 3 -p1 -b .docdir
%patch4 -p1 -b .pegasus-interop %patch -P 4 -p1 -b .pegasus-interop
%patch5 -p1 -b .prov-reg-sfcb-systemd %patch -P 5 -p1 -b .prov-reg-sfcb-systemd
%patch6 -p1 -b .list-lib-dependencies %patch -P 6 -p1 -b .list-lib-dependencies
%patch7 -p1 -b .dont-install-license %patch -P 7 -p1 -b .dont-install-license
%patch8 -p1 -b .fix-get-os-install-date %patch -P 8 -p1 -b .fix-get-os-install-date
%patch -P 9 -p1 -b .fix-possible-null-dereference.patch
%patch -P 10 -p1 -b .image-mode
%build %build
%configure TESTSUITEDIR=%{_datadir}/sblim-testsuite --disable-static %configure --disable-static \
%if 0%{?with_test_subpackage}
TESTSUITEDIR=%{_datadir}/sblim-testsuite \
%endif
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make make
@ -90,6 +105,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*a
%{_includedir}/* %{_includedir}/*
%{_libdir}/*.so %{_libdir}/*.so
%if 0%{?with_test_subpackage}
%files test %files test
%dir %{_datadir}/sblim-testsuite/cim %dir %{_datadir}/sblim-testsuite/cim
%dir %{_datadir}/sblim-testsuite/system %dir %{_datadir}/sblim-testsuite/system
@ -99,6 +115,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*a
%{_datadir}/sblim-testsuite/system/linux/*.system %{_datadir}/sblim-testsuite/system/linux/*.system
%{_datadir}/sblim-testsuite/system/linux/*.sh %{_datadir}/sblim-testsuite/system/linux/*.sh
%{_datadir}/sblim-testsuite/system/linux/*.pl %{_datadir}/sblim-testsuite/system/linux/*.pl
%endif
%global SCHEMA %{_datadir}/%{name}/Linux_Base.mof %{_datadir}/%{name}/Linux_BaseIndication.mof %global SCHEMA %{_datadir}/%{name}/Linux_Base.mof %{_datadir}/%{name}/Linux_BaseIndication.mof
@ -116,13 +133,35 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*a
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%changelog %changelog
* Tue Feb 04 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 1.6.4-14 * Thu Dec 11 2025 Vitezslav Crhonek <vcrhonek@redhat.com> - 1.6.4-21
- Add support for Image Mode
Resolves: RHEL-132483
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.6.4-20
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.6.4-19
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.4-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.4-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Feb 04 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 1.6.4-16
- Fix possible null pointer dereferences after strstr calls
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jan 22 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 1.6.4-14
- Fix getting of InstallDate property, improve it to work on non en_US locales - Fix getting of InstallDate property, improve it to work on non en_US locales
and update support for recent Fedora distributions and update support for recent Fedora distributions
Resolves: #1776670
* Mon Aug 05 2019 Vitezslav Crhonek <vcrhonek@redhat.com> - 1.6.4-13 * Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.4-13
- Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue May 14 2019 Vitezslav Crhonek <vcrhonek@redhat.com> - 1.6.4-12 * Tue May 14 2019 Vitezslav Crhonek <vcrhonek@redhat.com> - 1.6.4-12
- Fix URL - Fix URL