summaryrefslogtreecommitdiff
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
commitf598074d7928c360190b948e6e11b3599195e5c7 (patch)
treead4e579f86e5006f902a306e05ccfffa6eda4e00
parentfd86b29fb2b948381824fc16501c42b7606b8134 (diff)
downloadrabbitmq-server-git-f598074d7928c360190b948e6e11b3599195e5c7.tar.gz
Don't allow the backend to grant access to a vhost which does not otherwise exist!
-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 46f882c378..c747a4531d 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'",