summaryrefslogtreecommitdiff
path: root/source3/winbindd/idmap_adex
diff options
context:
space:
mode:
Diffstat (limited to 'source3/winbindd/idmap_adex')
-rw-r--r--source3/winbindd/idmap_adex/cell_util.c6
-rw-r--r--source3/winbindd/idmap_adex/domain_util.c4
-rw-r--r--source3/winbindd/idmap_adex/gc_util.c22
-rw-r--r--source3/winbindd/idmap_adex/likewise_cell.c2
-rw-r--r--source3/winbindd/idmap_adex/provider_unified.c4
5 files changed, 24 insertions, 14 deletions
diff --git a/source3/winbindd/idmap_adex/cell_util.c b/source3/winbindd/idmap_adex/cell_util.c
index c82407c0f4..194544086b 100644
--- a/source3/winbindd/idmap_adex/cell_util.c
+++ b/source3/winbindd/idmap_adex/cell_util.c
@@ -38,7 +38,7 @@
for (i = 0; i < num_lines; i++) {
/* make sure to avoid substring matches like uid
and uidNumber */
- if ((StrnCaseCmp(list[i], substr, cmplen) == 0) &&
+ if ((strncasecmp_m(list[i], substr, cmplen) == 0) &&
(list[i][cmplen] == '=')) {
/* Don't return an empty string */
if (list[i][cmplen + 1] != '\0')
@@ -110,7 +110,7 @@ static NTSTATUS cell_lookup_forest(struct likewise_cell *c)
return NT_STATUS_INVALID_PARAMETER;
}
- if ((gc = TALLOC_ZERO_P(NULL, struct gc_info)) == NULL) {
+ if ((gc = talloc_zero(NULL, struct gc_info)) == NULL) {
nt_status = NT_STATUS_NO_MEMORY;
BAIL_ON_NTSTATUS_ERROR(nt_status);
}
@@ -230,7 +230,7 @@ done:
while (next_token_talloc(frame, &tmp_dn, &buffer, ",")) {
/* skip everything up the where DC=... begins */
- if (StrnCaseCmp(buffer, "DC=", 3) != 0)
+ if (strncasecmp_m(buffer, "DC=", 3) != 0)
continue;
if (!domain) {
diff --git a/source3/winbindd/idmap_adex/domain_util.c b/source3/winbindd/idmap_adex/domain_util.c
index c373106446..99dc0cca65 100644
--- a/source3/winbindd/idmap_adex/domain_util.c
+++ b/source3/winbindd/idmap_adex/domain_util.c
@@ -71,7 +71,7 @@ static NTSTATUS dc_add_domain(const char *domain)
return NT_STATUS_OK;
}
- dc = TALLOC_ZERO_P(NULL, struct dc_info);
+ dc = talloc_zero(NULL, struct dc_info);
BAIL_ON_PTR_ERROR(dc, nt_status);
dc->dns_name = talloc_strdup(dc, domain);
@@ -281,7 +281,7 @@ static struct dc_info *dc_find_domain(const char *dns_domain)
*cell = dc->domain_cell;
done:
- talloc_destroy(CONST_DISCARD(char*, base));
+ talloc_destroy(discard_const_p(char, base));
talloc_destroy(frame);
return nt_status;
diff --git a/source3/winbindd/idmap_adex/gc_util.c b/source3/winbindd/idmap_adex/gc_util.c
index 77b318cb2d..461a2e679b 100644
--- a/source3/winbindd/idmap_adex/gc_util.c
+++ b/source3/winbindd/idmap_adex/gc_util.c
@@ -107,6 +107,7 @@ done:
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
struct NETLOGON_SAM_LOGON_RESPONSE_EX cldap_reply;
TALLOC_CTX *frame = talloc_stackframe();
+ struct sockaddr_storage ss;
if (!gc || !domain) {
return NT_STATUS_INVALID_PARAMETER;
@@ -126,8 +127,17 @@ done:
nt_status = ads_ntstatus(ads_status);
BAIL_ON_NTSTATUS_ERROR(nt_status);
+ if (!resolve_name(ads->config.ldap_server_name, &ss, 0x20, true)) {
+ DEBUG(5,("gc_find_forest_root: unable to resolve name %s\n",
+ ads->config.ldap_server_name));
+ nt_status = NT_STATUS_IO_TIMEOUT;
+ /* This matches the old code which did the resolve in
+ * ads_cldap_netlogon_5 */
+ BAIL_ON_NTSTATUS_ERROR(nt_status);
+ }
+
if (!ads_cldap_netlogon_5(frame,
- ads->config.ldap_server_name,
+ &ss,
ads->config.realm,
&cldap_reply))
{
@@ -181,7 +191,7 @@ static NTSTATUS gc_add_forest(const char *domain)
return NT_STATUS_OK;
}
- if ((gc = TALLOC_ZERO_P(NULL, struct gc_info)) == NULL) {
+ if ((gc = talloc_zero(NULL, struct gc_info)) == NULL) {
nt_status = NT_STATUS_NO_MEMORY;
BAIL_ON_NTSTATUS_ERROR(nt_status);
}
@@ -771,17 +781,17 @@ done:
#endif
if (count == 0) {
- ads_tmp = TALLOC_ARRAY(NULL, ADS_STRUCT*, 1);
+ ads_tmp = talloc_array(NULL, ADS_STRUCT*, 1);
BAIL_ON_PTR_ERROR(ads_tmp, nt_status);
- msg_tmp = TALLOC_ARRAY(NULL, LDAPMessage*, 1);
+ msg_tmp = talloc_array(NULL, LDAPMessage*, 1);
BAIL_ON_PTR_ERROR(msg_tmp, nt_status);
} else {
- ads_tmp = TALLOC_REALLOC_ARRAY(*ads_list, *ads_list, ADS_STRUCT*,
+ ads_tmp = talloc_realloc(*ads_list, *ads_list, ADS_STRUCT*,
count+1);
BAIL_ON_PTR_ERROR(ads_tmp, nt_status);
- msg_tmp = TALLOC_REALLOC_ARRAY(*msg_list, *msg_list, LDAPMessage*,
+ msg_tmp = talloc_realloc(*msg_list, *msg_list, LDAPMessage*,
count+1);
BAIL_ON_PTR_ERROR(msg_tmp, nt_status);
}
diff --git a/source3/winbindd/idmap_adex/likewise_cell.c b/source3/winbindd/idmap_adex/likewise_cell.c
index 0914132b93..0e544e90f7 100644
--- a/source3/winbindd/idmap_adex/likewise_cell.c
+++ b/source3/winbindd/idmap_adex/likewise_cell.c
@@ -85,7 +85,7 @@ static struct likewise_cell *_lw_cell_list = NULL;
/* Each cell struct is a TALLOC_CTX* */
- c = TALLOC_ZERO_P(NULL, struct likewise_cell);
+ c = talloc_zero(NULL, struct likewise_cell);
if (!c) {
DEBUG(0,("cell_new: memory allocation failure!\n"));
return NULL;
diff --git a/source3/winbindd/idmap_adex/provider_unified.c b/source3/winbindd/idmap_adex/provider_unified.c
index b61666fa50..9e271a0db9 100644
--- a/source3/winbindd/idmap_adex/provider_unified.c
+++ b/source3/winbindd/idmap_adex/provider_unified.c
@@ -237,7 +237,7 @@ static NTSTATUS search_cell(struct likewise_cell *c,
done:
PRINT_NTSTATUS_ERROR(nt_status, "search_cell", 4);
- talloc_destroy(CONST_DISCARD(char*, base));
+ talloc_destroy(discard_const_p(char, base));
talloc_destroy(frame);
return nt_status;
@@ -310,7 +310,7 @@ static bool check_forest_scope(const char *dn)
}
q++;
- if (StrnCaseCmp(q, "dc=", 3) != 0) {
+ if (strncasecmp_m(q, "dc=", 3) != 0) {
nt_status = NT_STATUS_OBJECT_PATH_NOT_FOUND;
BAIL_ON_NTSTATUS_ERROR(nt_status);
}