From 504032e6e87ad9aaa2ee002fbee7aa52a86bcded Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 1 Apr 2018 11:26:38 +0100 Subject: [PATCH] issue #106: has_parent_authority should accept own context ID. When a stream (such as unix.connect()) has its auth_id set to the current context's, we should allow those requests too, since the request is working with the privilege of the current context. --- mitogen/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mitogen/core.py b/mitogen/core.py index beeedd63..7fcad0ac 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -157,8 +157,9 @@ def _unpickle_dead(): _DEAD = Dead() -def has_parent_authority(msg, _stream): - return msg.auth_id in mitogen.parent_ids +def has_parent_authority(msg, _stream=None): + return (msg.auth_id == mitogen.context_id or + msg.auth_id in mitogen.parent_ids) def listen(obj, name, func):