ocaml/idl/ocaml_backend/rbac_audit.ml |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


# HG changeset patch
# User Marcus Granado <[email protected]>
# Date 1285694241 -3600
# Node ID 46707d5b4cc2a911b824891111103829567f84be
# Parent  b83dff1189acc24f6dc3f2a013a45c49a6ba3c14
CA-43936: dont try to get auth-user-name under local-session/emergency-mode

Signed-off-by: Marcus Granado <[email protected]>

diff -r b83dff1189ac -r 46707d5b4cc2 ocaml/idl/ocaml_backend/rbac_audit.ml
--- a/ocaml/idl/ocaml_backend/rbac_audit.ml
+++ b/ocaml/idl/ocaml_backend/rbac_audit.ml
@@ -82,7 +82,12 @@
        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
# HG changeset patch
# User Marcus Granado <[email protected]>
# Date 1285694241 -3600
# Node ID 46707d5b4cc2a911b824891111103829567f84be
# Parent  b83dff1189acc24f6dc3f2a013a45c49a6ba3c14
CA-43936: dont try to get auth-user-name under local-session/emergency-mode

Signed-off-by: Marcus Granado <[email protected]>

diff -r b83dff1189ac -r 46707d5b4cc2 ocaml/idl/ocaml_backend/rbac_audit.ml
--- a/ocaml/idl/ocaml_backend/rbac_audit.ml
+++ b/ocaml/idl/ocaml_backend/rbac_audit.ml
@@ -82,7 +82,12 @@
 	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
_______________________________________________
xen-api mailing list
[email protected]
http://lists.xensource.com/mailman/listinfo/xen-api

Reply via email to