Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
edwintorok committed Aug 30, 2023
1 parent c6e2770 commit bfc072c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ocaml/auth/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
(executable
(name pamtest)
(libraries pam)
(modules pamtest)
)
(library
(foreign_stubs
(language c)
(names xa_auth xa_auth_stubs)
)
(modules (:standard \ pamtest))
(name pam)
(c_library_flags -lpam)
(wrapped false)
Expand Down
3 changes: 2 additions & 1 deletion ocaml/auth/pam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ external authorize : pam_handle -> string -> string -> unit = "stub_XA_mh_author
(* TODO: make this configurable in Xapi_globs *)
(* because this is initialized on startup this is not settable from a config file yet! *)
let auth_workers = Threadpool.create ~name:"PAM auth" authenticate_start authenticate_stop 8

(*
let () = at_exit (fun () -> Threadpool.shutdown auth_workers)
*)

let authenticate user password =
Threadpool.run_in_pool auth_workers @@ fun handle ->
Expand Down
5 changes: 4 additions & 1 deletion ocaml/database/redo_log.ml
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,13 @@ let flush_db_exn db log =
raise (RedoLogFailure "Cannot connect to redo log")

let enable_and_flush db log reason =
enable_existing log reason ; flush_db_exn db log
enable_existing log reason ;
with_lock redo_log_creation_mutex @@ fun () ->
flush_db_exn db log

let enable_block_and_flush db log path =
enable_block_existing log path ;
with_lock redo_log_creation_mutex @@ fun () ->
flush_db_exn db log

(* Write the given database to all active redo_logs *)
Expand Down

0 comments on commit bfc072c

Please sign in to comment.