python: Use CLOEXEC on script
commit5c8cb6d757929e43b3d6523e04dfc611ad30b889
authorEric Blake <eblake@redhat.com>
Thu, 1 Aug 2019 18:30:49 +0000 (1 13:30 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 2 Aug 2019 22:36:28 +0000 (2 17:36 -0500)
tree0c46a5142a1750d6f16ec9dac6debeb1c15d9418
parent87c8343d6c71c46b8541e7accf148981fbe955ee
python: Use CLOEXEC on script

I am unable to quickly determine whether the mere act of loading a
python file can cause enough code to execute as to trigger the Python
interpreter into attempting a fork.  So for safety's sake, let's set
CLOEXEC on the file before handing it to python rather than risking an
accidental fd leak.  Since Haiku lacks fopen("re"), and I already
decided that set_cloexec(fileno(fp)) is undesirable, this has to use
the atomic open/fdopen sequence, even though it does not actually need
atomicity.

Signed-off-by: Eric Blake <eblake@redhat.com>
plugins/python/python.c