Commit 576155e0 authored by Mikhail Tergoev's avatar Mikhail Tergoev

Merge branch 'fix-selinux-1' of github.com:Htylol/PortWINE into Htylol-fix-selinux-1

parents 6e5cee5c 8b223bed
......@@ -748,6 +748,30 @@ check_flatpak () {
}
export -f check_flatpak
check_selinux () {
if [[ -n "$SELINUX_IN_USE" ]]
then [[ "$SELINUX_IN_USE" == 1 ]] && return 0 || return 1
fi
if check_flatpak ; then
if grep -i ^"SELINUX=enforcing" /run/host/etc/selinux/config &>/dev/null ; then
export SELINUX_IN_USE=1
return 0
else
export SELINUX_IN_USE=0
return 1
fi
else
if grep -i ^"SELINUX=enforcing" /etc/selinux/config &>/dev/null ; then
export SELINUX_IN_USE=1
return 0
else
export SELINUX_IN_USE=0
return 1
fi
fi
}
export -f check_selinux
background_pid () {
local arg1=$1 # --start или --end
local arg2=$2 # Название команды
......
......@@ -331,10 +331,15 @@ if [[ $(basename "${portwine_exe}") =~ .[Pp][Pp][Aa][Cc][Kk]$ ]] ; then
then TMP_ALL_PATH=""
else TMP_ALL_PATH="LD_LIBRARY_PATH=\"${PW_LD_LIBRARY_PATH}\""
fi
if check_selinux
then NO_XATTRS_NEED="-no-xattrs"
else NO_XATTRS_NEED=""
fi
PW_PREFIX_NAME=$(basename "$1" | awk -F'.' '{print $1}')
cat << EOF > "${PORT_WINE_TMP_PATH}"/pp_pfx_unpack.sh
#!/usr/bin/env bash
${TMP_ALL_PATH} unsquashfs -f -d "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}" "$1" \
${TMP_ALL_PATH} unsquashfs $NO_XATTRS_NEED -f -d "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}" "$1" \
|| echo "ERROR" > "${PORT_WINE_TMP_PATH}"/pp_pfx_unpack_error
EOF
chmod u+x "${PORT_WINE_TMP_PATH}"/pp_pfx_unpack.sh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment