diff options
Diffstat (limited to 'source4/param/util.c')
-rw-r--r-- | source4/param/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/param/util.c b/source4/param/util.c index 3881107cbc..366c3f1d78 100644 --- a/source4/param/util.c +++ b/source4/param/util.c @@ -41,6 +41,13 @@ bool lp_is_mydomain(struct loadparm_context *lp_ctx, return strequal(lp_workgroup(lp_ctx), domain); } +bool lp_is_my_domain_or_realm(struct loadparm_context *lp_ctx, + const char *domain) +{ + return strequal(lp_workgroup(lp_ctx), domain) || + strequal(lp_realm(lp_ctx), domain); +} + /** see if a string matches either our primary or one of our secondary netbios aliases. do a case insensitive match @@ -296,3 +303,13 @@ struct smb_iconv_convenience *smb_iconv_convenience_init_lp(TALLOC_CTX *mem_ctx, } +const char *lp_sam_name(struct loadparm_context *lp_ctx) +{ + switch (lp_server_role(lp_ctx)) { + case ROLE_DOMAIN_CONTROLLER: + return lp_workgroup(lp_ctx); + default: + return lp_netbios_name(lp_ctx); + } +} + |