summaryrefslogtreecommitdiff
path: root/dfs_server
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2013-06-05 15:01:14 +0200
committerMichael Adam <obnox@samba.org>2013-06-11 01:12:07 +0200
commit424a990e34278fae4888b00affb530ed1fbcb354 (patch)
treeffbd4040e36418d3851e9308bda346b6037a1b3b /dfs_server
parent2a65e8befef004fd18d17853a1b72155752346c8 (diff)
downloadsamba-424a990e34278fae4888b00affb530ed1fbcb354.tar.gz
samba-424a990e34278fae4888b00affb530ed1fbcb354.tar.bz2
samba-424a990e34278fae4888b00affb530ed1fbcb354.zip
s4-dfs_server: check for netbios aliases in ad_get_referrals
Without this patch ad_get_referrals checks for netbios, dns names and ip, but not for netbios aliases set by netbios aliases option, whether the requested name is our dns name. Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Björn Baumbach <bb@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Jun 11 01:12:08 CEST 2013 on sn-devel-104
Diffstat (limited to 'dfs_server')
-rw-r--r--dfs_server/dfs_server_ad.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/dfs_server/dfs_server_ad.c b/dfs_server/dfs_server_ad.c
index 4d3891a774..249a1d1861 100644
--- a/dfs_server/dfs_server_ad.c
+++ b/dfs_server/dfs_server_ad.c
@@ -751,6 +751,7 @@ NTSTATUS dfs_server_ad_get_referrals(struct loadparm_context *lp_ctx,
const char *dns_domain;
const char *netbios_name;
const char *dns_name;
+ const char **netbios_aliases;
if (!lpcfg_host_msdfs(lp_ctx)) {
return NT_STATUS_FS_DRIVER_REQUIRED;
@@ -827,6 +828,40 @@ NTSTATUS dfs_server_ad_get_referrals(struct loadparm_context *lp_ctx,
return NT_STATUS_NOT_FOUND;
}
+ netbios_aliases = lpcfg_netbios_aliases(lp_ctx);
+ while (netbios_aliases && *netbios_aliases) {
+ const char *netbios_alias = *netbios_aliases;
+ char *dns_alias;
+ int cmp;
+
+ cmp = strcasecmp_m(server_name, netbios_alias);
+ if (cmp == 0) {
+ /*
+ * If it is not domain related do not
+ * handle it here.
+ */
+ return NT_STATUS_NOT_FOUND;
+ }
+
+ dns_alias = talloc_asprintf(r, "%s.%s",
+ netbios_alias,
+ dns_domain);
+ if (dns_alias == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ cmp = strcasecmp_m(server_name, dns_alias);
+ talloc_free(dns_alias);
+ if (cmp == 0) {
+ /*
+ * If it is not domain related do not
+ * handle it here.
+ */
+ return NT_STATUS_NOT_FOUND;
+ }
+ netbios_aliases++;
+ }
+
if ((strcasecmp_m(server_name, netbios_domain) != 0) &&
(strcasecmp_m(server_name, dns_domain) != 0)) {
/*