diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-05-26 12:31:39 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-05-26 12:37:09 +1000 |
commit | 6ef65389fd2f2bdcafe840e0cd0221bb9f26bdfc (patch) | |
tree | 04df0bce183d759a17d25483f302ed56d65e8153 /source4/param/util.c | |
parent | 86039855759ce38e6074f956073199b0ccd29bdf (diff) | |
download | samba-6ef65389fd2f2bdcafe840e0cd0221bb9f26bdfc.tar.gz samba-6ef65389fd2f2bdcafe840e0cd0221bb9f26bdfc.tar.xz samba-6ef65389fd2f2bdcafe840e0cd0221bb9f26bdfc.zip |
Don't use crossRef records to find our own domain
A single AD server can only host a single domain, so don't stuff about
with looking up our crossRef record in the cn=Partitions container.
We instead trust that lp_realm() and lp_workgroup() works correctly.
Andrew Bartlett
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); + } +} + |