summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ipc/vfs_ipc.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-23 07:44:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:06 -0500
commita3cec511bbef2cc7768906f3af947ce2f900bde6 (patch)
tree16c0df54ed092084abd2265acc01a111cdb4c4b3 /source4/ntvfs/ipc/vfs_ipc.c
parent5821c39553f1d9899f6bcfb703876de767ccebf4 (diff)
downloadsamba-a3cec511bbef2cc7768906f3af947ce2f900bde6.tar.gz
samba-a3cec511bbef2cc7768906f3af947ce2f900bde6.tar.bz2
samba-a3cec511bbef2cc7768906f3af947ce2f900bde6.zip
r2561: completely redid the ntvfs module chaining code, You can now do something like:
ntvfs handler = nbench posix and the nbench pass-thru module will be called before the posix module. The chaining logic is now much saner, and less racy, with each level in the chain getting its own private pointer rather than relying on save/restore logic in the pass-thru module. The only pass-thru module we have at the moment is the nbench one (which records all traffic in a nbench compatibe format), but I plan on soon writing a "unixuid" pass-thru module that will implement the setegid()/setgroups()/seteuid() logic for standard posix uid handling. This separation of the posix backend from the uid handling should simplify the code, and make development easier. I also modified the nbench module so it can do multiple chaining, so if you want to you can do: ntvfs module = nbench nbench posix and it will save 2 copies of the log file in /tmp. This is really only useful for testing at the moment until we have more than one pass-thru module. (This used to be commit f84c0af35cb54c8fdc4933afefc18fa4c062aae4)
Diffstat (limited to 'source4/ntvfs/ipc/vfs_ipc.c')
-rw-r--r--source4/ntvfs/ipc/vfs_ipc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index 053222460c..96e7820be5 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -105,7 +105,7 @@ static struct pipe_state *pipe_state_find(struct ipc_private *private, uint16_t
/*
connect to a share - always works
*/
-static NTSTATUS ipc_connect(struct smbsrv_request *req, const char *sharename)
+static NTSTATUS ipc_connect(struct smbsrv_request *req, const char *sharename, int depth)
{
struct smbsrv_tcon *tcon = req->tcon;
struct ipc_private *private;
@@ -118,7 +118,7 @@ static NTSTATUS ipc_connect(struct smbsrv_request *req, const char *sharename)
if (!private) {
return NT_STATUS_NO_MEMORY;
}
- tcon->ntvfs_private = (void *)private;
+ ntvfs_set_private(tcon, depth, private);
private->pipe_list = NULL;
private->next_fnum = 1;
@@ -130,9 +130,9 @@ static NTSTATUS ipc_connect(struct smbsrv_request *req, const char *sharename)
/*
disconnect from a share
*/
-static NTSTATUS ipc_disconnect(struct smbsrv_tcon *tcon)
+static NTSTATUS ipc_disconnect(struct smbsrv_tcon *tcon, int depth)
{
- struct ipc_private *private = tcon->ntvfs_private;
+ struct ipc_private *private = tcon->ntvfs_private_list[depth];
/* close any pipes that are open. Discard any unread data */
while (private->pipe_list) {
@@ -196,7 +196,7 @@ static NTSTATUS ipc_open_generic(struct smbsrv_request *req, const char *fname,
NTSTATUS status;
struct dcesrv_ep_description ep_description;
struct auth_session_info *session_info = NULL;
- struct ipc_private *private = req->tcon->ntvfs_private;
+ NTVFS_GET_PRIVATE(ipc_private, private, req);
mem_ctx = talloc_init("ipc_open '%s'", fname);
if (!mem_ctx) {
@@ -374,7 +374,7 @@ static NTSTATUS ipc_copy(struct smbsrv_request *req, struct smb_copy *cp)
*/
static NTSTATUS ipc_read(struct smbsrv_request *req, union smb_read *rd)
{
- struct ipc_private *private = req->tcon->ntvfs_private;
+ NTVFS_GET_PRIVATE(ipc_private, private, req);
DATA_BLOB data;
uint16_t fnum;
struct pipe_state *p;
@@ -426,7 +426,7 @@ static NTSTATUS ipc_read(struct smbsrv_request *req, union smb_read *rd)
*/
static NTSTATUS ipc_write(struct smbsrv_request *req, union smb_write *wr)
{
- struct ipc_private *private = req->tcon->ntvfs_private;
+ NTVFS_GET_PRIVATE(ipc_private, private, req);
DATA_BLOB data;
uint16_t fnum;
struct pipe_state *p;
@@ -495,7 +495,7 @@ static NTSTATUS ipc_flush(struct smbsrv_request *req, struct smb_flush *io)
*/
static NTSTATUS ipc_close(struct smbsrv_request *req, union smb_close *io)
{
- struct ipc_private *private = req->tcon->ntvfs_private;
+ NTVFS_GET_PRIVATE(ipc_private, private, req);
struct pipe_state *p;
if (io->generic.level != RAW_CLOSE_CLOSE) {
@@ -595,7 +595,7 @@ NTSTATUS ipc_search_close(struct smbsrv_request *req, union smb_search_close *io
static NTSTATUS ipc_dcerpc_cmd(struct smbsrv_request *req, struct smb_trans2 *trans)
{
struct pipe_state *p;
- struct ipc_private *private = req->tcon->ntvfs_private;
+ NTVFS_GET_PRIVATE(ipc_private, private, req);
NTSTATUS status;
/* the fnum is in setup[1] */
@@ -639,8 +639,8 @@ static NTSTATUS ipc_dcerpc_cmd(struct smbsrv_request *req, struct smb_trans2 *tr
/* SMBtrans - set named pipe state */
static NTSTATUS ipc_set_nm_pipe_state(struct smbsrv_request *req, struct smb_trans2 *trans)
{
+ NTVFS_GET_PRIVATE(ipc_private, private, req);
struct pipe_state *p;
- struct ipc_private *private = req->tcon->ntvfs_private;
/* the fnum is in setup[1] */
p = pipe_state_find(private, trans->in.setup[1]);