2 Unix SMB/CIFS implementation.
4 useful utilities for the DRS server
6 Copyright (C) Andrew Tridgell 2009
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "librpc/gen_ndr/ndr_drsuapi.h"
24 #include "rpc_server/dcerpc_server.h"
25 #include "rpc_server/common/common.h"
26 #include "rpc_server/drsuapi/dcesrv_drsuapi.h"
27 #include "dsdb/samdb/samdb.h"
28 #include "lib/ldb/include/ldb_errors.h"
29 #include "param/param.h"
30 #include "librpc/gen_ndr/ndr_drsblobs.h"
31 #include "libcli/security/dom_sid.h"
34 format a drsuapi_DsReplicaObjectIdentifier naming context as a string
36 char *drs_ObjectIdentifier_to_string(TALLOC_CTX *mem_ctx,
37 struct drsuapi_DsReplicaObjectIdentifier *nc)
39 char *guid, *sid, *ret;
40 guid = GUID_string(mem_ctx, &nc->guid);
41 sid = dom_sid_string(mem_ctx, &nc->sid);
42 ret = talloc_asprintf(mem_ctx, "<GUID=%s>;<SID=%s>;%s",