summaryrefslogtreecommitdiff
path: root/source3/rpc_server/netlogon
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-06-07 17:21:28 +0200
committerAndrew Bartlett <abartlet@samba.org>2011-07-04 18:27:58 +1000
commit541f3cf639699d23b9a96e6c615027a5be4581a9 (patch)
treeb57974dfd0ba9ef1ce19c506e382ca1a1eac2381 /source3/rpc_server/netlogon
parent6ac68a803e79984e8d3c065b7b366da0bdd495d6 (diff)
downloadsamba-541f3cf639699d23b9a96e6c615027a5be4581a9.tar.gz
samba-541f3cf639699d23b9a96e6c615027a5be4581a9.tar.bz2
samba-541f3cf639699d23b9a96e6c615027a5be4581a9.zip
s3-rpc_server: Migrate rpc function to tsocket_address.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/rpc_server/netlogon')
-rw-r--r--source3/rpc_server/netlogon/srv_netlog_nt.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/source3/rpc_server/netlogon/srv_netlog_nt.c b/source3/rpc_server/netlogon/srv_netlog_nt.c
index 03897d77a4..e52dd85352 100644
--- a/source3/rpc_server/netlogon/srv_netlog_nt.c
+++ b/source3/rpc_server/netlogon/srv_netlog_nt.c
@@ -44,6 +44,7 @@
#include "passdb.h"
#include "auth.h"
#include "messages.h"
+#include "../lib/tsocket/tsocket.h"
extern userdom_struct current_user_info;
@@ -417,7 +418,7 @@ NTSTATUS _netr_NetrEnumerateTrustedDomains(struct pipes_struct *p,
status = rpcint_binding_handle(p->mem_ctx,
&ndr_table_lsarpc,
- p->client_id,
+ p->remote_address,
p->session_info,
p->msg_ctx,
&h);
@@ -643,13 +644,15 @@ static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct,
NTSTATUS result = NT_STATUS_OK;
TALLOC_CTX *mem_ctx;
struct dcerpc_binding_handle *h = NULL;
- static struct client_address client_id;
+ struct tsocket_address *local;
struct policy_handle user_handle;
uint32_t user_rid;
struct dom_sid *domain_sid;
uint32_t acct_ctrl;
union samr_UserInfo *info;
struct auth_serversupplied_info *session_info;
+ int rc;
+
#if 0
/*
@@ -682,12 +685,19 @@ static NTSTATUS get_md4pw(struct samr_Password *md4pw, const char *mach_acct,
ZERO_STRUCT(user_handle);
- strlcpy(client_id.addr, "127.0.0.1", sizeof(client_id.addr));
- client_id.name = "127.0.0.1";
+ rc = tsocket_address_inet_from_strings(mem_ctx,
+ "ip",
+ "127.0.0.1",
+ 0,
+ &local);
+ if (rc < 0) {
+ status = NT_STATUS_NO_MEMORY;
+ goto out;
+ }
status = rpcint_binding_handle(mem_ctx,
&ndr_table_samr,
- &client_id,
+ local,
session_info,
msg_ctx,
&h);
@@ -1098,21 +1108,29 @@ static NTSTATUS netr_set_machine_account_password(TALLOC_CTX *mem_ctx,
NTSTATUS status;
NTSTATUS result = NT_STATUS_OK;
struct dcerpc_binding_handle *h = NULL;
- static struct client_address client_id;
+ struct tsocket_address *local;
struct policy_handle user_handle;
uint32_t acct_ctrl;
union samr_UserInfo *info;
struct samr_UserInfo18 info18;
DATA_BLOB in,out;
+ int rc;
ZERO_STRUCT(user_handle);
- strlcpy(client_id.addr, "127.0.0.1", sizeof(client_id.addr));
- client_id.name = "127.0.0.1";
+ rc = tsocket_address_inet_from_strings(mem_ctx,
+ "ip",
+ "127.0.0.1",
+ 0,
+ &local);
+ if (rc < 0) {
+ status = NT_STATUS_NO_MEMORY;
+ goto out;
+ }
status = rpcint_binding_handle(mem_ctx,
&ndr_table_samr,
- &client_id,
+ local,
session_info,
msg_ctx,
&h);