summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-09-20 09:46:10 -0700
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-09-20 09:46:10 -0700
commitb4eba4268d87ab7436eb567c5a629445f81a8ecc (patch)
tree336c9e280c3b3158664956d9f2be79f1a6d8e535 /source4/dsdb/common
parent7250cb3e735fb1b96ebbbcd129e29283a26a508c (diff)
downloadsamba-b4eba4268d87ab7436eb567c5a629445f81a8ecc.tar.gz
samba-b4eba4268d87ab7436eb567c5a629445f81a8ecc.tar.bz2
samba-b4eba4268d87ab7436eb567c5a629445f81a8ecc.zip
s4/dcdiag: Handle ListRoles command for dcdiag:KnowsOfRoleHolders test
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index f95cf91b8a..a5d7caeefe 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -4054,3 +4054,24 @@ WERROR dsdb_get_fsmo_role_info(TALLOC_CTX *tmp_ctx,
}
return WERR_OK;
}
+
+const char *samdb_dn_to_dnshostname(struct ldb_context *ldb,
+ TALLOC_CTX *mem_ctx,
+ struct ldb_dn *server_dn)
+{
+ int ldb_ret;
+ struct ldb_result *res = NULL;
+ const char * const attrs[] = { "dNSHostName", NULL};
+
+ ldb_ret = ldb_search(ldb, mem_ctx, &res,
+ server_dn,
+ LDB_SCOPE_BASE,
+ attrs, NULL);
+ if (ldb_ret != LDB_SUCCESS) {
+ DEBUG(4, ("Failed to find dNSHostName for dn %s, ldb error: %s",
+ ldb_dn_get_linearized(server_dn), ldb_errstring(ldb)));
+ return NULL;
+ }
+
+ return samdb_result_string(res->msgs[0], "dNSHostName", NULL);
+}