From 55f0930a6ff32ccbdb1473037a9d759fb55a07a1 Mon Sep 17 00:00:00 2001 From: Marcus Granado Date: Mon, 23 Aug 2010 15:54:36 +0100 Subject: [PATCH] CP-1831: superusers should have auth_user_name in session Signed-off-by: Marcus Granado --- ocaml/xapi/xapi_session.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocaml/xapi/xapi_session.ml b/ocaml/xapi/xapi_session.ml index 7f7f8052..f1479e5f 100644 --- a/ocaml/xapi/xapi_session.ml +++ b/ocaml/xapi/xapi_session.ml @@ -325,7 +325,7 @@ let slave_login ~__context ~host ~psecret = slave_login_common ~__context ~host_str:(Ref.string_of host) ~psecret; login_no_password ~__context ~uname:None ~host:host ~pool:true ~is_local_superuser:true ~subject:(Ref.null) ~auth_user_sid:"" - ~auth_user_name:"" ~rbac_permissions:[] + ~auth_user_name:(Ref.string_of host) ~rbac_permissions:[] (* Emergency mode login, uses local storage *) let slave_local_login ~__context ~psecret = @@ -360,8 +360,8 @@ let login_with_password ~__context ~uname ~pwd ~version = wipe_params_after_fn [ (* in this case, the context origin of this login request is a unix socket bound locally to a filename *) (* we trust requests from local unix filename sockets, so no need to authenticate them before login *) login_no_password ~__context ~uname:(Some uname) ~host:(Helpers.get_localhost ~__context) - ~pool:false ~is_local_superuser:true ~subject:(Ref.null)(*~subject should be undefined here or not??? *) - ~auth_user_sid:"" ~auth_user_name:"" ~rbac_permissions:[] + ~pool:false ~is_local_superuser:true ~subject:(Ref.null) + ~auth_user_sid:"" ~auth_user_name:uname ~rbac_permissions:[] end else let login_as_local_superuser auth_type = @@ -372,7 +372,7 @@ let login_with_password ~__context ~uname ~pwd ~version = wipe_params_after_fn [ do_local_auth uname pwd; debug "Successful local authentication user %s from %s" uname (Context.get_origin __context); login_no_password ~__context ~uname:(Some uname) ~host:(Helpers.get_localhost ~__context) - ~pool:false ~is_local_superuser:true ~subject:(Ref.null) ~auth_user_sid:"" ~auth_user_name:"" + ~pool:false ~is_local_superuser:true ~subject:(Ref.null) ~auth_user_sid:"" ~auth_user_name:uname ~rbac_permissions:[] end in -- 2.39.5