Skip to content

Commit 87178fc

Browse files
authored
CP-311169: samba: include /etc/samba/smb.extra.conf (#6871)
Samba has lots of feature and configurations, https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html Some of them are passthrough from xapi configuration to samba However, this requires xapi rebuild and make xapi uncessary complicated. On the other side, sometimes we do need customer to tune some args, especially for debug purpose, and we do want such configuration can persist cross xapi restart. A new configuration /etc/samba/cust.conf is introduced. The xapi generated/overrided /etc/samba/smb.conf include it. Customer can update this file with guide of support team for debug purpose
2 parents 31e031b + 1bc5bd7 commit 87178fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ocaml/xapi/extauth_plugin_ADwinbind.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ let query_domain_workgroup ~domain =
780780

781781
let config_winbind_daemon ~workgroup ~netbios_name ~domain =
782782
let smb_config = "/etc/samba/smb.conf" in
783+
let extra_conf = "/etc/samba/smb.extra.conf" in
783784
let string_of_bool = function true -> "yes" | false -> "no" in
784785

785786
let scan_trusted_domains =
@@ -788,7 +789,8 @@ let config_winbind_daemon ~workgroup ~netbios_name ~domain =
788789
( match (workgroup, netbios_name, domain) with
789790
| Some wkgroup, Some netbios, Some dom ->
790791
[
791-
"# autogenerated by xapi"
792+
Printf.sprintf "# This file is managed by xapi, update %s instead"
793+
extra_conf
792794
; "[global]"
793795
; "client use kerberos = required"
794796
; "sync machine password to keytab = \
@@ -815,6 +817,7 @@ let config_winbind_daemon ~workgroup ~netbios_name ~domain =
815817
; "idmap config * : backend = autorid"
816818
; Printf.sprintf "idmap config * : range = %d-%d" 2_000_000 99_999_999
817819
; Printf.sprintf "log level = %s" (debug_level ())
820+
; Printf.sprintf "include = %s" extra_conf
818821
; "" (* Empty line at the end *)
819822
]
820823
| _ ->

0 commit comments

Comments
 (0)