]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
acquire lock for python 2, also
authorAlan T. DeKok <aland@freeradius.org>
Fri, 25 Aug 2023 22:02:18 +0000 (18:02 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 25 Aug 2023 22:02:18 +0000 (18:02 -0400)
src/modules/rlm_python/rlm_python.c

index 2adba0e5f61c531909bbfc718fde88d7c1a977a7..1578df056fc18aa540f2fd21249b8009e5a76da3 100644 (file)
@@ -1023,6 +1023,8 @@ static int python_interpreter_init(rlm_python_t *inst, CONF_SECTION *conf)
                Py_InitializeEx(0);                     /* Don't override signal handlers - noop on subs calls */
                PyEval_InitThreads();                   /* This also grabs a lock (which we then need to release) */
                main_interpreter = PyThreadState_Get(); /* Store reference to the main interpreter */
+       } else {
+               PyEval_AcquireLock();
        }
        rad_assert(PyEval_ThreadsInitialized());