Skip to content

Commit cb42ab8

Browse files
committed
Merge pull request xapi-project#1506 from johnelse/ca-97402-clearwater
CLEARWATER-LCM: CA-97402: Add a means of disabling modules in the domainjoin-cli command.
2 parents 241bb6b + c30c1ef commit cb42ab8

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

ocaml/auth/extauth_plugin_ADlikewise.ml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,35 @@ let on_enable config_params =
564564
let _user = List.assoc "user" config_params in
565565
let pass = List.assoc "pass" config_params in
566566
let (ou_conf,ou_params) = if (List.mem_assoc "ou" config_params) then let ou=(List.assoc "ou" config_params) in ([("ou",ou)],["--ou";ou]) else ([],[]) in
567+
(* Adding the config parameter "config:disable_modules=X,Y,Z"
568+
* will disable the modules X, Y and Z in domainjoin-cli. *)
569+
let disabled_modules =
570+
try
571+
match List.assoc "disable_modules" config_params with
572+
| "" -> []
573+
| disabled_modules_string ->
574+
Stringext.String.split ',' disabled_modules_string
575+
with Not_found ->
576+
[]
577+
in
578+
let disabled_module_params =
579+
List.concat
580+
(List.map
581+
(fun disabled_module -> ["--disable"; disabled_module])
582+
disabled_modules)
583+
in
567584

568585
(* we need to make sure that the user passed to domaijoin-cli command is in the UPN syntax ([email protected]) *)
569586
let user = convert_nt_to_upn_username _user in
570587

571588
(* execute the likewise domain join cmd *)
572589
try
573-
let (_: (string*string) list) = likewise_common ~stdin_string:pass (["--minimal";"join"]@ou_params@["--ignore-pam";"--ignore-ssh";"--notimesync";domain;user])
590+
let (_: (string*string) list) =
591+
likewise_common
592+
~stdin_string:pass
593+
(["--minimal";"join"]
594+
@ ou_params @ disabled_module_params @
595+
["--ignore-pam";"--ignore-ssh";"--notimesync";domain;user])
574596
"/usr/bin/domainjoin-cli" in
575597

576598
let max_tries = 60 in (* tests 60 x 5.0 seconds = 300 seconds = 5minutes trying *)

0 commit comments

Comments
 (0)