From 70cc56d3e702fa25a661bed41842684f9b5c6282 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 7 Jan 2016 14:40:02 +0100 Subject: [PATCH] lib/param: add lpcfg_sam_dnsname() helper function Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- lib/param/param.h | 1 + lib/param/util.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/param/param.h b/lib/param/param.h index fb28218e3b8..66037e2ef1b 100644 --- a/lib/param/param.h +++ b/lib/param/param.h @@ -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, diff --git a/lib/param/util.c b/lib/param/util.c index bf9e0b8c309..233981abfa8 100644 --- a/lib/param/util.c +++ b/lib/param/util.c @@ -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,