summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ipc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-10 14:31:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:56:55 -0500
commit86497db6113c4ec3210d671c3fcf957d1026098c (patch)
treeea7aaa040264907802688b8154873603f4f4635c /source4/ntvfs/ipc
parentb86c1b744b48a2b664c9075335eb48098e4462fd (diff)
downloadsamba-86497db6113c4ec3210d671c3fcf957d1026098c.tar.gz
samba-86497db6113c4ec3210d671c3fcf957d1026098c.tar.bz2
samba-86497db6113c4ec3210d671c3fcf957d1026098c.zip
r14157: - pass a struct ntvfs_request to the ntvfs layer
(for now we just do #define ntvfs_request smbsrv_request, but it's the first step...) - rename ntvfs_openfile() -> ntvfs_open() - fix the talloc hierachie in some places in the ntvfs_map_*() code metze (This used to be commit ed9ed1f48f602354810937c0b0de850b44322191)
Diffstat (limited to 'source4/ntvfs/ipc')
-rw-r--r--source4/ntvfs/ipc/ipc_rap.c29
-rw-r--r--source4/ntvfs/ipc/rap_server.c20
-rw-r--r--source4/ntvfs/ipc/vfs_ipc.c79
3 files changed, 62 insertions, 66 deletions
diff --git a/source4/ntvfs/ipc/ipc_rap.c b/source4/ntvfs/ipc/ipc_rap.c
index 5656a96621..bc9bc6f31e 100644
--- a/source4/ntvfs/ipc/ipc_rap.c
+++ b/source4/ntvfs/ipc/ipc_rap.c
@@ -201,8 +201,7 @@ static NTSTATUS rap_push_string(struct ndr_push *data_push,
goto done; \
} while (0)
-static NTSTATUS _rap_netshareenum(struct smbsrv_request *req,
- struct rap_call *call)
+static NTSTATUS _rap_netshareenum(struct rap_call *call)
{
struct rap_NetShareEnum r;
NTSTATUS result;
@@ -225,7 +224,7 @@ static NTSTATUS _rap_netshareenum(struct smbsrv_request *req,
break;
}
- result = rap_netshareenum(req, &r);
+ result = rap_netshareenum(call, &r);
if (!NT_STATUS_IS_OK(result))
return result;
@@ -282,8 +281,7 @@ static NTSTATUS _rap_netshareenum(struct smbsrv_request *req,
return result;
}
-static NTSTATUS _rap_netserverenum2(struct smbsrv_request *req,
- struct rap_call *call)
+static NTSTATUS _rap_netserverenum2(struct rap_call *call)
{
struct rap_NetServerEnum2 r;
NTSTATUS result;
@@ -308,7 +306,7 @@ static NTSTATUS _rap_netserverenum2(struct smbsrv_request *req,
break;
}
- result = rap_netserverenum2(req, &r);
+ result = rap_netserverenum2(call, &r);
if (!NT_STATUS_IS_OK(result))
return result;
@@ -367,8 +365,7 @@ static NTSTATUS _rap_netserverenum2(struct smbsrv_request *req,
return result;
}
-static NTSTATUS api_Unsupported(struct smbsrv_request *req,
- struct rap_call *call)
+static NTSTATUS api_Unsupported(struct rap_call *call)
{
call->status = NERR_notsupported;
call->convert = 0;
@@ -379,14 +376,14 @@ static const struct
{
const char *name;
int id;
- NTSTATUS (*fn)(struct smbsrv_request *req, struct rap_call *call);
+ NTSTATUS (*fn)(struct rap_call *call);
} api_commands[] = {
{"NetShareEnum", RAP_WshareEnum, _rap_netshareenum },
{"NetServerEnum2", RAP_NetServerEnum2, _rap_netserverenum2 },
{NULL, -1, api_Unsupported}
};
-NTSTATUS ipc_rap_call(struct smbsrv_request *req, struct smb_trans2 *trans)
+NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct smb_trans2 *trans)
{
int i;
NTSTATUS result;
@@ -395,7 +392,7 @@ NTSTATUS ipc_rap_call(struct smbsrv_request *req, struct smb_trans2 *trans)
struct ndr_push *final_param;
struct ndr_push *final_data;
- call = new_rap_srv_call(req, trans);
+ call = new_rap_srv_call(mem_ctx, trans);
if (call == NULL)
return NT_STATUS_NO_MEMORY;
@@ -406,8 +403,8 @@ NTSTATUS ipc_rap_call(struct smbsrv_request *req, struct smb_trans2 *trans)
NDR_CHECK(ndr_pull_string(call->ndr_pull_param, NDR_SCALARS,
&call->datadesc));
- call->ndr_push_param = ndr_push_init_ctx(req);
- call->ndr_push_data = ndr_push_init_ctx(req);
+ call->ndr_push_param = ndr_push_init_ctx(call);
+ call->ndr_push_data = ndr_push_init_ctx(call);
if ((call->ndr_push_param == NULL) || (call->ndr_push_data == NULL))
return NT_STATUS_NO_MEMORY;
@@ -421,7 +418,7 @@ NTSTATUS ipc_rap_call(struct smbsrv_request *req, struct smb_trans2 *trans)
if (api_commands[i].id == call->callno) {
DEBUG(5, ("Running RAP call %s\n",
api_commands[i].name));
- result = api_commands[i].fn(req, call);
+ result = api_commands[i].fn(call);
break;
}
}
@@ -432,8 +429,8 @@ NTSTATUS ipc_rap_call(struct smbsrv_request *req, struct smb_trans2 *trans)
result_param = ndr_push_blob(call->ndr_push_param);
result_data = ndr_push_blob(call->ndr_push_data);
- final_param = ndr_push_init_ctx(req);
- final_data = ndr_push_init_ctx(req);
+ final_param = ndr_push_init_ctx(call);
+ final_data = ndr_push_init_ctx(call);
if ((final_param == NULL) || (final_data == NULL))
return NT_STATUS_NO_MEMORY;
diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c
index 9fa831dd4f..a593999693 100644
--- a/source4/ntvfs/ipc/rap_server.c
+++ b/source4/ntvfs/ipc/rap_server.c
@@ -27,30 +27,30 @@
/* At this moment these are just dummy functions, but you might get the
* idea. */
-NTSTATUS rap_netshareenum(struct smbsrv_request *req,
+NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx,
struct rap_NetShareEnum *r)
{
int i;
r->out.status = 0;
- r->out.available = dcesrv_common_get_count_of_shares(req, NULL);
- r->out.info = talloc_array(req,
- union rap_shareenum_info, r->out.available);
+ r->out.available = dcesrv_common_get_count_of_shares(mem_ctx, NULL);
+ r->out.info = talloc_array(mem_ctx,
+ union rap_shareenum_info, r->out.available);
for (i=0;i<r->out.available;i++) {
strncpy(r->out.info[i].info1.name,
- dcesrv_common_get_share_name(req, NULL, i),
+ dcesrv_common_get_share_name(mem_ctx, NULL, i),
sizeof(r->out.info[0].info1.name));
r->out.info[i].info1.pad = 0;
- r->out.info[i].info1.type = dcesrv_common_get_share_type(req, NULL, i);
- r->out.info[i].info1.comment = talloc_strdup(req,
- dcesrv_common_get_share_comment(req, NULL, i));
+ r->out.info[i].info1.type = dcesrv_common_get_share_type(mem_ctx, NULL, i);
+ r->out.info[i].info1.comment = talloc_strdup(mem_ctx,
+ dcesrv_common_get_share_comment(mem_ctx, NULL, i));
}
return NT_STATUS_OK;
}
-NTSTATUS rap_netserverenum2(struct smbsrv_request *req,
- struct rap_NetServerEnum2 *r)
+NTSTATUS rap_netserverenum2(TALLOC_CTX *mem_ctx,
+ struct rap_NetServerEnum2 *r)
{
r->out.status = 0;
r->out.available = 0;
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index ea4955d84e..36f0c9b82c 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -75,7 +75,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 ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename)
+ struct ntvfs_request *req, const char *sharename)
{
NTSTATUS status;
struct smbsrv_tcon *tcon = req->tcon;
@@ -108,8 +108,7 @@ static NTSTATUS ipc_connect(struct ntvfs_module_context *ntvfs,
/*
disconnect from a share
*/
-static NTSTATUS ipc_disconnect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon)
+static NTSTATUS ipc_disconnect(struct ntvfs_module_context *ntvfs)
{
return NT_STATUS_OK;
}
@@ -118,7 +117,7 @@ static NTSTATUS ipc_disconnect(struct ntvfs_module_context *ntvfs,
delete a file
*/
static NTSTATUS ipc_unlink(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_unlink *unl)
+ struct ntvfs_request *req, struct smb_unlink *unl)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -128,7 +127,7 @@ static NTSTATUS ipc_unlink(struct ntvfs_module_context *ntvfs,
ioctl interface - we don't do any
*/
static NTSTATUS ipc_ioctl(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req, union smb_ioctl *io)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -137,7 +136,7 @@ static NTSTATUS ipc_ioctl(struct ntvfs_module_context *ntvfs,
check if a directory exists
*/
static NTSTATUS ipc_chkpath(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_chkpath *cp)
+ struct ntvfs_request *req, struct smb_chkpath *cp)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -146,7 +145,7 @@ static NTSTATUS ipc_chkpath(struct ntvfs_module_context *ntvfs,
return info on a pathname
*/
static NTSTATUS ipc_qpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -155,7 +154,7 @@ static NTSTATUS ipc_qpathinfo(struct ntvfs_module_context *ntvfs,
set info on a pathname
*/
static NTSTATUS ipc_setpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *st)
+ struct ntvfs_request *req, union smb_setfileinfo *st)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -177,7 +176,7 @@ static int ipc_fd_destructor(void *ptr)
open a file backend - used for MSRPC pipes
*/
static NTSTATUS ipc_open_generic(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *fname,
+ struct ntvfs_request *req, const char *fname,
struct pipe_state **ps)
{
struct pipe_state *p;
@@ -253,7 +252,7 @@ static NTSTATUS ipc_open_generic(struct ntvfs_module_context *ntvfs,
open a file with ntcreatex - used for MSRPC pipes
*/
static NTSTATUS ipc_open_ntcreatex(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *oi)
+ struct ntvfs_request *req, union smb_open *oi)
{
struct pipe_state *p;
NTSTATUS status;
@@ -275,7 +274,7 @@ static NTSTATUS ipc_open_ntcreatex(struct ntvfs_module_context *ntvfs,
open a file with openx - used for MSRPC pipes
*/
static NTSTATUS ipc_open_openx(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *oi)
+ struct ntvfs_request *req, union smb_open *oi)
{
struct pipe_state *p;
NTSTATUS status;
@@ -298,7 +297,7 @@ static NTSTATUS ipc_open_openx(struct ntvfs_module_context *ntvfs,
open a file - used for MSRPC pipes
*/
static NTSTATUS ipc_open(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *oi)
+ struct ntvfs_request *req, union smb_open *oi)
{
NTSTATUS status;
@@ -321,7 +320,7 @@ static NTSTATUS ipc_open(struct ntvfs_module_context *ntvfs,
create a directory
*/
static NTSTATUS ipc_mkdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_mkdir *md)
+ struct ntvfs_request *req, union smb_mkdir *md)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -330,7 +329,7 @@ static NTSTATUS ipc_mkdir(struct ntvfs_module_context *ntvfs,
remove a directory
*/
static NTSTATUS ipc_rmdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_rmdir *rd)
+ struct ntvfs_request *req, struct smb_rmdir *rd)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -339,7 +338,7 @@ static NTSTATUS ipc_rmdir(struct ntvfs_module_context *ntvfs,
rename a set of files
*/
static NTSTATUS ipc_rename(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req, union smb_rename *ren)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -348,7 +347,7 @@ static NTSTATUS ipc_rename(struct ntvfs_module_context *ntvfs,
copy a set of files
*/
static NTSTATUS ipc_copy(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_copy *cp)
+ struct ntvfs_request *req, struct smb_copy *cp)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -369,7 +368,7 @@ static NTSTATUS ipc_readx_dcesrv_output(void *private_data, DATA_BLOB *out, size
read from a file
*/
static NTSTATUS ipc_read(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_read *rd)
+ struct ntvfs_request *req, union smb_read *rd)
{
struct ipc_private *private = ntvfs->private_data;
DATA_BLOB data;
@@ -378,7 +377,7 @@ static NTSTATUS ipc_read(struct ntvfs_module_context *ntvfs,
NTSTATUS status = NT_STATUS_OK;
if (rd->generic.level != RAW_READ_GENERIC) {
- return ntvfs_map_read(req, rd, ntvfs);
+ return ntvfs_map_read(ntvfs, req, rd);
}
fnum = rd->readx.in.fnum;
@@ -412,7 +411,7 @@ static NTSTATUS ipc_read(struct ntvfs_module_context *ntvfs,
write to a file
*/
static NTSTATUS ipc_write(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_write *wr)
+ struct ntvfs_request *req, union smb_write *wr)
{
struct ipc_private *private = ntvfs->private_data;
DATA_BLOB data;
@@ -421,7 +420,7 @@ static NTSTATUS ipc_write(struct ntvfs_module_context *ntvfs,
NTSTATUS status;
if (wr->generic.level != RAW_WRITE_GENERIC) {
- return ntvfs_map_write(req, wr, ntvfs);
+ return ntvfs_map_write(ntvfs, req, wr);
}
fnum = wr->writex.in.fnum;
@@ -448,7 +447,7 @@ static NTSTATUS ipc_write(struct ntvfs_module_context *ntvfs,
seek in a file
*/
static NTSTATUS ipc_seek(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_seek *io)
+ struct ntvfs_request *req, struct smb_seek *io)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -457,7 +456,7 @@ static NTSTATUS ipc_seek(struct ntvfs_module_context *ntvfs,
flush a file
*/
static NTSTATUS ipc_flush(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_flush *io)
+ struct ntvfs_request *req, struct smb_flush *io)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -466,13 +465,13 @@ static NTSTATUS ipc_flush(struct ntvfs_module_context *ntvfs,
close a file
*/
static NTSTATUS ipc_close(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_close *io)
+ struct ntvfs_request *req, union smb_close *io)
{
struct ipc_private *private = ntvfs->private_data;
struct pipe_state *p;
if (io->generic.level != RAW_CLOSE_CLOSE) {
- return ntvfs_map_close(req, io, ntvfs);
+ return ntvfs_map_close(ntvfs, req, io);
}
p = pipe_state_find(private, io->close.in.fnum);
@@ -489,7 +488,7 @@ static NTSTATUS ipc_close(struct ntvfs_module_context *ntvfs,
exit - closing files
*/
static NTSTATUS ipc_exit(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
struct ipc_private *private = ntvfs->private_data;
struct pipe_state *p, *next;
@@ -508,7 +507,7 @@ static NTSTATUS ipc_exit(struct ntvfs_module_context *ntvfs,
logoff - closing files open by the user
*/
static NTSTATUS ipc_logoff(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
struct ipc_private *private = ntvfs->private_data;
struct pipe_state *p, *next;
@@ -527,7 +526,7 @@ static NTSTATUS ipc_logoff(struct ntvfs_module_context *ntvfs,
setup for an async call
*/
static NTSTATUS ipc_async_setup(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
void *private)
{
return NT_STATUS_OK;
@@ -537,7 +536,7 @@ static NTSTATUS ipc_async_setup(struct ntvfs_module_context *ntvfs,
cancel an async call
*/
static NTSTATUS ipc_cancel(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
return NT_STATUS_UNSUCCESSFUL;
}
@@ -546,7 +545,7 @@ static NTSTATUS ipc_cancel(struct ntvfs_module_context *ntvfs,
lock a byte range
*/
static NTSTATUS ipc_lock(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lock *lck)
+ struct ntvfs_request *req, union smb_lock *lck)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -555,7 +554,7 @@ static NTSTATUS ipc_lock(struct ntvfs_module_context *ntvfs,
set info on a open file
*/
static NTSTATUS ipc_setfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *info)
+ struct ntvfs_request *req, union smb_setfileinfo *info)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -564,7 +563,7 @@ static NTSTATUS ipc_setfileinfo(struct ntvfs_module_context *ntvfs,
query info on a open file
*/
static NTSTATUS ipc_qfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -574,7 +573,7 @@ static NTSTATUS ipc_qfileinfo(struct ntvfs_module_context *ntvfs,
return filesystem info
*/
static NTSTATUS ipc_fsinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsinfo *fs)
+ struct ntvfs_request *req, union smb_fsinfo *fs)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -583,7 +582,7 @@ static NTSTATUS ipc_fsinfo(struct ntvfs_module_context *ntvfs,
return print queue info
*/
static NTSTATUS ipc_lpq(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lpq *lpq)
+ struct ntvfs_request *req, union smb_lpq *lpq)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -592,7 +591,7 @@ static NTSTATUS ipc_lpq(struct ntvfs_module_context *ntvfs,
list files in a directory matching a wildcard pattern
*/
static NTSTATUS ipc_search_first(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_search_first *io,
+ struct ntvfs_request *req, union smb_search_first *io,
void *search_private,
BOOL (*callback)(void *, union smb_search_data *))
{
@@ -603,7 +602,7 @@ static NTSTATUS ipc_search_first(struct ntvfs_module_context *ntvfs,
continue listing files in a directory
*/
static NTSTATUS ipc_search_next(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_search_next *io,
+ struct ntvfs_request *req, union smb_search_next *io,
void *search_private,
BOOL (*callback)(void *, union smb_search_data *))
{
@@ -614,7 +613,7 @@ static NTSTATUS ipc_search_next(struct ntvfs_module_context *ntvfs,
end listing files in a directory
*/
static NTSTATUS ipc_search_close(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_search_close *io)
+ struct ntvfs_request *req, union smb_search_close *io)
{
return NT_STATUS_ACCESS_DENIED;
}
@@ -638,7 +637,7 @@ static NTSTATUS ipc_trans_dcesrv_output(void *private_data, DATA_BLOB *out, size
/* SMBtrans - handle a DCERPC command */
static NTSTATUS ipc_dcerpc_cmd(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans)
+ struct ntvfs_request *req, struct smb_trans2 *trans)
{
struct pipe_state *p;
struct ipc_private *private = ntvfs->private_data;
@@ -684,7 +683,7 @@ static NTSTATUS ipc_dcerpc_cmd(struct ntvfs_module_context *ntvfs,
/* SMBtrans - set named pipe state */
static NTSTATUS ipc_set_nm_pipe_state(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans)
+ struct ntvfs_request *req, struct smb_trans2 *trans)
{
struct ipc_private *private = ntvfs->private_data;
struct pipe_state *p;
@@ -711,7 +710,7 @@ static NTSTATUS ipc_set_nm_pipe_state(struct ntvfs_module_context *ntvfs,
/* SMBtrans - used to provide access to SMB pipes */
static NTSTATUS ipc_trans(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans)
+ struct ntvfs_request *req, struct smb_trans2 *trans)
{
NTSTATUS status;
@@ -760,7 +759,7 @@ NTSTATUS ntvfs_ipc_init(void)
ops.chkpath = ipc_chkpath;
ops.qpathinfo = ipc_qpathinfo;
ops.setpathinfo = ipc_setpathinfo;
- ops.openfile = ipc_open;
+ ops.open = ipc_open;
ops.mkdir = ipc_mkdir;
ops.rmdir = ipc_rmdir;
ops.rename = ipc_rename;