summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-04-08 15:07:43 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-04-08 15:07:43 +0100
commita82a835afe731507c7accece468561f7b380ca17 (patch)
tree3da2060eddbfb590015b28fc04a383922206030a
parent56e30f3fefe805652db41bb047c90e316a24d918 (diff)
parent2f16bf43db30da94a1f3115bd19e12c3b4f196ea (diff)
downloadrabbitmq-server-a82a835afe731507c7accece468561f7b380ca17.tar.gz
stable to default
-rw-r--r--src/rabbit_channel.erl12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index b9b39ac3..74f9cacf 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -504,10 +504,14 @@ check_user_id_header(
#'P_basic'{}, #ch{user = #user{auth_backend = rabbit_auth_backend_dummy}}) ->
ok;
check_user_id_header(#'P_basic'{user_id = Claimed},
- #ch{user = #user{username = Actual}}) ->
- precondition_failed(
- "user_id property set to '~s' but authenticated user was '~s'",
- [Claimed, Actual]).
+ #ch{user = #user{username = Actual,
+ tags = Tags}}) ->
+ case lists:member(impersonator, Tags) of
+ true -> ok;
+ false -> precondition_failed(
+ "user_id property set to '~s' but authenticated user was "
+ "'~s'", [Claimed, Actual])
+ end.
check_expiration_header(Props) ->
case rabbit_basic:parse_expiration(Props) of