param: Add 'mit kdc config' option to smb.conf
authorAndreas Schneider <asn@samba.org>
Wed, 7 Oct 2015 12:36:57 +0000 (14:36 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 29 Apr 2017 21:31:09 +0000 (23:31 +0200)
This points to the kdc config file created by Samba by default.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
docs-xml/smbdotconf/security/mitkdcconfig.xml [new file with mode: 0644]
source4/kdc/kdc-service-mit.c

diff --git a/docs-xml/smbdotconf/security/mitkdcconfig.xml b/docs-xml/smbdotconf/security/mitkdcconfig.xml
new file mode 100644 (file)
index 0000000..4dd9f9b
--- /dev/null
@@ -0,0 +1,14 @@
+<samba:parameter name="mit kdc config"
+                 context="G"
+                 type="string"
+                 advanced="1"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+    <para>
+        This option allows to use a different MIT KDC config file than using
+        the system default.
+    </para>
+</description>
+
+<value type="example">/etc/samba/kdc.conf</value>
+</samba:parameter>
index 36d0063e4ed0c3800a6a37a2469f850024b8bfa6..719ea48c0903ecbd1f885c9ff37a20bde7f5b226 100644 (file)
@@ -42,6 +42,7 @@ void mitkdc_task_init(struct task_server *task)
 {
        struct tevent_req *subreq;
        const char * const *kdc_cmd;
+       const char *kdc_config;
        NTSTATUS status;
 
        task_server_set_title(task, "task[mitkdc_parent]");
@@ -64,6 +65,12 @@ void mitkdc_task_init(struct task_server *task)
                break;
        }
 
+       kdc_config = lpcfg_mit_kdc_config(task->lp_ctx, task);
+       if (kdc_config != NULL && kdc_config[0] != '\0') {
+               /* Do not overwrite the variable if already set! */
+               setenv("KRB5_KDC_PROFILE", kdc_config, 0);
+       }
+
        /* start it as a child process */
        kdc_cmd = lpcfg_mit_kdc_command(task->lp_ctx);