svn commit: samba r4942 - in branches/SAMBA_4_0/source/ntvfs/cifs: .
tridge at samba.org
tridge at samba.org
Sun Jan 23 11:42:57 GMT 2005
Author: tridge
Date: 2005-01-23 11:42:56 +0000 (Sun, 23 Jan 2005)
New Revision: 4942
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4942
Log:
converted the cifs backend to not use event_context_merge(). Instead,
is supplies the server event context during the connect.
Modified:
branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c 2005-01-23 11:12:42 UTC (rev 4941)
+++ branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c 2005-01-23 11:42:56 UTC (rev 4942)
@@ -28,6 +28,7 @@
#include "includes.h"
#include "events.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/composite/composite.h"
#include "smb_server/smb_server.h"
/* this is stored in ntvfs_private */
@@ -96,12 +97,14 @@
connect to a share - used when a tree_connect operation comes in.
*/
static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename)
+ struct smbsrv_request *req, const char *sharename)
{
struct smbsrv_tcon *tcon = req->tcon;
NTSTATUS status;
struct cvfs_private *private;
const char *host, *user, *pass, *domain, *remote_share;
+ struct smb_composite_connect io;
+ struct smbcli_composite *creq;
/* Here we need to determine which server to connect to.
* For now we use parametric options, type cifs.
@@ -121,7 +124,7 @@
return NT_STATUS_INVALID_PARAMETER;
}
- private = talloc_p(req->tcon, struct cvfs_private);
+ private = talloc(req->tcon, struct cvfs_private);
if (!private) {
return NT_STATUS_NO_MEMORY;
}
@@ -129,18 +132,23 @@
ntvfs->private_data = private;
- status = smbcli_tree_full_connection(private,
- &private->tree,
- "vfs_cifs",
- host,
- 0,
- remote_share, "?????",
- user, domain,
- pass);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ /* connect to the server, using the smbd event context */
+ io.in.dest_host = host;
+ io.in.port = 0;
+ io.in.called_name = host;
+ io.in.calling_name = "vfs_cifs";
+ io.in.service = remote_share;
+ io.in.service_type = "?????";
+ io.in.domain = domain;
+ io.in.user = user;
+ io.in.password = pass;
+
+ creq = smb_composite_connect_send(&io, tcon->smb_conn->connection->event.ctx);
+ status = smb_composite_connect_recv(creq, private);
+ NT_STATUS_NOT_OK_RETURN(status);
+ private->tree = io.out.tree;
+
private->transport = private->tree->session->transport;
SETUP_PID;
private->tcon = req->tcon;
@@ -155,9 +163,6 @@
private->transport->socket->event.fde->handler = cifs_socket_handler;
private->transport->socket->event.fde->private = private;
- private->transport->socket->event.ctx = event_context_merge(tcon->smb_conn->connection->event.ctx,
- private->transport->socket->event.ctx);
- talloc_reference(private, private->transport->socket->event.ctx);
private->map_generic = lp_parm_bool(req->tcon->service,
"cifs", "mapgeneric", False);
More information about the samba-cvs
mailing list