summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-26 12:36:17 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-26 13:22:12 +1100
commit64911507a0952f52940450b4802e8b85f74b86f3 (patch)
tree5f1710f9b53face69e6a918e149603bbf5babb2c /source4/dsdb/common
parent9a72806dc9dfa4c2248a536102ccb94c3b448171 (diff)
downloadsamba-64911507a0952f52940450b4802e8b85f74b86f3.tar.gz
samba-64911507a0952f52940450b4802e8b85f74b86f3.tar.bz2
samba-64911507a0952f52940450b4802e8b85f74b86f3.zip
s4-dsdb: fixed the fetch of the server site name
when the ntds objects were moved by a recent change it broke the calculation of the server site Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 134d428461..cc75f7fdc9 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1452,12 +1452,18 @@ struct ldb_dn *samdb_server_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx)
struct ldb_dn *samdb_server_site_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx)
{
struct ldb_dn *server_dn;
+ struct ldb_dn *servers_dn;
struct ldb_dn *server_site_dn;
+ /* TODO: there must be a saner way to do this!! */
+
server_dn = samdb_server_dn(ldb, mem_ctx);
if (!server_dn) return NULL;
- server_site_dn = ldb_dn_get_parent(mem_ctx, server_dn);
+ servers_dn = ldb_dn_get_parent(mem_ctx, server_dn);
+ if (!servers_dn) return NULL;
+
+ server_site_dn = ldb_dn_get_parent(mem_ctx, servers_dn);
talloc_free(server_dn);
return server_site_dn;