diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2010-11-24 11:05:07 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2010-11-24 11:05:07 +0000 |
commit | 052b4d281b7aa73ef321f85504806e33d65d4e62 (patch) | |
tree | ad4e579f86e5006f902a306e05ccfffa6eda4e00 /src/rabbit_access_control.erl | |
parent | 290a15a524f304294570132a2be60399e2e33f95 (diff) | |
download | rabbitmq-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.erl | 5 |
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'", |