Commit c848bf28 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repack: move fix_chrome_sandbox to common.sh

parent 014fadc4
...@@ -105,14 +105,3 @@ add_bin_commands() ...@@ -105,14 +105,3 @@ add_bin_commands()
add_bin_link_command $PRODUCT $PRODUCTCUR add_bin_link_command $PRODUCT $PRODUCTCUR
} }
fix_chrome_sandbox()
{
local sandbox="$1"
# Set SUID for chrome-sandbox if userns_clone is not supported
userns_path='/proc/sys/kernel/unprivileged_userns_clone'
userns_val="$(cat $userns_path 2>/dev/null)"
[ "$userns_val" = '1' ] && return
[ -n "$sandbox" ] || sandbox=$PRODUCTDIR/chrome-sandbox
chmod 4755 $BUILDROOT/$sandbox
}
...@@ -58,3 +58,16 @@ move_to_opt() ...@@ -58,3 +58,16 @@ move_to_opt()
subst "s|$from|$PRODUCTDIR|g" $SPEC subst "s|$from|$PRODUCTDIR|g" $SPEC
} }
fix_chrome_sandbox()
{
local sandbox="$1"
# Set SUID for chrome-sandbox if userns_clone is not supported
# CHECKME: Also userns can be enabled via sysctl-conf-userns package install
userns_path='/proc/sys/kernel/unprivileged_userns_clone'
userns_val="$(cat $userns_path 2>/dev/null)"
[ "$userns_val" = '1' ] && return
[ -n "$sandbox" ] || sandbox=$PRODUCTDIR/chrome-sandbox
[ -e "$BUILDROOT$sandbox" ] || return
chmod 4755 $BUILDROOT$sandbox
}
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