Skip to content

Commit 18e7e90

Browse files
author
Jon Ludlam
committed
Merge pull request #1005 from johnelse/ca-74544
CA-74544: Associate a username with the sessions xapi passes to SM backends.
2 parents d217e5d + f0b95d8 commit 18e7e90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ocaml/xapi/sm_exec.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ module E=Debug.Debugger(struct let name="mscgen" end)
2626

2727
let cmd_name driver = sprintf "%s/%sSR" Xapi_globs.sm_dir driver
2828

29+
let sm_username = "__sm__backend"
30+
2931
(*********************************************************************************************)
3032
(* Random utility functions *)
3133

@@ -151,7 +153,7 @@ let with_session sr f =
151153
Server_helpers.exec_with_new_task "sm_exec" (fun __context ->
152154
let create_session () =
153155
let host = !Xapi_globs.localhost_ref in
154-
let session=Xapi_session.login_no_password ~__context ~uname:None ~host ~pool:false ~is_local_superuser:true ~subject:(Ref.null) ~auth_user_sid:"" ~auth_user_name:"" ~rbac_permissions:[] in
156+
let session=Xapi_session.login_no_password ~__context ~uname:None ~host ~pool:false ~is_local_superuser:true ~subject:(Ref.null) ~auth_user_sid:"" ~auth_user_name:sm_username ~rbac_permissions:[] in
155157
(* Give this session access to this particular SR *)
156158
maybe (fun sr ->
157159
Db.Session.add_to_other_config ~__context ~self:session

0 commit comments

Comments
 (0)