From f3e51a7b18f990c2417d3e650f1101870cf5c189 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Wed, 14 Feb 2018 21:59:25 +0545 Subject: [PATCH] core: CALL_FUNCTION should check auth_id, not src_id --- mitogen/core.py | 4 ++-- mitogen/unix.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mitogen/core.py b/mitogen/core.py index 47355861..0c1924e4 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -1247,8 +1247,8 @@ class ExternalContext(object): for msg in self.channel: data = msg.unpickle(throw=False) LOG.debug('_dispatch_calls(%r)', data) - if msg.src_id not in mitogen.parent_ids: - LOG.warning('CALL_FUNCTION from non-parent %r', msg.src_id) + if msg.auth_id not in mitogen.parent_ids: + LOG.warning('CALL_FUNCTION from non-parent %r', msg.auth_id) modname, klass, func, args, kwargs = data try: diff --git a/mitogen/unix.py b/mitogen/unix.py index 87abfaac..b36da281 100644 --- a/mitogen/unix.py +++ b/mitogen/unix.py @@ -78,6 +78,7 @@ class Listener(mitogen.core.BasicStream): context = mitogen.master.Context(self._router, context_id) stream = mitogen.core.Stream(self._router, context_id) stream.accept(sock.fileno(), sock.fileno()) + stream.auth_id = mitogen.context_id self._router.register(context, stream) sock.send(struct.pack('>LL', context_id, mitogen.context_id)) sock.close()