From e1f8ad2217755d16bf7491823ad760d6a92ddda8 Mon Sep 17 00:00:00 2001 From: Petr Menšík Date: Aug 14 2018 15:43:33 +0000 Subject: Fix sdb-chroot devices upgrade (#1592873) Move common part to rpm define, use similar parts with different parameter. Correct /dev/zero instead of missing /dev/dev. --- diff --git a/bind.spec b/bind.spec index 0e84de4..6af57f8 100644 --- a/bind.spec +++ b/bind.spec @@ -52,7 +52,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.11.4 -Release: 5%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 6%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: http://www.isc.org/products/BIND/ # @@ -1019,17 +1019,21 @@ fi %postun export-libs -p /sbin/ldconfig %endif +# Fix permissions on existing device files on upgrade +%define chroot_fix_devices() \ +if [ $1 -gt 1 ]; then \ + for DEV in "%{1}/dev"/{null,random,zero}; do \ + if [ -e "$DEV" -a "$(/bin/stat --printf="%G %a" "$DEV")" = "root 644" ]; \ + then \ + /bin/chmod 0664 "$DEV" \ + /bin/chgrp named "$DEV" \ + fi \ + done \ +fi + %post chroot %systemd_post named-chroot.service -if [ $1 -gt 1 ]; then - # Fix permissions on existing device files on upgrade - for DEV in "%{chroot_prefix}/dev"/{null,random,dev}; do - if [ -e "$DEV" -a "$(stat --printf="%G %a" "$DEV")" = "root 644" ]; then - chmod 0664 "$DEV" - chgrp named "$DEV" - fi - done -fi +%chroot_fix_devices %{chroot_prefix} :; %posttrans chroot @@ -1052,15 +1056,7 @@ fi; %post sdb-chroot %systemd_post named-sdb-chroot.service -if [ $1 -gt 1 ]; then - # Fix permissions on existing device files on upgrade - for DEV in "%{chroot_prefix}/dev"/{null,random,dev}; do - if [ -e "$DEV" -a "$(stat --printf="%G %a" "$DEV")" = "root 644" ]; then - chmod 0664 "$DEV" - chgrp named "$DEV" - fi - done -fi +%chroot_fix_devices %{chroot_sdb_prefix} :; %posttrans sdb-chroot @@ -1409,6 +1405,9 @@ rm -rf ${RPM_BUILD_ROOT} %changelog +* Mon Aug 13 2018 Petr Menšík - 32:9.11.4-6.P1 +- Fix sdb-chroot devices upgrade (#1592873) + * Thu Aug 09 2018 Petr Menšík - 32:9.11.4-5.P1 - Update to 9.11.4-P1 - Adds root key sentinel support