lib/param: add lpcfg_sam_dnsname() helper function
authorStefan Metzmacher <metze@samba.org>
Thu, 7 Jan 2016 13:40:02 +0000 (14:40 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 30 Jun 2016 01:30:26 +0000 (03:30 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/param/param.h
lib/param/util.c

index fb28218e3b8c2fa004f1dcbb53a2a4f40b037468..66037e2ef1bf36b66ac4a21d21114fdef7c065da 100644 (file)
@@ -306,6 +306,7 @@ struct smb_iconv_handle *smb_iconv_handle_reinit_lp(TALLOC_CTX *mem_ctx,
                                                              struct smb_iconv_handle *old_ic);
 
 const char *lpcfg_sam_name(struct loadparm_context *lp_ctx);
+const char *lpcfg_sam_dnsname(struct loadparm_context *lp_ctx);
 
 void lpcfg_default_kdc_policy(struct loadparm_context *lp_ctx,
                                time_t *svc_tkt_lifetime,
index bf9e0b8c309dfe39525e66be38130bca42fc574a..233981abfa854ed8f93bb02eea9b1c8cc4d73b0b 100644 (file)
@@ -271,6 +271,16 @@ const char *lpcfg_sam_name(struct loadparm_context *lp_ctx)
        }
 }
 
+const char *lpcfg_sam_dnsname(struct loadparm_context *lp_ctx)
+{
+       switch (lpcfg_server_role(lp_ctx)) {
+       case ROLE_ACTIVE_DIRECTORY_DC:
+               return lpcfg_dnsdomain(lp_ctx);
+       default:
+               return NULL;
+       }
+}
+
 void lpcfg_default_kdc_policy(struct loadparm_context *lp_ctx,
                                time_t *svc_tkt_lifetime,
                                time_t *usr_tkt_lifetime,