summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_rpc.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-08-19 13:32:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:11 -0500
commit9d62046b0e09fa7a4a660859dd8651e6d60c8dc8 (patch)
tree50e7036ab1e464575d967882bc98cadb47dc8b5a /source4/libnet/libnet_rpc.c
parentc3ec4582ba8d840be0ccfd18e6704f5583b6469f (diff)
downloadsamba-9d62046b0e09fa7a4a660859dd8651e6d60c8dc8.tar.gz
samba-9d62046b0e09fa7a4a660859dd8651e6d60c8dc8.tar.bz2
samba-9d62046b0e09fa7a4a660859dd8651e6d60c8dc8.zip
r1919: paasword change basicly works now:-)
but we need to find the real pdc for the users domain and fallback to other levels metze (This used to be commit f1b9c1f3dd0fb927c065541da900ae43e0018a62)
Diffstat (limited to 'source4/libnet/libnet_rpc.c')
-rw-r--r--source4/libnet/libnet_rpc.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c
index 0ab07fa4a5..c76498d0bb 100644
--- a/source4/libnet/libnet_rpc.c
+++ b/source4/libnet/libnet_rpc.c
@@ -20,8 +20,40 @@
#include "includes.h"
+/* connect to a dcerpc interface of a domains PDC */
+NTSTATUS libnet_rpc_connect_pdc(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, union libnet_rpc_connect *r)
+{
+ NTSTATUS status;
+ const char *binding = NULL;
+ const char *pdc = NULL;
+
+ /* TODO: find real PDC!
+ * for now I use the lp_netbios_name()
+ * that's the most important for me as we don't have
+ * smbpasswd in samba4 (and this is good!:-) --metze
+ */
+ pdc = lp_netbios_name();
+
+ binding = talloc_asprintf(mem_ctx, "ncacn_np:%s",pdc);
+
+ status = dcerpc_pipe_connect(&r->pdc.out.dcerpc_pipe,
+ binding,
+ r->pdc.in.dcerpc_iface_uuid,
+ r->pdc.in.dcerpc_iface_version,
+ ctx->user.domain_name,
+ ctx->user.account_name,
+ ctx->user.password);
+
+ return status;
+}
+
/* connect to a dcerpc interface */
NTSTATUS libnet_rpc_connect(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, union libnet_rpc_connect *r)
{
- return NT_STATUS_NOT_IMPLEMENTED;
+ switch (r->pdc.level) {
+ case LIBNET_RPC_CONNECT_PDC:
+ return libnet_rpc_connect_pdc(ctx, mem_ctx, r);
+ }
+
+ return NT_STATUS_INVALID_LEVEL;
}