Update fedora-import-state

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2014-10-06 11:54:07 -04:00
parent 8c1e6907e1
commit 6ee1b79261
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,33 @@
From 83d0e2588efadf2ae4b53f01ff31921f60906419 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 6 Oct 2014 11:45:14 -0400
Subject: [PATCH] fedora-import-state: do not clobber /
Also, do not fail on filenames containing spaces.
https://bugzilla.redhat.com/show_bug.cgi?id=1149419
---
systemd/fedora-import-state | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/systemd/fedora-import-state b/systemd/fedora-import-state
index a853ab9cda..f23692a6c7 100755
--- a/systemd/fedora-import-state
+++ b/systemd/fedora-import-state
@@ -1,14 +1,11 @@
#!/bin/bash
# fedora-import-state: import state files from initramfs (e.g. network config)
-# exit early if root isn't writeable
-[ -w / ] || exit 0
-
# copy state into root
cd /run/initramfs/state
-cp -a -t / .
+find . -mindepth 1 -maxdepth 1 -exec cp -av -t / {} \;
# run restorecon on the copied files
if [ -e /sys/fs/selinux/enforce ]; then
- find . | ( cd /; restorecon -i -f -; ) || :
+ find . -mindepth 1 | { cd / && xargs -t restorecon -i; } || :
fi

View File

@ -3,7 +3,7 @@ Name: initscripts
Version: 9.55 Version: 9.55
License: GPLv2 License: GPLv2
Group: System Environment/Base Group: System Environment/Base
Release: 2%{?dist} Release: 3%{?dist}
URL: http://fedorahosted.org/releases/i/n/initscripts/ URL: http://fedorahosted.org/releases/i/n/initscripts/
Source: http://fedorahosted.org/releases/i/n/initscripts/initscripts-%{version}.tar.bz2 Source: http://fedorahosted.org/releases/i/n/initscripts/initscripts-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@ -34,6 +34,8 @@ Requires(preun): /sbin/chkconfig
BuildRequires: glib2-devel popt-devel gettext pkgconfig BuildRequires: glib2-devel popt-devel gettext pkgconfig
Provides: /sbin/service Provides: /sbin/service
Patch0001: 0001-fedora-import-state-do-not-clobber.patch
%description %description
The initscripts package contains the basic system scripts used to boot The initscripts package contains the basic system scripts used to boot
your Red Hat or Fedora system, change runlevels, and shut the system down your Red Hat or Fedora system, change runlevels, and shut the system down
@ -53,6 +55,7 @@ Currently, this consists of various memory checking code.
%prep %prep
%setup -q %setup -q
%patch0001 -p1
%build %build
make make
@ -208,6 +211,9 @@ rm -rf $RPM_BUILD_ROOT
/etc/profile.d/debug* /etc/profile.d/debug*
%changelog %changelog
* Mon Oct 06 2014 Zbigniew Jędrzejewski-Szmek- 9.55-3
- Update fedora-import-state for bug #1149419.
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.55-2 * Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 9.55-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild