1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

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
This commit is contained in:
Björn Baumbach 2013-06-05 15:01:14 +02:00 committed by Michael Adam
parent 2a65e8befe
commit 424a990e34

View File

@ -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)) {
/*