diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-02-05 13:17:01 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-02-05 13:17:01 +0000 |
| commit | 823fde2791262ccf701db82ee8ccb98482e882d1 (patch) | |
| tree | 841a9241903be7f68d442f7ec498d8befc8bad78 | |
| parent | 188ed47526204f00778f87624ce8c45b66a61536 (diff) | |
| download | rabbitmq-server-git-823fde2791262ccf701db82ee8ccb98482e882d1.tar.gz | |
Get rid of the impersonator tag, only let the magic user do it.
| -rw-r--r-- | src/rabbit_channel.erl | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 6b0f37007a..2c091b9be0 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -496,15 +496,14 @@ check_user_id_header(#'P_basic'{user_id = undefined}, _) -> check_user_id_header(#'P_basic'{user_id = Username}, #ch{user = #user{username = Username}}) -> ok; +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, - 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. + #ch{user = #user{username = Actual}}) -> + precondition_failed( + "user_id property set to '~s' but authenticated user was '~s'", + [Claimed, Actual]). check_expiration_header(Props) -> case rabbit_basic:parse_expiration(Props) of |
