From c3750f49b879b403e335c282d1e9c6843bfaa211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Kl=C3=AD=C4=8D?= Date: Thu, 15 Apr 2010 14:48:56 +0000 Subject: [PATCH] use cp+rm instead of mv in nis.sh (#509240) --- nis.sh | 14 ++++++++++---- ypbind.spec | 5 ++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/nis.sh b/nis.sh index 5a9f0bf..6a56f73 100755 --- a/nis.sh +++ b/nis.sh @@ -38,12 +38,15 @@ save_config_file() { fi if [ -e ${origfile} ]; then - mv ${origfile} ${savefile} + # cp+rm instead of mv: preserve SELinux context + # rhbz#509240 + cp -c ${origfile} ${savefile} + rm ${origfile} else echo > ${savefile} fi - fixContext ${savefile} + fixContext ${savefile} # TODO: is it really needed? } nis_config() { @@ -94,8 +97,11 @@ nis_restore() { if [ ! "${PEERNIS}" = "no" ]; then if [ -f ${SAVEDIR}/${CONF}.predhclient.${interface} ]; then rm -f ${CONF} - mv -f ${SAVEDIR}/${CONF}.predhclient.${interface} ${CONF} - fixContext /etc/yp.conf + # cp+rm instead of mv: preserve SELinux context + # rhbz#509240 + cp -c ${SAVEDIR}/${CONF}.predhclient.${interface} ${CONF} + rm ${SAVEDIR}/${CONF}.predhclient.${interface} + fixContext ${CONF} if [ -x /etc/rc.d/init.d/ypbind ] && [ -r /var/run/ypbind.pid ]; then service ypbind restart >/dev/null 2>&1 fi diff --git a/ypbind.spec b/ypbind.spec index e0f13b1..b0cbabe 100644 --- a/ypbind.spec +++ b/ypbind.spec @@ -1,7 +1,7 @@ Summary: The NIS daemon which binds NIS clients to an NIS domain Name: ypbind Version: 1.20.4 -Release: 22%{?dist} +Release: 23%{?dist} License: GPLv2 Group: System Environment/Daemons Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2 @@ -103,6 +103,9 @@ fi %doc README NEWS %changelog +* Thu Apr 15 2010 Karel Klic - 3:1.20.4-23 +- use cp+rm instead of mv in nis.sh (#509240) + * Thu Apr 15 2010 Karel Klic - 3:1.20.4-22 - Improved -nm patch to go online when no connection is available #480096