summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb/service.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-16 18:54:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:57:32 -0500
commitd3087451c4ec25171ba956fe2cd4e1d0f64f7edc (patch)
tree9fc7f4b924a84789db962720ba989d881a4a277f /source4/smb_server/smb/service.c
parenta949db7c6d4bd35df59ba066111e6566172d4814 (diff)
downloadsamba-d3087451c4ec25171ba956fe2cd4e1d0f64f7edc.tar.gz
samba-d3087451c4ec25171ba956fe2cd4e1d0f64f7edc.tar.bz2
samba-d3087451c4ec25171ba956fe2cd4e1d0f64f7edc.zip
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)
Diffstat (limited to 'source4/smb_server/smb/service.c')
-rw-r--r--source4/smb_server/smb/service.c23
1 files changed, 23 insertions, 0 deletions
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)) {