binfmt: ensure a file is ungegistered before registering

This fixes #328
This commit is contained in:
artoo 2019-10-05 16:32:21 +02:00 committed by William Hubbs
parent 039845b742
commit eb61085951

View File

@ -29,6 +29,9 @@ apply_file() {
\;*) continue ;;
esac
local reg=${line#*:}
[ -e /proc/sys/fs/binfmt_misc/${reg%%:*} ] && echo -1 > /proc/sys/fs/binfmt_misc/${reg%%:*}
echo "${line}" > /proc/sys/fs/binfmt_misc/register
rc=$?
if [ $rc -ne 0 ]; then