From: Marcus Granado Date: Tue, 12 Oct 2010 10:55:03 +0000 (+0100) Subject: CA-43936: dont try to get auth-user-name under local-session/emergency-mode X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8c415d1fd9c8f2831d6353cc89b142cac470d449;p=xcp%2Fxen-api.git CA-43936: dont try to get auth-user-name under local-session/emergency-mode Signed-off-by: Marcus Granado --- diff --git a/ocaml/idl/ocaml_backend/rbac_audit.ml b/ocaml/idl/ocaml_backend/rbac_audit.ml index 4483f0c4..5164811c 100644 --- a/ocaml/idl/ocaml_backend/rbac_audit.ml +++ b/ocaml/idl/ocaml_backend/rbac_audit.ml @@ -82,7 +82,12 @@ let get_subject_name __context session_id = get_subject_common ~__context ~session_id ~fnname:"get_subject_name" ~fn_if_local_session:(fun()-> - DB_Action.Session.get_auth_user_name ~__context ~self:session_id + (* we are in emergency mode here, do not call DB_Action: + - local sessions are not in the normal DB + - local sessions do not have a username field + - DB_Action will block forever trying to access an inaccessible master + *) + "" ) ~fn_if_local_superuser:(fun()-> DB_Action.Session.get_auth_user_name ~__context ~self:session_id