summaryrefslogtreecommitdiff
path: root/src/rabbit_access_control.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2010-11-24 11:05:07 +0000
committerSimon MacMullen <simon@rabbitmq.com>2010-11-24 11:05:07 +0000
commit052b4d281b7aa73ef321f85504806e33d65d4e62 (patch)
treead4e579f86e5006f902a306e05ccfffa6eda4e00 /src/rabbit_access_control.erl
parent290a15a524f304294570132a2be60399e2e33f95 (diff)
downloadrabbitmq-server-052b4d281b7aa73ef321f85504806e33d65d4e62.tar.gz
Don't allow the backend to grant access to a vhost which does not otherwise exist!
Diffstat (limited to 'src/rabbit_access_control.erl')
-rw-r--r--src/rabbit_access_control.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rabbit_access_control.erl b/src/rabbit_access_control.erl
index 46f882c3..c747a453 100644
--- a/src/rabbit_access_control.erl
+++ b/src/rabbit_access_control.erl
@@ -132,7 +132,10 @@ check_vhost_access(User = #user{ username = Username,
auth_backend = Module }, VHostPath) ->
?LOGDEBUG("Checking VHost access for ~p to ~p~n", [Username, VHostPath]),
check_access(
- fun() -> Module:check_vhost_access(User, VHostPath, write) end,
+ fun() ->
+ vhost_exists(VHostPath) andalso
+ Module:check_vhost_access(User, VHostPath, write)
+ end,
"~s failed checking vhost access to ~s for ~s: ~p~n",
[Module, VHostPath, Username],
"access to vhost '~s' refused for user '~s'",