]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
CA-43936: dont try to get auth-user-name under local-session/emergency-mode
authorMarcus Granado <marcus.granado@eu.citrix.com>
Tue, 12 Oct 2010 10:55:03 +0000 (11:55 +0100)
committerMarcus Granado <marcus.granado@eu.citrix.com>
Tue, 12 Oct 2010 10:55:03 +0000 (11:55 +0100)
Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
ocaml/idl/ocaml_backend/rbac_audit.ml

index 4483f0c4f4a5183ef8404dca8557474a6ce6165c..5164811ce5624b6c38cc04801ea56a7ef6ea3267 100644 (file)
@@ -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