aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-06 11:45:14 -0400
committerLukas Nykryn <lnykryn@redhat.com>2014-10-09 16:12:16 +0200
commite8429ecebd39fc0e0ade563b5e139dafb0404013 (patch)
tree2f01bbe1cd7fab115aca7bf5f4c052667017c582
parent184ff9e7c4c67fe72337ba98df940a5187b2978f (diff)
downloadinitscripts-e8429ecebd39fc0e0ade563b5e139dafb0404013.tar
initscripts-e8429ecebd39fc0e0ade563b5e139dafb0404013.tar.gz
initscripts-e8429ecebd39fc0e0ade563b5e139dafb0404013.tar.bz2
initscripts-e8429ecebd39fc0e0ade563b5e139dafb0404013.tar.xz
initscripts-e8429ecebd39fc0e0ade563b5e139dafb0404013.zip
fedora-import-state: do not clobber /
Also, do not fail on filenames containing spaces. https://bugzilla.redhat.com/show_bug.cgi?id=1149419
-rwxr-xr-xsystemd/rhel-import-state7
1 files changed, 2 insertions, 5 deletions
diff --git a/systemd/rhel-import-state b/systemd/rhel-import-state
index 90c88d53..4f2d283b 100755
--- a/systemd/rhel-import-state
+++ b/systemd/rhel-import-state
@@ -1,14 +1,11 @@
#!/bin/bash
# rhel-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 -print0 | { cd / && xargs --null restorecon -i; }
fi