Do not "cp" the selinux context

replace "cp -a" with $DRACUT_CP, so in case the selinux policy disallows
root to set the selinux context in /var/tmp, dracut does not fail.
master
Harald Hoyer 2017-01-11 13:35:36 +01:00
parent 73b9eaab1d
commit 7e51a94f5b
5 changed files with 8 additions and 5 deletions

View File

@ -19,6 +19,8 @@
# #
export LC_MESSAGES=C export LC_MESSAGES=C


export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr"

# is_func <command> # is_func <command>
# Check whether $1 is a function. # Check whether $1 is a function.
is_func() { is_func() {

View File

@ -1557,9 +1557,9 @@ for ((i=0; i < ${#include_src[@]}; i++)); do
mkdir -m 0755 -p "$object_destdir" mkdir -m 0755 -p "$object_destdir"
chmod --reference="$objectname" "$object_destdir" chmod --reference="$objectname" "$object_destdir"
fi fi
cp --reflink=auto --sparse=auto -fa -t "$object_destdir" "$objectname"/* $DRACUT_CP -t "$object_destdir" "$objectname"/*
else else
cp --reflink=auto --sparse=auto -fa -t "$destdir" "$objectname" $DRACUT_CP -t "$destdir" "$objectname"
fi fi
done done
fi fi
@ -1671,7 +1671,7 @@ if [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]]; then
mkdir -p $_dest_dir mkdir -p $_dest_dir
for table in $acpi_table_dir/*.aml; do for table in $acpi_table_dir/*.aml; do
dinfo " Adding ACPI table: $table" dinfo " Adding ACPI table: $table"
cp -a $table $_dest_dir $DRACUT_CP $table $_dest_dir
create_early_cpio="yes" create_early_cpio="yes"
done done
fi fi

View File

@ -114,7 +114,7 @@ install() {


for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do
inst_dir "$_src" inst_dir "$_src"
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_src}" "$_src"/* $DRACUT_CP -L -t "${initdir}/${_src}" "$_src"/*
done done


# remove unnecessary files # remove unnecessary files

View File

@ -190,6 +190,7 @@ handle_netroot()
if [ "$status" != "activating" ] && ! systemctl is-failed "$netroot_enc" >/dev/null 2>&1; then if [ "$status" != "activating" ] && ! systemctl is-failed "$netroot_enc" >/dev/null 2>&1; then
systemd-run --no-block --service-type=oneshot --remain-after-exit --quiet \ systemd-run --no-block --service-type=oneshot --remain-after-exit --quiet \
--description="Login iSCSI Target $iscsi_target_name" \ --description="Login iSCSI Target $iscsi_target_name" \
-p 'DefaultDependencies=no' \
--unit="$netroot_enc" -- \ --unit="$netroot_enc" -- \
$(command -v iscsistart) \ $(command -v iscsistart) \
-i "$iscsi_initiator" -t "$iscsi_target_name" \ -i "$iscsi_initiator" -t "$iscsi_target_name" \

View File

@ -11,7 +11,7 @@ install() {
if [ -d ${_terminfodir} ]; then if [ -d ${_terminfodir} ]; then
for i in "l/linux" "v/vt100" "v/vt102" "v/vt220"; do for i in "l/linux" "v/vt100" "v/vt102" "v/vt220"; do
inst_dir "$_terminfodir/${i%/*}" inst_dir "$_terminfodir/${i%/*}"
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_terminfodir}/${i%/*}" "$_terminfodir/$i" $DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$_terminfodir/$i"
done done
fi fi
} }