diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-10-06 11:45:14 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-10-06 17:16:13 -0400 |
commit | 23eb694a61d155a0b5ce4403e1e0d8dc70653e76 (patch) | |
tree | c17ce3b334df79024e7561e54daead95f6473b67 | |
parent | a3088321039bd10768b6b192328bee29789eca88 (diff) | |
download | initscripts-23eb694a61d155a0b5ce4403e1e0d8dc70653e76.tar initscripts-23eb694a61d155a0b5ce4403e1e0d8dc70653e76.tar.gz initscripts-23eb694a61d155a0b5ce4403e1e0d8dc70653e76.tar.bz2 initscripts-23eb694a61d155a0b5ce4403e1e0d8dc70653e76.tar.xz initscripts-23eb694a61d155a0b5ce4403e1e0d8dc70653e76.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-x | systemd/fedora-import-state | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/systemd/fedora-import-state b/systemd/fedora-import-state index a853ab9c..7809ca81 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 -print0 | { cd / && xargs --null restorecon -i; } fi |