1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r21503: add usefull function to get the site dn for the local server

metze
(This used to be commit 08b8e9acff)
This commit is contained in:
Stefan Metzmacher 2007-02-22 15:53:06 +00:00 committed by Gerald (Jerry) Carter
parent 6c32f44f24
commit 6cb8ac851c

View File

@ -1383,6 +1383,23 @@ struct ldb_dn *samdb_server_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx)
return ldb_dn_get_parent(mem_ctx, samdb_ntds_settings_dn(ldb));
}
/*
work out the server dn for the current open ldb
*/
struct ldb_dn *samdb_server_site_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx)
{
struct ldb_dn *server_dn;
struct ldb_dn *server_site_dn;
server_dn = samdb_server_dn(ldb, mem_ctx);
if (!server_dn) return NULL;
server_site_dn = ldb_dn_get_parent(mem_ctx, server_dn);
talloc_free(server_dn);
return server_site_dn;
}
/*
work out if we are the PDC for the domain of the current open ldb
*/