Author: mimir Date: 2005-11-20 22:00:47 +0000 (Sun, 20 Nov 2005) New Revision: 11815
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11815 Log: A bit more comments and spaces for better readability. rafal Modified: branches/SAMBA_4_0/source/libnet/libnet.c branches/SAMBA_4_0/source/libnet/libnet_rpc.c Changeset: Modified: branches/SAMBA_4_0/source/libnet/libnet.c =================================================================== --- branches/SAMBA_4_0/source/libnet/libnet.c 2005-11-20 21:40:41 UTC (rev 11814) +++ branches/SAMBA_4_0/source/libnet/libnet.c 2005-11-20 22:00:47 UTC (rev 11815) @@ -45,6 +45,7 @@ } ctx->event_ctx = ev; + /* name resolution methods */ ctx->name_res_methods = str_list_copy(ctx, nr_methods); return ctx; Modified: branches/SAMBA_4_0/source/libnet/libnet_rpc.c =================================================================== --- branches/SAMBA_4_0/source/libnet/libnet_rpc.c 2005-11-20 21:40:41 UTC (rev 11814) +++ branches/SAMBA_4_0/source/libnet/libnet_rpc.c 2005-11-20 22:00:47 UTC (rev 11815) @@ -36,17 +36,22 @@ { NTSTATUS status; const char *binding = NULL; + + /* prepare binding string */ switch (r->level) { + case LIBNET_RPC_CONNECT_PDC: case LIBNET_RPC_CONNECT_SERVER: binding = talloc_asprintf(mem_ctx, "ncacn_np:%s", r->in.domain_name); break; + case LIBNET_RPC_CONNECT_BINDING: binding = r->in.binding; break; } + /* connect to remote dcerpc pipe */ status = dcerpc_pipe_connect(mem_ctx, &r->out.dcerpc_pipe, - binding, r->in.dcerpc_iface_uuid,r->in.dcerpc_iface_version, + binding, r->in.dcerpc_iface_uuid, r->in.dcerpc_iface_version, ctx->cred, ctx->event_ctx); if (!NT_STATUS_IS_OK(status)) { @@ -82,6 +87,7 @@ f.in.methods = NULL; f.out.address = NULL; + /* find the domain pdc first */ status = libnet_LookupPdc(ctx, mem_ctx, &f); if (!NT_STATUS_IS_OK(status)) { r->out.error_string = talloc_asprintf(mem_ctx, "libnet_LookupPdc failed: %s", @@ -89,6 +95,7 @@ return status; } + /* ok, pdc has been found so do attempt to rpc connect */ r2.level = LIBNET_RPC_CONNECT_SERVER; r2.in.domain_name = talloc_strdup(mem_ctx, f.out.address[0]); r2.in.dcerpc_iface_name = r->in.dcerpc_iface_name; @@ -120,8 +127,10 @@ switch (r->level) { case LIBNET_RPC_CONNECT_SERVER: return libnet_RpcConnectSrv(ctx, mem_ctx, r); + case LIBNET_RPC_CONNECT_BINDING: return libnet_RpcConnectSrv(ctx, mem_ctx, r); + case LIBNET_RPC_CONNECT_PDC: return libnet_RpcConnectPdc(ctx, mem_ctx, r); }
