Skip to content

Commit 7359a2c

Browse files
committed
CP-37241: Lookup domain workgroup from kdc
Signed-off-by: Lin Liu <[email protected]>
1 parent c5392a7 commit 7359a2c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ocaml/xapi/extauth_plugin_ADwinbind.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,19 @@ let query_domain_workgroup ~domain ~db_workgroup =
385385
Printf.sprintf "Failed to look up domain %s workgroup" domain
386386
in
387387
try
388+
let kdc =
389+
Helpers.call_script ~log_output:On_failure net_cmd
390+
["lookup"; "kdc"; domain; "-d"; debug_level]
391+
(* Result like 10.71.212.25:88\n10.62.1.25:88\n*)
392+
|> String.split_on_char '\n'
393+
|> List.hd
394+
|> String.split_on_char ':'
395+
|> List.hd
396+
in
397+
388398
let lines =
389399
Helpers.call_script ~log_output:On_failure net_cmd
390-
["ads"; "lookup"; "-S"; domain; "-d"; debug_level]
400+
["ads"; "lookup"; "-S"; kdc; "-d"; debug_level]
391401
in
392402
match Xapi_cmd_result.of_output_opt ~sep:':' ~key ~lines with
393403
| Some v ->

quality-gate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
list-hd () {
6-
N=295
6+
N=297
77
LIST_HD=$(git grep -r --count 'List.hd' -- **/*.ml | cut -d ':' -f 2 | paste -sd+ - | bc)
88
if [ "$LIST_HD" -eq "$N" ]; then
99
echo "OK counted $LIST_HD usages"

0 commit comments

Comments
 (0)