summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ntvfs_interface.c
diff options
context:
space:
mode:
authorSam Liddicott <sam@liddicott.com>2009-05-14 08:58:50 +0100
committerStefan Metzmacher <metze@samba.org>2009-05-20 13:32:27 +0200
commit4b21ad9db7babb1e278fa2e3b81737b6df36e2d2 (patch)
treefc91aff51044875e3ae8b26cb33f579104a1d72d /source4/ntvfs/ntvfs_interface.c
parente11f9b46c6345471cca76b9772080d3bfd687852 (diff)
downloadsamba-4b21ad9db7babb1e278fa2e3b81737b6df36e2d2.tar.gz
samba-4b21ad9db7babb1e278fa2e3b81737b6df36e2d2.tar.bz2
samba-4b21ad9db7babb1e278fa2e3b81737b6df36e2d2.zip
Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename
This change brings ntvfs_connect into compliance with other ntvfs functions which take an ntvfs module, an ntvfs request and an smb io union. It now becomes the responsibility of ntvfs modules to examine tcon->generic.level themselves and derive the share name and any other options directly; e.g. const char *sharename; switch (tcon->generic.level) { case RAW_TCON_TCON: sharename = tcon->tcon.in.service; break; case RAW_TCON_TCONX: sharename = tcon->tconx.in.path; break; case RAW_TCON_SMB2: default: return NT_STATUS_INVALID_LEVEL; } if (strncmp(sharename, "\\\\", 2) == 0) { char *p = strchr(sharename+2, '\\'); if (p) { sharename = p + 1; } } service.c smbsrv_tcon_backend() is called before ntvfs_connect and fills in some of the tcon->..out values. For the case of RAW_TCON_TCONX, it filles out tcon->tconx.out.tid and tcon->tconx.out.options For the case of RAW_TCON_TCON it fills out tcon->tcon.out.tid and tcon->tcon.out.max_xmit Thus the ntvfs_connect function for vfs modules may override these values if desired, but are not required to. ntvfs_connect functions are required to fill in the tcon->tconx.out.*_type fields, for RAW_TCON_TCONX, perhaps something like: if (tcon->generic.level == RAW_TCON_TCONX) { tcon->tconx.out.fs_type = ntvfs->ctx->fs_type; tcon->tconx.out.dev_type = ntvfs->ctx->dev_type; } Signed-off-by: Sam Liddicott <sam@liddicott.com> (I fixed the ntvfs_connect() in the smb_server/smb2/ and the RAW_TCON_SMB2 switch case in the modules) Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/ntvfs/ntvfs_interface.c')
-rw-r--r--source4/ntvfs/ntvfs_interface.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/ntvfs/ntvfs_interface.c b/source4/ntvfs/ntvfs_interface.c
index 6d3fe55c06..808bd97e61 100644
--- a/source4/ntvfs/ntvfs_interface.c
+++ b/source4/ntvfs/ntvfs_interface.c
@@ -22,13 +22,13 @@
#include "ntvfs/ntvfs.h"
/* connect/disconnect */
-NTSTATUS ntvfs_connect(struct ntvfs_request *req, const char *sharename)
+NTSTATUS ntvfs_connect(struct ntvfs_request *req, union smb_tcon *tcon)
{
struct ntvfs_module_context *ntvfs = req->ctx->modules;
if (!ntvfs->ops->connect) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->connect(ntvfs, req, sharename);
+ return ntvfs->ops->connect(ntvfs, req, tcon);
}
NTSTATUS ntvfs_disconnect(struct ntvfs_context *ntvfs_ctx)
@@ -335,12 +335,13 @@ NTSTATUS ntvfs_cancel(struct ntvfs_request *req)
/* initial setup */
NTSTATUS ntvfs_next_connect(struct ntvfs_module_context *ntvfs,
- struct ntvfs_request *req, const char *sharename)
+ struct ntvfs_request *req,
+ union smb_tcon *tcon)
{
if (!ntvfs->next || !ntvfs->next->ops->connect) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->connect(ntvfs->next, req, sharename);
+ return ntvfs->next->ops->connect(ntvfs->next, req, tcon);
}
NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs)