summaryrefslogtreecommitdiff
path: root/source4/nbt_server/wins
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-11-01 23:31:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:24:44 -0500
commitb7774527faf095f612eb1de48efacec6bd710a87 (patch)
tree0fb414c1c07d45504d04818dccd6918444ceedb8 /source4/nbt_server/wins
parentd046e8d0ccdcd5c288b42e8ecb7ab2394a5841d7 (diff)
downloadsamba-b7774527faf095f612eb1de48efacec6bd710a87.tar.gz
samba-b7774527faf095f612eb1de48efacec6bd710a87.tar.bz2
samba-b7774527faf095f612eb1de48efacec6bd710a87.zip
r19531: Make struct ldb_dn opaque and local to ldb_dn.c
(This used to be commit 889fb983ba1cf8a11424a8b3dc3a5ef76e780082)
Diffstat (limited to 'source4/nbt_server/wins')
-rw-r--r--source4/nbt_server/wins/winsdb.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index 798663eb8b..bc518233ab 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -179,6 +179,7 @@ static NTSTATUS winsdb_nbt_name(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, struct n
{
NTSTATUS status;
struct nbt_name *name;
+ unsigned int comp_num;
uint32_t cur = 0;
name = talloc(mem_ctx, struct nbt_name);
@@ -187,20 +188,22 @@ static NTSTATUS winsdb_nbt_name(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, struct n
goto failed;
}
- if (dn->comp_num > 3) {
+ comp_num = ldb_dn_get_comp_num(dn);
+
+ if (comp_num > 3) {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
goto failed;
}
- if (dn->comp_num > cur && strcasecmp("scope", dn->components[cur].name) == 0) {
- name->scope = (const char *)talloc_steal(name, dn->components[cur].value.data);
+ if (comp_num > cur && strcasecmp("scope", ldb_dn_get_component_name(dn, cur)) == 0) {
+ name->scope = (const char *)talloc_strdup(name, (char *)ldb_dn_get_component_val(dn, cur)->data);
cur++;
} else {
name->scope = NULL;
}
- if (dn->comp_num > cur && strcasecmp("name", dn->components[cur].name) == 0) {
- name->name = (const char *)talloc_steal(name, dn->components[cur].value.data);
+ if (comp_num > cur && strcasecmp("name", ldb_dn_get_component_name(dn, cur)) == 0) {
+ name->name = (const char *)talloc_strdup(name, (char *)ldb_dn_get_component_val(dn, cur)->data);
cur++;
} else {
name->name = talloc_strdup(name, "");
@@ -210,8 +213,8 @@ static NTSTATUS winsdb_nbt_name(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, struct n
}
}
- if (dn->comp_num > cur && strcasecmp("type", dn->components[cur].name) == 0) {
- name->type = strtoul((char *)dn->components[cur].value.data, NULL, 0);
+ if (comp_num > cur && strcasecmp("type", ldb_dn_get_component_name(dn, cur)) == 0) {
+ name->type = strtoul((char *)ldb_dn_get_component_val(dn, cur)->data, NULL, 0);
cur++;
} else {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;