From d3087451c4ec25171ba956fe2cd4e1d0f64f7edc Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 16 Mar 2006 18:54:19 +0000 Subject: r14487: split smbsrv_request into two parts, one will be moved to ntvfs_request but I don't to get the commit to large, to I'll do this tomorrow... metze (This used to be commit 10e627032d7d04f1ebf6efed248c426614f5aa6f) --- source4/smb_server/smb/service.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source4/smb_server/smb/service.c') diff --git a/source4/smb_server/smb/service.c b/source4/smb_server/smb/service.c index dcd91f1917..76607a0e0f 100644 --- a/source4/smb_server/smb/service.c +++ b/source4/smb_server/smb/service.c @@ -47,6 +47,21 @@ static int find_service(const char *service) return iService; } +static struct socket_address *smbsrv_get_my_addr(void *p, TALLOC_CTX *mem_ctx) +{ + struct smbsrv_connection *smb_conn = talloc_get_type(p, + struct smbsrv_connection); + + return socket_get_my_addr(smb_conn->connection->socket, mem_ctx); +} + +static struct socket_address *smbsrv_get_peer_addr(void *p, TALLOC_CTX *mem_ctx) +{ + struct smbsrv_connection *smb_conn = talloc_get_type(p, + struct smbsrv_connection); + + return socket_get_peer_addr(smb_conn->connection->socket, mem_ctx); +} /**************************************************************************** Make a connection, given the snum to connect to, and the vuser of the @@ -93,6 +108,14 @@ static NTSTATUS make_connection_snum(struct smbsrv_request *req, goto failed; } + status = ntvfs_set_addr_callbacks(tcon->ntvfs, smbsrv_get_my_addr, smbsrv_get_peer_addr, req->smb_conn); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0,("make_connection: NTVFS failed to set the oplock handler!\n")); + goto failed; + } + + req->ctx = tcon->ntvfs; + /* Invoke NTVFS connection hook */ status = ntvfs_connect(req, lp_servicename(snum)); if (!NT_STATUS_IS_OK(status)) { -- cgit