# HG changeset patch # User Marcus Granado # Date 1282322886 -3600 # Node ID a9dd0a13fd1329bd654e61ec62101352b2c15b63 # Parent 2061d0df12850f6192ee5d702d2fbdb774bbb47e CP-1831: superusers should have auth_user_name in session Signed-off-by: Marcus Granado diff -r 2061d0df1285 -r a9dd0a13fd13 ocaml/xapi/xapi_session.ml --- a/ocaml/xapi/xapi_session.ml +++ b/ocaml/xapi/xapi_session.ml @@ -325,7 +325,7 @@ 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 @@ (* 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 @@ 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