From 97451edc87558d4f4c3789352d60b8443e7f3575 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Tue, 17 Nov 2026 15:44:31 -0600 Subject: [PATCH 1/2] Adjusted package script to fail if warnings are seen in rpmbuild output Ticket: ENT-14989 Changelog: title --- build-scripts/package | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build-scripts/package b/build-scripts/package index 5c7574d90..bcbaf2a4c 100755 --- a/build-scripts/package +++ b/build-scripts/package @@ -258,7 +258,13 @@ rpm | lpp) --define "'_root_sysconfdir /etc'" \ --define "'use_source_date_epoch_as_buildtime 1'" \ --define "'clamp_mtime_to_source_date_epoch 1'" \ - "$RPMBUILD_OPTIONS" "$SPEC" + "$RPMBUILD_OPTIONS" "$SPEC" 2>&1 | tee $$.rpmbuild.log + + if grep warning "$$.rpmbuild.log"; then + log_error "Warnings found in rpmbuild log. See above." + exit 1 + fi + rm -f $$.rpmbuild.log if [ "$PACKAGING" = lpp ]; then # AIX-specific: Create BFF (Backup File Format) packages for AIX From 95448dac4ba456bd4c0229f9692dd7a9d6662299 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Wed, 18 Nov 2026 11:26:34 -0600 Subject: [PATCH 2/2] Adjusted hub rpm packaging to avoid issues with unchanged config files during upgrades By separating regular files and directories from config files we remove rpmbuild warnings and fix an upgrade bug when config files have not changed. Ticket: ENT-14989 Changelog: title --- .../cfengine-nova-hub.spec.in | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/packaging/cfengine-nova-hub/cfengine-nova-hub.spec.in b/packaging/cfengine-nova-hub/cfengine-nova-hub.spec.in index ef789af43..0c32ab727 100644 --- a/packaging/cfengine-nova-hub/cfengine-nova-hub.spec.in +++ b/packaging/cfengine-nova-hub/cfengine-nova-hub.spec.in @@ -132,6 +132,24 @@ sed "s/define('ENVIRONMENT', 'development')/define('ENVIRONMENT','production')/g mv $RPM_BUILD_ROOT%prefix/share/GUI/public/index.php.tmp $RPM_BUILD_ROOT%prefix/share/GUI/public/index.php rm -f $RPM_BUILD_ROOT%prefix/share/GUI/public/index.php.tmp +( + GUI="$(echo %prefix/share/GUI | sed 's,^/,,')" + cd $RPM_BUILD_ROOT + if find $GUI | grep -qE '[[:space:]*?{}%%]|\[|\]'; then + echo "error: unsafe filename under $GUI" >&2; exit 1 + fi + + # GUI files should be read-only and owned by root + echo '%%defattr(400,root,root,400)' > %{_builddir}/gui-files.list + # Process directories separately to indicate that they can be empty, thus avoiding conflicts with %config entries during upgrade + find $GUI -type d | sed 's|^|%%dir /|' >> %{_builddir}/gui-files.list + # Include all files except for config.php (2 cases currently) + find $GUI \( -type f -o -type l \) ! -name config.php | sed 's|^|/|' >> %{_builddir}/gui-files.list + # include %config files separately +# We can change these configuration files as part of masterfiles policy so need to mark as configs + find $GUI -type f -name config.php | sed 's|^|%%config(noreplace) /|' > %{_builddir}/gui-config.list +) + # NovaBase mkdir -p $RPM_BUILD_ROOT%prefix/share/NovaBase cp -R $RPM_BUILD_ROOT%prefix/masterfiles $RPM_BUILD_ROOT%prefix/share/NovaBase/masterfiles @@ -204,7 +222,7 @@ fi exit 0 -%files +%files -f gui-files.list -f gui-config.list # Executables %defattr(755,root,root,755) @@ -413,13 +431,6 @@ exit 0 %defattr(600,root,root,700) %prefix/share/db/*.sql -# No-one should need access to anything under share/GUI -%defattr(400,root,root,400) -# We can change these configuration files as part of masterfiles policy so need to mark as configs -%config(noreplace) %prefix/share/GUI/application/config/config.php -%config(noreplace) %prefix/share/GUI/api/modules/inventory/config/config.php -%prefix/share/GUI - # Base policy %defattr(644,root,root,755) %prefix/share/NovaBase