2 Unix SMB/CIFS implementation.
4 Copyright (C) Stefan Metzmacher 2004
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 /* connect to a dcerpc interface of a domains PDC */
24 NTSTATUS libnet_rpc_connect_pdc(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, union libnet_rpc_connect *r)
27 const char *binding = NULL;
28 const char *pdc = NULL;
30 /* TODO: find real PDC!
31 * for now I use the lp_netbios_name()
32 * that's the most important for me as we don't have
33 * smbpasswd in samba4 (and this is good!:-) --metze
35 pdc = lp_netbios_name();
37 binding = talloc_asprintf(mem_ctx, "ncacn_np:%s",pdc);
39 status = dcerpc_pipe_connect(&r->pdc.out.dcerpc_pipe,
41 r->pdc.in.dcerpc_iface_uuid,
42 r->pdc.in.dcerpc_iface_version,
43 ctx->user.domain_name,
44 ctx->user.account_name,
50 /* connect to a dcerpc interface */
51 NTSTATUS libnet_rpc_connect(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, union libnet_rpc_connect *r)
53 switch (r->pdc.level) {
54 case LIBNET_RPC_CONNECT_PDC:
55 return libnet_rpc_connect_pdc(ctx, mem_ctx, r);
58 return NT_STATUS_INVALID_LEVEL;