struct async_info {
struct async_info *next, *prev;
struct cvfs_private *cvfs;
- struct smbsrv_request *req;
+ struct ntvfs_request *req;
struct smbcli_request *c_req;
void *parms;
};
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 ntvfs_request *req, const char *sharename)
{
struct smbsrv_tcon *tcon = req->tcon;
NTSTATUS status;
/*
disconnect from a share
*/
-static NTSTATUS cvfs_disconnect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon)
+static NTSTATUS cvfs_disconnect(struct ntvfs_module_context *ntvfs)
{
struct cvfs_private *private = ntvfs->private_data;
static void async_simple(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smbcli_request_simple_recv(c_req);
req->async_states->send_fn(req);
}
The name can contain CIFS wildcards, but rarely does (except with OS/2 clients)
*/
static NTSTATUS cvfs_unlink(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_unlink *unl)
+ struct ntvfs_request *req, struct smb_unlink *unl)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
static void async_ioctl(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_ioctl_recv(c_req, req, async->parms);
req->async_states->send_fn(req);
}
ioctl interface
*/
static NTSTATUS cvfs_ioctl(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req, union smb_ioctl *io)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
check if a directory exists
*/
static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_chkpath *cp)
+ struct ntvfs_request *req, struct smb_chkpath *cp)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
static void async_qpathinfo(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_pathinfo_recv(c_req, req, async->parms);
req->async_states->send_fn(req);
}
return info on a pathname
*/
static NTSTATUS cvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
static void async_qfileinfo(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_fileinfo_recv(c_req, req, async->parms);
req->async_states->send_fn(req);
}
query info on a open file
*/
static NTSTATUS cvfs_qfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
set info on a pathname
*/
static NTSTATUS cvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *st)
+ struct ntvfs_request *req, union smb_setfileinfo *st)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
static void async_open(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_open_recv(c_req, req, async->parms);
req->async_states->send_fn(req);
}
open a file
*/
static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *io)
+ struct ntvfs_request *req, union smb_open *io)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
if (io->generic.level != RAW_OPEN_GENERIC &&
private->map_generic) {
- return ntvfs_map_open(req, io, ntvfs);
+ return ntvfs_map_open(ntvfs, req, io);
}
if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
create a directory
*/
static NTSTATUS cvfs_mkdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_mkdir *md)
+ struct ntvfs_request *req, union smb_mkdir *md)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
remove a directory
*/
static NTSTATUS cvfs_rmdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_rmdir *rd)
+ struct ntvfs_request *req, struct smb_rmdir *rd)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
rename a set of files
*/
static NTSTATUS cvfs_rename(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req, union smb_rename *ren)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
copy a set of files
*/
static NTSTATUS cvfs_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_NOT_SUPPORTED;
}
static void async_read(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_read_recv(c_req, async->parms);
req->async_states->send_fn(req);
}
read from a file
*/
static NTSTATUS cvfs_read(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_read *rd)
+ struct ntvfs_request *req, union smb_read *rd)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
if (rd->generic.level != RAW_READ_GENERIC &&
private->map_generic) {
- return ntvfs_map_read(req, rd, ntvfs);
+ return ntvfs_map_read(ntvfs, req, rd);
}
if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
static void async_write(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_write_recv(c_req, async->parms);
req->async_states->send_fn(req);
}
write to a file
*/
static NTSTATUS cvfs_write(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_write *wr)
+ struct ntvfs_request *req, union smb_write *wr)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
if (wr->generic.level != RAW_WRITE_GENERIC &&
private->map_generic) {
- return ntvfs_map_write(req, wr, ntvfs);
+ return ntvfs_map_write(ntvfs, req, wr);
}
if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
static void async_seek(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_seek_recv(c_req, async->parms);
req->async_states->send_fn(req);
}
seek in a file
*/
static NTSTATUS cvfs_seek(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_seek *io)
+ struct ntvfs_request *req, struct smb_seek *io)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
flush a file
*/
static NTSTATUS cvfs_flush(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_flush *io)
+ struct ntvfs_request *req, struct smb_flush *io)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
close a file
*/
static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_close *io)
+ struct ntvfs_request *req, union smb_close *io)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
if (io->generic.level != RAW_CLOSE_GENERIC &&
private->map_generic) {
- return ntvfs_map_close(req, io, ntvfs);
+ return ntvfs_map_close(ntvfs, req, io);
}
if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
exit - closing files open by the pid
*/
static NTSTATUS cvfs_exit(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
logoff - closing files open by the user
*/
static NTSTATUS cvfs_logoff(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
/* we can't do this right in the cifs backend .... */
return NT_STATUS_OK;
setup for an async call - nothing to do yet
*/
static NTSTATUS cvfs_async_setup(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
void *private)
{
return NT_STATUS_OK;
cancel an async call
*/
static NTSTATUS cvfs_cancel(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
struct cvfs_private *private = ntvfs->private_data;
lock a byte range
*/
static NTSTATUS cvfs_lock(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lock *lck)
+ struct ntvfs_request *req, union smb_lock *lck)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
if (lck->generic.level != RAW_LOCK_GENERIC &&
private->map_generic) {
- return ntvfs_map_lock(req, lck, ntvfs);
+ return ntvfs_map_lock(ntvfs, req, lck);
}
if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) {
set info on a open file
*/
static NTSTATUS cvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
union smb_setfileinfo *info)
{
struct cvfs_private *private = ntvfs->private_data;
static void async_fsinfo(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_fsinfo_recv(c_req, req, async->parms);
req->async_states->send_fn(req);
}
return filesystem space info
*/
static NTSTATUS cvfs_fsinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsinfo *fs)
+ struct ntvfs_request *req, union smb_fsinfo *fs)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
return print queue info
*/
static NTSTATUS cvfs_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_NOT_SUPPORTED;
}
list files in a directory matching a wildcard pattern
*/
static NTSTATUS cvfs_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 *))
{
/* continue a search */
static NTSTATUS cvfs_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 *))
{
/* close a search */
static NTSTATUS cvfs_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)
{
struct cvfs_private *private = ntvfs->private_data;
static void async_trans2(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_trans2_recv(c_req, req, async->parms);
req->async_states->send_fn(req);
}
/* raw trans2 */
static NTSTATUS cvfs_trans2(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans2)
+ struct ntvfs_request *req, struct smb_trans2 *trans2)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
/* SMBtrans - not used on file shares */
static NTSTATUS cvfs_trans(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans2)
+ struct ntvfs_request *req, struct smb_trans2 *trans2)
{
return NT_STATUS_ACCESS_DENIED;
}
static void async_changenotify(struct smbcli_request *c_req)
{
struct async_info *async = c_req->async.private;
- struct smbsrv_request *req = async->req;
+ struct ntvfs_request *req = async->req;
req->async_states->status = smb_raw_changenotify_recv(c_req, req, async->parms);
req->async_states->send_fn(req);
}
/* change notify request - always async */
static NTSTATUS cvfs_notify(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_notify *info)
+ struct ntvfs_request *req, struct smb_notify *info)
{
struct cvfs_private *private = ntvfs->private_data;
struct smbcli_request *c_req;
ops.chkpath = cvfs_chkpath;
ops.qpathinfo = cvfs_qpathinfo;
ops.setpathinfo = cvfs_setpathinfo;
- ops.openfile = cvfs_open;
+ ops.open = cvfs_open;
ops.mkdir = cvfs_mkdir;
ops.rmdir = cvfs_rmdir;
ops.rename = cvfs_rename;
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;
break;
}
- result = rap_netshareenum(req, &r);
+ result = rap_netshareenum(call, &r);
if (!NT_STATUS_IS_OK(result))
return result;
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;
break;
}
- result = rap_netserverenum2(req, &r);
+ result = rap_netserverenum2(call, &r);
if (!NT_STATUS_IS_OK(result))
return result;
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;
{
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;
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;
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;
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;
}
}
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;
/* 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;
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;
/*
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
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;
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
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;
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;
}
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;
}
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);
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;
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;
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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 *))
{
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 *))
{
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;
}
/* 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;
/* 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;
/* 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;
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;
/*
log one request to the nbench log
*/
-static void nbench_log(struct smbsrv_request *req,
+static void nbench_log(struct ntvfs_request *req,
const char *format, ...) PRINTF_ATTRIBUTE(2, 3);
-static void nbench_log(struct smbsrv_request *req,
+static void nbench_log(struct ntvfs_request *req,
const char *format, ...)
{
struct nbench_private *private = req->async_states->ntvfs->private_data;
status code and any result parameters much harder.
*/
#define PASS_THRU_REQ_PRE_ASYNC(ntvfs, req, op, par1) do { \
- status = ntvfs_async_state_push(req, par1, nbench_##op##_send, ntvfs); \
+ status = ntvfs_async_state_push(ntvfs, req, par1, nbench_##op##_send); \
if (!NT_STATUS_IS_OK(status)) { \
return status; \
} \
connect to a share - used when a tree_connect operation comes in.
*/
static NTSTATUS nbench_connect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename)
+ struct ntvfs_request *req, const char *sharename)
{
struct nbench_private *nprivates;
NTSTATUS status;
/*
disconnect from a share
*/
-static NTSTATUS nbench_disconnect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon)
+static NTSTATUS nbench_disconnect(struct ntvfs_module_context *ntvfs)
{
struct nbench_private *nprivates = ntvfs->private_data;
NTSTATUS status;
close(nprivates->log_fd);
- status = ntvfs_next_disconnect(ntvfs, tcon);
+ status = ntvfs_next_disconnect(ntvfs);
return status;
}
delete a file - the dirtype specifies the file types to include in the search.
The name can contain CIFS wildcards, but rarely does (except with OS/2 clients)
*/
-static void nbench_unlink_send(struct smbsrv_request *req)
+static void nbench_unlink_send(struct ntvfs_request *req)
{
struct smb_unlink *unl = req->async_states->private_data;
}
static NTSTATUS nbench_unlink(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_unlink *unl)
+ struct ntvfs_request *req, struct smb_unlink *unl)
{
NTSTATUS status;
/*
ioctl interface
*/
-static void nbench_ioctl_send(struct smbsrv_request *req)
+static void nbench_ioctl_send(struct ntvfs_request *req)
{
nbench_log(req, "Ioctl - NOT HANDLED\n");
}
static NTSTATUS nbench_ioctl(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req, union smb_ioctl *io)
{
NTSTATUS status;
/*
check if a directory exists
*/
-static void nbench_chkpath_send(struct smbsrv_request *req)
+static void nbench_chkpath_send(struct ntvfs_request *req)
{
struct smb_chkpath *cp = req->async_states->private_data;
}
static NTSTATUS nbench_chkpath(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_chkpath *cp)
+ struct ntvfs_request *req, struct smb_chkpath *cp)
{
NTSTATUS status;
/*
return info on a pathname
*/
-static void nbench_qpathinfo_send(struct smbsrv_request *req)
+static void nbench_qpathinfo_send(struct ntvfs_request *req)
{
union smb_fileinfo *info = req->async_states->private_data;
}
static NTSTATUS nbench_qpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
NTSTATUS status;
/*
query info on a open file
*/
-static void nbench_qfileinfo_send(struct smbsrv_request *req)
+static void nbench_qfileinfo_send(struct ntvfs_request *req)
{
union smb_fileinfo *info = req->async_states->private_data;
}
static NTSTATUS nbench_qfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
NTSTATUS status;
/*
set info on a pathname
*/
-static void nbench_setpathinfo_send(struct smbsrv_request *req)
+static void nbench_setpathinfo_send(struct ntvfs_request *req)
{
union smb_setfileinfo *st = req->async_states->private_data;
}
static NTSTATUS nbench_setpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *st)
+ struct ntvfs_request *req, union smb_setfileinfo *st)
{
NTSTATUS status;
/*
open a file
*/
-static void nbench_openfile_send(struct smbsrv_request *req)
+static void nbench_open_send(struct ntvfs_request *req)
{
union smb_open *io = req->async_states->private_data;
PASS_THRU_REP_POST(req);
}
-static NTSTATUS nbench_openfile(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *io)
+static NTSTATUS nbench_open(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req, union smb_open *io)
{
NTSTATUS status;
- PASS_THRU_REQ(ntvfs, req, openfile, io, (ntvfs, req, io));
+ PASS_THRU_REQ(ntvfs, req, open, io, (ntvfs, req, io));
return status;
}
/*
create a directory
*/
-static void nbench_mkdir_send(struct smbsrv_request *req)
+static void nbench_mkdir_send(struct ntvfs_request *req)
{
nbench_log(req, "Mkdir - NOT HANDLED\n");
}
static NTSTATUS nbench_mkdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_mkdir *md)
+ struct ntvfs_request *req, union smb_mkdir *md)
{
NTSTATUS status;
/*
remove a directory
*/
-static void nbench_rmdir_send(struct smbsrv_request *req)
+static void nbench_rmdir_send(struct ntvfs_request *req)
{
struct smb_rmdir *rd = req->async_states->private_data;
}
static NTSTATUS nbench_rmdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_rmdir *rd)
+ struct ntvfs_request *req, struct smb_rmdir *rd)
{
NTSTATUS status;
/*
rename a set of files
*/
-static void nbench_rename_send(struct smbsrv_request *req)
+static void nbench_rename_send(struct ntvfs_request *req)
{
union smb_rename *ren = req->async_states->private_data;
}
static NTSTATUS nbench_rename(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req, union smb_rename *ren)
{
NTSTATUS status;
/*
copy a set of files
*/
-static void nbench_copy_send(struct smbsrv_request *req)
+static void nbench_copy_send(struct ntvfs_request *req)
{
nbench_log(req, "Copy - NOT HANDLED\n");
}
static NTSTATUS nbench_copy(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_copy *cp)
+ struct ntvfs_request *req, struct smb_copy *cp)
{
NTSTATUS status;
/*
read from a file
*/
-static void nbench_read_send(struct smbsrv_request *req)
+static void nbench_read_send(struct ntvfs_request *req)
{
union smb_read *rd = req->async_states->private_data;
}
static NTSTATUS nbench_read(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_read *rd)
+ struct ntvfs_request *req, union smb_read *rd)
{
NTSTATUS status;
/*
write to a file
*/
-static void nbench_write_send(struct smbsrv_request *req)
+static void nbench_write_send(struct ntvfs_request *req)
{
union smb_write *wr = req->async_states->private_data;
}
static NTSTATUS nbench_write(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_write *wr)
+ struct ntvfs_request *req, union smb_write *wr)
{
NTSTATUS status;
/*
seek in a file
*/
-static void nbench_seek_send(struct smbsrv_request *req)
+static void nbench_seek_send(struct ntvfs_request *req)
{
nbench_log(req, "Seek - NOT HANDLED\n");
}
static NTSTATUS nbench_seek(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_seek *io)
+ struct ntvfs_request *req, struct smb_seek *io)
{
NTSTATUS status;
/*
flush a file
*/
-static void nbench_flush_send(struct smbsrv_request *req)
+static void nbench_flush_send(struct ntvfs_request *req)
{
struct smb_flush *io = req->async_states->private_data;
}
static NTSTATUS nbench_flush(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_flush *io)
+ struct ntvfs_request *req, struct smb_flush *io)
{
NTSTATUS status;
/*
close a file
*/
-static void nbench_close_send(struct smbsrv_request *req)
+static void nbench_close_send(struct ntvfs_request *req)
{
union smb_close *io = req->async_states->private_data;
}
static NTSTATUS nbench_close(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_close *io)
+ struct ntvfs_request *req, union smb_close *io)
{
NTSTATUS status;
/*
exit - closing files
*/
-static void nbench_exit_send(struct smbsrv_request *req)
+static void nbench_exit_send(struct ntvfs_request *req)
{
nbench_log(req, "Exit - NOT HANDLED\n");
}
static NTSTATUS nbench_exit(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
NTSTATUS status;
/*
logoff - closing files
*/
-static void nbench_logoff_send(struct smbsrv_request *req)
+static void nbench_logoff_send(struct ntvfs_request *req)
{
nbench_log(req, "Logoff - NOT HANDLED\n");
}
static NTSTATUS nbench_logoff(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
NTSTATUS status;
/*
async_setup - send fn
*/
-static void nbench_async_setup_send(struct smbsrv_request *req)
+static void nbench_async_setup_send(struct ntvfs_request *req)
{
PASS_THRU_REP_POST(req);
}
async setup
*/
static NTSTATUS nbench_async_setup(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
void *private)
{
NTSTATUS status;
}
-static void nbench_cancel_send(struct smbsrv_request *req)
+static void nbench_cancel_send(struct ntvfs_request *req)
{
PASS_THRU_REP_POST(req);
}
cancel an existing async request
*/
static NTSTATUS nbench_cancel(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
NTSTATUS status;
/*
lock a byte range
*/
-static void nbench_lock_send(struct smbsrv_request *req)
+static void nbench_lock_send(struct ntvfs_request *req)
{
union smb_lock *lck = req->async_states->private_data;
}
static NTSTATUS nbench_lock(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lock *lck)
+ struct ntvfs_request *req, union smb_lock *lck)
{
NTSTATUS status;
/*
set info on a open file
*/
-static void nbench_setfileinfo_send(struct smbsrv_request *req)
+static void nbench_setfileinfo_send(struct ntvfs_request *req)
{
union smb_setfileinfo *info = req->async_states->private_data;
}
static NTSTATUS nbench_setfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
union smb_setfileinfo *info)
{
NTSTATUS status;
/*
return filesystem space info
*/
-static void nbench_fsinfo_send(struct smbsrv_request *req)
+static void nbench_fsinfo_send(struct ntvfs_request *req)
{
union smb_fsinfo *fs = req->async_states->private_data;
}
static NTSTATUS nbench_fsinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsinfo *fs)
+ struct ntvfs_request *req, union smb_fsinfo *fs)
{
NTSTATUS status;
/*
return print queue info
*/
-static void nbench_lpq_send(struct smbsrv_request *req)
+static void nbench_lpq_send(struct ntvfs_request *req)
{
union smb_lpq *lpq = req->async_states->private_data;
}
static NTSTATUS nbench_lpq(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lpq *lpq)
+ struct ntvfs_request *req, union smb_lpq *lpq)
{
NTSTATUS status;
/*
list files in a directory matching a wildcard pattern
*/
-static void nbench_search_first_send(struct smbsrv_request *req)
+static void nbench_search_first_send(struct ntvfs_request *req)
{
union smb_search_first *io = req->async_states->private_data;
}
static NTSTATUS nbench_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 *))
{
}
/* continue a search */
-static void nbench_search_next_send(struct smbsrv_request *req)
+static void nbench_search_next_send(struct ntvfs_request *req)
{
union smb_search_next *io = req->async_states->private_data;
}
static NTSTATUS nbench_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 *))
{
}
/* close a search */
-static void nbench_search_close_send(struct smbsrv_request *req)
+static void nbench_search_close_send(struct ntvfs_request *req)
{
union smb_search_close *io = req->async_states->private_data;
}
static NTSTATUS nbench_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)
{
NTSTATUS status;
}
/* SMBtrans - not used on file shares */
-static void nbench_trans_send(struct smbsrv_request *req)
+static void nbench_trans_send(struct ntvfs_request *req)
{
nbench_log(req, "Trans - NOT HANDLED\n");
}
static NTSTATUS nbench_trans(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans2)
+ struct ntvfs_request *req, struct smb_trans2 *trans2)
{
NTSTATUS status;
ops.chkpath = nbench_chkpath;
ops.qpathinfo = nbench_qpathinfo;
ops.setpathinfo = nbench_setpathinfo;
- ops.openfile = nbench_openfile;
+ ops.open = nbench_open;
ops.mkdir = nbench_mkdir;
ops.rmdir = nbench_rmdir;
ops.rename = nbench_rename;
struct ntvfs_module_context;
+#define ntvfs_request smbsrv_request
+
/* each backend has to be one one of the following 3 basic types. In
* earlier versions of Samba backends needed to handle all types, now
* we implement them separately. */
struct ntvfs_ops {
const char *name;
enum ntvfs_type type;
-
+
/* initial setup */
- NTSTATUS (*connect)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename);
- NTSTATUS (*disconnect)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon);
+ NTSTATUS (*connect)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ const char *sharename);
+ NTSTATUS (*disconnect)(struct ntvfs_module_context *ntvfs);
+
+ /* async_setup - called when a backend is processing a async request */
+ NTSTATUS (*async_setup)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ void *private);
+
+ /* filesystem operations */
+ NTSTATUS (*fsinfo)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_fsinfo *fs);
/* path operations */
- NTSTATUS (*unlink)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_unlink *unl);
- NTSTATUS (*chkpath)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_chkpath *cp);
- NTSTATUS (*qpathinfo)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *st);
- NTSTATUS (*setpathinfo)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *st);
- NTSTATUS (*openfile)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *oi);
- NTSTATUS (*mkdir)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_mkdir *md);
- NTSTATUS (*rmdir)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_rmdir *rd);
- NTSTATUS (*rename)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren);
- NTSTATUS (*copy)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_copy *cp);
+ NTSTATUS (*unlink)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_unlink *unl);
+ NTSTATUS (*chkpath)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_chkpath *cp);
+ NTSTATUS (*qpathinfo)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_fileinfo *st);
+ NTSTATUS (*setpathinfo)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_setfileinfo *st);
+ NTSTATUS (*mkdir)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_mkdir *md);
+ NTSTATUS (*rmdir)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_rmdir *rd);
+ NTSTATUS (*rename)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_rename *ren);
+ NTSTATUS (*copy)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_copy *cp);
+ NTSTATUS (*open)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_open *oi);
/* directory search */
- NTSTATUS (*search_first)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_search_first *io, void *private,
+ NTSTATUS (*search_first)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_search_first *io, void *private,
BOOL (*callback)(void *private, union smb_search_data *file));
- NTSTATUS (*search_next)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_search_next *io, void *private,
- BOOL (*callback)(void *private, union smb_search_data *file));
- NTSTATUS (*search_close)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_search_close *io);
+ NTSTATUS (*search_next)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_search_next *io, void *private,
+ BOOL (*callback)(void *private, union smb_search_data *file));
+ NTSTATUS (*search_close)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_search_close *io);
/* operations on open files */
- NTSTATUS (*ioctl)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io);
- NTSTATUS (*read)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_read *io);
- NTSTATUS (*write)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_write *io);
- NTSTATUS (*seek)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_seek *io);
- NTSTATUS (*flush)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_flush *flush);
- NTSTATUS (*close)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_close *io);
- NTSTATUS (*exit)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req);
- NTSTATUS (*lock)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lock *lck);
- NTSTATUS (*setfileinfo)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *info);
- NTSTATUS (*qfileinfo)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info);
-
- /* filesystem operations */
- NTSTATUS (*fsinfo)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsinfo *fs);
-
- /* printing specific operations */
- NTSTATUS (*lpq)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lpq *lpq);
-
- /* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
- NTSTATUS (*trans2)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans2);
+ NTSTATUS (*ioctl)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_ioctl *io);
+ NTSTATUS (*read)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_read *io);
+ NTSTATUS (*write)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_write *io);
+ NTSTATUS (*seek)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_seek *io);
+ NTSTATUS (*flush)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_flush *flush);
+ NTSTATUS (*lock)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_lock *lck);
+ NTSTATUS (*qfileinfo)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_fileinfo *info);
+ NTSTATUS (*setfileinfo)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_setfileinfo *info);
+ NTSTATUS (*close)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_close *io);
/* trans interface - used by IPC backend for pipes and RAP calls */
- NTSTATUS (*trans)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans);
+ NTSTATUS (*trans)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_trans2 *trans);
- /* logoff - called when a vuid is closed */
- NTSTATUS (*logoff)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req);
+ /* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
+ NTSTATUS (*trans2)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_trans2 *trans2);
- /* async_setup - called when a backend is processing a async request */
- NTSTATUS (*async_setup)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, void *private);
+ /* change notify request */
+ NTSTATUS (*notify)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_notify *info);
/* cancel - cancels any pending async request */
- NTSTATUS (*cancel)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req);
+ NTSTATUS (*cancel)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req);
- /* change notify request */
- NTSTATUS (*notify)(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_notify *info);
+ /* printing specific operations */
+ NTSTATUS (*lpq)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_lpq *lpq);
+
+ /* logoff - called when a vuid is closed */
+ NTSTATUS (*logoff)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req);
+ NTSTATUS (*exit)(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req);
};
struct ntvfs_module_context {
/* the async handling infos */
uint_t state;
void *private_data;
- void (*send_fn)(struct smbsrv_request *);
+ void (*send_fn)(struct ntvfs_request *);
NTSTATUS status;
/* the passthru module's per session private data */
int sizeof_ntvfs_module_context;
int sizeof_ntvfs_ops;
int sizeof_ntvfs_async_state;
- int sizeof_smbsrv_tcon;
- int sizeof_smbsrv_request;
+ int sizeof_ntvfs_request;
};
#include "ntvfs/ntvfs_proto.h"
This can be used by backends to either detect compilation errors, or provide
multiple implementations for different smbd compilation options in one module
*/
+static const struct ntvfs_critical_sizes critical_sizes = {
+ .interface_version = NTVFS_INTERFACE_VERSION,
+ .sizeof_ntvfs_critical_sizes = sizeof(struct ntvfs_critical_sizes),
+ .sizeof_ntvfs_context = sizeof(struct ntvfs_context),
+ .sizeof_ntvfs_module_context = sizeof(struct ntvfs_module_context),
+ .sizeof_ntvfs_ops = sizeof(struct ntvfs_ops),
+ .sizeof_ntvfs_async_state = sizeof(struct ntvfs_async_state),
+ .sizeof_ntvfs_request = sizeof(struct ntvfs_request),
+};
+
_PUBLIC_ const struct ntvfs_critical_sizes *ntvfs_interface_version(void)
{
- static const struct ntvfs_critical_sizes critical_sizes = {
- NTVFS_INTERFACE_VERSION,
- sizeof(struct ntvfs_critical_sizes),
- sizeof(struct ntvfs_context),
- sizeof(struct ntvfs_module_context),
- sizeof(struct ntvfs_ops),
- sizeof(struct ntvfs_async_state),
- sizeof(struct smbsrv_tcon),
- sizeof(struct smbsrv_request),
- };
-
return &critical_sizes;
}
/*
initialise a connection structure to point at a NTVFS backend
*/
-NTSTATUS ntvfs_init_connection(struct smbsrv_request *req, enum ntvfs_type type)
+NTSTATUS ntvfs_init_connection(struct ntvfs_request *req, enum ntvfs_type type)
{
const char **handlers = lp_ntvfs_handler(req->tcon->service);
int i;
/* a second stage function converts from the out parameters of the generic
call onto the out parameters of the specific call made */
-typedef NTSTATUS (*second_stage_t)(struct smbsrv_request *,
- struct ntvfs_module_context *,
+typedef NTSTATUS (*second_stage_t)(struct ntvfs_module_context *,
+ struct ntvfs_request *,
void *, void *, NTSTATUS);
/*
this is a async wrapper, called from the backend when it has completed
a function that it has decided to reply to in an async fashion
*/
-static void ntvfs_map_async_send(struct smbsrv_request *req)
+static void ntvfs_map_async_send(struct ntvfs_request *req)
{
struct ntvfs_map_async *m = req->async_states->private_data;
ntvfs_async_state_pop(req);
/* call the _finish function setup in ntvfs_map_async_setup() */
- req->async_states->status = m->fn(req, m->ntvfs, m->io, m->io2, req->async_states->status);
+ req->async_states->status = m->fn(m->ntvfs, req, m->io, m->io2, req->async_states->status);
/* call the send function from the next module up */
req->async_states->send_fn(req);
io2 is the new call structure for the mapped call
fn is a second stage function for processing the out arguments
*/
-static NTSTATUS ntvfs_map_async_setup(struct smbsrv_request *req,
- struct ntvfs_module_context *ntvfs,
+static NTSTATUS ntvfs_map_async_setup(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
void *io, void *io2,
second_stage_t fn)
{
m->io = io;
m->io2 = io2;
m->fn = fn;
- return ntvfs_async_state_push(req, m, ntvfs_map_async_send, ntvfs);
+ return ntvfs_async_state_push(ntvfs, req, m, ntvfs_map_async_send);
}
-
/*
called when first stage processing is complete.
*/
-static NTSTATUS ntvfs_map_async_finish(struct smbsrv_request *req, NTSTATUS status)
+static NTSTATUS ntvfs_map_async_finish(struct ntvfs_request *req, NTSTATUS status)
{
struct ntvfs_map_async *m;
ntvfs_async_state_pop(req);
- return m->fn(req, m->ntvfs, m->io, m->io2, status);
+ return m->fn(m->ntvfs, req, m->io, m->io2, status);
}
-
/*
see if a filename ends in EXE COM DLL or SYM. This is needed for the
DENY_DOS mapping for OpenX
/*
NTVFS openx to ntcreatex mapper
*/
-static NTSTATUS ntvfs_map_open_finish(struct smbsrv_request *req,
- struct ntvfs_module_context *ntvfs,
+static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
union smb_open *io,
union smb_open *io2,
NTSTATUS status)
io->ctemp.out.fnum = io2->generic.out.fnum;
io->ctemp.out.name = talloc_strdup(req, io2->generic.in.fname +
strlen(io->ctemp.in.directory) + 1);
+ NT_STATUS_HAVE_NO_MEMORY(io->ctemp.out.name);
break;
default:
req->async_states->state &= ~NTVFS_ASYNC_STATE_MAY_ASYNC;
if (write_time != 0) {
- sf = talloc(req, union smb_setfileinfo);
- sf->generic.level = RAW_SFILEINFO_STANDARD;
- sf->generic.file.fnum = io2->generic.out.fnum;
+ sf = talloc(req, union smb_setfileinfo);
+ NT_STATUS_HAVE_NO_MEMORY(sf);
+ sf->generic.level = RAW_SFILEINFO_STANDARD;
+ sf->generic.file.fnum = io2->generic.out.fnum;
sf->standard.in.create_time = 0;
sf->standard.in.write_time = write_time;
sf->standard.in.access_time = 0;
if (set_size != 0) {
sf = talloc(req, union smb_setfileinfo);
+ NT_STATUS_HAVE_NO_MEMORY(sf);
sf->generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
sf->generic.file.fnum = io2->generic.out.fnum;
sf->end_of_file_info.in.size = set_size;
/*
NTVFS open generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_open(struct smbsrv_request *req, union smb_open *io,
- struct ntvfs_module_context *ntvfs)
+_PUBLIC_ NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_open *io)
{
NTSTATUS status;
union smb_open *io2;
return NT_STATUS_NO_MEMORY;
}
- status = ntvfs_map_async_setup(req, ntvfs, io, io2,
+ status = ntvfs_map_async_setup(ntvfs, req,
+ io, io2,
(second_stage_t)ntvfs_map_open_finish);
if (!NT_STATUS_IS_OK(status)) {
return status;
io2->generic.in.file_attr = io->openx.in.file_attrs;
io2->generic.in.fname = io->openx.in.fname;
- status = ntvfs->ops->openfile(ntvfs, req, io2);
+ status = ntvfs->ops->open(ntvfs, req, io2);
break;
io2->generic.in.file_attr = io->openold.in.search_attrs;
io2->generic.in.fname = io->openold.in.fname;
- status = ntvfs->ops->openfile(ntvfs, req, io2);
+ status = ntvfs->ops->open(ntvfs, req, io2);
break;
case RAW_OPEN_T2OPEN:
io2->generic.in.ea_list->num_eas = io->t2open.in.num_eas;
io2->generic.in.ea_list->eas = io->t2open.in.eas;
- status = ntvfs->ops->openfile(ntvfs, req, io2);
+ status = ntvfs->ops->open(ntvfs, req, io2);
break;
case RAW_OPEN_MKNEW:
io2->generic.in.share_access =
NTCREATEX_SHARE_ACCESS_READ |
NTCREATEX_SHARE_ACCESS_WRITE;
- status = ntvfs->ops->openfile(ntvfs, req, io2);
+ status = ntvfs->ops->open(ntvfs, req, io2);
break;
case RAW_OPEN_CREATE:
io2->generic.in.share_access =
NTCREATEX_SHARE_ACCESS_READ |
NTCREATEX_SHARE_ACCESS_WRITE;
- status = ntvfs->ops->openfile(ntvfs, req, io2);
+ status = ntvfs->ops->open(ntvfs, req, io2);
break;
case RAW_OPEN_CTEMP:
io2->generic.in.share_access =
NTCREATEX_SHARE_ACCESS_READ |
NTCREATEX_SHARE_ACCESS_WRITE;
- status = ntvfs->ops->openfile(ntvfs, req, io2);
+ status = ntvfs->ops->open(ntvfs, req, io2);
break;
default:
/*
NTVFS fsinfo generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs,
- struct ntvfs_module_context *ntvfs)
+_PUBLIC_ NTSTATUS ntvfs_map_fsinfo(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_fsinfo *fs)
{
NTSTATUS status;
union smb_fsinfo *fs2;
/*
NTVFS fileinfo generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_fileinfo(struct smbsrv_request *req, union smb_fileinfo *info,
+_PUBLIC_ NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx,
+ union smb_fileinfo *info,
union smb_fileinfo *info2)
{
int i;
info->stream_info.out.num_streams = info2->generic.out.num_streams;
if (info->stream_info.out.num_streams > 0) {
info->stream_info.out.streams =
- talloc_array(req,
+ talloc_array(mem_ctx,
struct stream_struct,
info->stream_info.out.num_streams);
if (!info->stream_info.out.streams) {
for (i=0; i < info->stream_info.out.num_streams; i++) {
info->stream_info.out.streams[i] = info2->generic.out.streams[i];
info->stream_info.out.streams[i].stream_name.s =
- talloc_strdup(req, info2->generic.out.streams[i].stream_name.s);
+ talloc_strdup(info->stream_info.out.streams,
+ info2->generic.out.streams[i].stream_name.s);
if (!info->stream_info.out.streams[i].stream_name.s) {
DEBUG(2,("ntvfs_map_fileinfo: no memory for stream_name\n"));
return NT_STATUS_NO_MEMORY;
case RAW_FILEINFO_NAME_INFO:
case RAW_FILEINFO_NAME_INFORMATION:
- info->name_info.out.fname.s = talloc_strdup(req, info2->generic.out.fname.s);
+ info->name_info.out.fname.s = talloc_strdup(mem_ctx, info2->generic.out.fname.s);
+ NT_STATUS_HAVE_NO_MEMORY(info->name_info.out.fname.s);
info->name_info.out.fname.private_length = info2->generic.out.fname.private_length;
return NT_STATUS_OK;
case RAW_FILEINFO_ALT_NAME_INFO:
case RAW_FILEINFO_ALT_NAME_INFORMATION:
- info->alt_name_info.out.fname.s = talloc_strdup(req, info2->generic.out.alt_fname.s);
+ info->alt_name_info.out.fname.s = talloc_strdup(mem_ctx, info2->generic.out.alt_fname.s);
+ NT_STATUS_HAVE_NO_MEMORY(info->alt_name_info.out.fname.s);
info->alt_name_info.out.fname.private_length = info2->generic.out.alt_fname.private_length;
return NT_STATUS_OK;
case RAW_FILEINFO_ALL_EAS:
info->all_eas.out.num_eas = info2->generic.out.num_eas;
if (info->all_eas.out.num_eas > 0) {
- info->all_eas.out.eas = talloc_array(req,
+ info->all_eas.out.eas = talloc_array(mem_ctx,
struct ea_struct,
info->all_eas.out.num_eas);
if (!info->all_eas.out.eas) {
for (i = 0; i < info->all_eas.out.num_eas; i++) {
info->all_eas.out.eas[i] = info2->generic.out.eas[i];
info->all_eas.out.eas[i].name.s =
- talloc_strdup(req, info2->generic.out.eas[i].name.s);
+ talloc_strdup(info->all_eas.out.eas,
+ info2->generic.out.eas[i].name.s);
if (!info->all_eas.out.eas[i].name.s) {
DEBUG(2,("ntvfs_map_fileinfo: no memory for stream_name\n"));
return NT_STATUS_NO_MEMORY;
}
info->all_eas.out.eas[i].value.data =
- talloc_memdup(req,
+ talloc_memdup(info->all_eas.out.eas,
info2->generic.out.eas[i].value.data,
info2->generic.out.eas[i].value.length);
if (!info->all_eas.out.eas[i].value.data) {
/*
NTVFS fileinfo generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *info,
- struct ntvfs_module_context *ntvfs)
+_PUBLIC_ NTSTATUS ntvfs_map_qfileinfo(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_fileinfo *info)
{
NTSTATUS status;
union smb_fileinfo *info2;
/*
NTVFS pathinfo generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *info,
- struct ntvfs_module_context *ntvfs)
+_PUBLIC_ NTSTATUS ntvfs_map_qpathinfo(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_fileinfo *info)
{
NTSTATUS status;
union smb_fileinfo *info2;
/*
NTVFS lock generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_lock(struct smbsrv_request *req, union smb_lock *lck,
- struct ntvfs_module_context *ntvfs)
+_PUBLIC_ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_lock *lck)
{
union smb_lock *lck2;
struct smb_lock_entry *locks;
/*
NTVFS write generic to any mapper
*/
-static NTSTATUS ntvfs_map_write_finish(struct smbsrv_request *req,
- struct ntvfs_module_context *ntvfs,
+static NTSTATUS ntvfs_map_write_finish(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
union smb_write *wr,
union smb_write *wr2,
NTSTATUS status)
-
{
union smb_lock *lck;
union smb_close *cl;
/*
NTVFS write generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_write(struct smbsrv_request *req, union smb_write *wr,
- struct ntvfs_module_context *ntvfs)
+_PUBLIC_ NTSTATUS ntvfs_map_write(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_write *wr)
{
union smb_write *wr2;
NTSTATUS status;
return NT_STATUS_NO_MEMORY;
}
- status = ntvfs_map_async_setup(req, ntvfs, wr, wr2,
+ status = ntvfs_map_async_setup(ntvfs, req, wr, wr2,
(second_stage_t)ntvfs_map_write_finish);
if (!NT_STATUS_IS_OK(status)) {
return status;
/*
NTVFS read generic to any mapper - finish the out mapping
*/
-static NTSTATUS ntvfs_map_read_finish(struct smbsrv_request *req,
- struct ntvfs_module_context *ntvfs,
+static NTSTATUS ntvfs_map_read_finish(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
union smb_read *rd,
union smb_read *rd2,
NTSTATUS status)
/*
NTVFS read* to readx mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_read(struct smbsrv_request *req, union smb_read *rd,
- struct ntvfs_module_context *ntvfs)
+_PUBLIC_ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_read *rd)
{
union smb_read *rd2;
union smb_lock *lck;
return NT_STATUS_NO_MEMORY;
}
- status = ntvfs_map_async_setup(req, ntvfs, rd, rd2,
+ status = ntvfs_map_async_setup(ntvfs, req, rd, rd2,
(second_stage_t)ntvfs_map_read_finish);
if (!NT_STATUS_IS_OK(status)) {
return status;
/*
NTVFS close generic to any mapper
*/
-_PUBLIC_ NTSTATUS ntvfs_map_close(struct smbsrv_request *req, union smb_close *cl,
- struct ntvfs_module_context *ntvfs)
+_PUBLIC_ NTSTATUS ntvfs_map_close(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_close *cl)
{
union smb_close *cl2;
#include "ntvfs/ntvfs.h"
/* connect/disconnect */
-_PUBLIC_ NTSTATUS ntvfs_connect(struct smbsrv_request *req, const char *sharename)
+_PUBLIC_ NTSTATUS ntvfs_connect(struct ntvfs_request *req, const char *sharename)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->connect) {
return ntvfs->ops->connect(ntvfs, req, sharename);
}
-_PUBLIC_ NTSTATUS ntvfs_disconnect(struct smbsrv_tcon *tcon)
+_PUBLIC_ NTSTATUS ntvfs_disconnect(struct ntvfs_context *ntvfs_ctx)
{
struct ntvfs_module_context *ntvfs;
- if (tcon->ntvfs_ctx == NULL) {
+ if (ntvfs_ctx == NULL) {
return NT_STATUS_INVALID_CONNECTION;
}
- ntvfs = tcon->ntvfs_ctx->modules;
+ ntvfs = ntvfs_ctx->modules;
if (!ntvfs->ops->disconnect) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->disconnect(ntvfs, tcon);
+ return ntvfs->ops->disconnect(ntvfs);
+}
+
+/* async setup - called by a backend that wants to setup any state for
+ a async request */
+_PUBLIC_ NTSTATUS ntvfs_async_setup(struct ntvfs_request *req, void *private)
+{
+ struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
+ if (!ntvfs->ops->async_setup) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+ return ntvfs->ops->async_setup(ntvfs, req, private);
+}
+
+/* filesystem operations */
+_PUBLIC_ NTSTATUS ntvfs_fsinfo(struct ntvfs_request *req, union smb_fsinfo *fs)
+{
+ struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
+ if (!ntvfs->ops->fsinfo) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+ return ntvfs->ops->fsinfo(ntvfs, req, fs);
}
/* path operations */
-_PUBLIC_ NTSTATUS ntvfs_unlink(struct smbsrv_request *req, struct smb_unlink *unl)
+_PUBLIC_ NTSTATUS ntvfs_unlink(struct ntvfs_request *req, struct smb_unlink *unl)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->unlink) {
return ntvfs->ops->unlink(ntvfs, req, unl);
}
-_PUBLIC_ NTSTATUS ntvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp)
+_PUBLIC_ NTSTATUS ntvfs_chkpath(struct ntvfs_request *req, struct smb_chkpath *cp)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->chkpath) {
return ntvfs->ops->chkpath(ntvfs, req, cp);
}
-_PUBLIC_ NTSTATUS ntvfs_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *st)
+_PUBLIC_ NTSTATUS ntvfs_qpathinfo(struct ntvfs_request *req, union smb_fileinfo *st)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->qpathinfo) {
return ntvfs->ops->qpathinfo(ntvfs, req, st);
}
-_PUBLIC_ NTSTATUS ntvfs_setpathinfo(struct smbsrv_request *req, union smb_setfileinfo *st)
+_PUBLIC_ NTSTATUS ntvfs_setpathinfo(struct ntvfs_request *req, union smb_setfileinfo *st)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->setpathinfo) {
return ntvfs->ops->setpathinfo(ntvfs, req, st);
}
-_PUBLIC_ NTSTATUS ntvfs_openfile(struct smbsrv_request *req, union smb_open *oi)
+_PUBLIC_ NTSTATUS ntvfs_open(struct ntvfs_request *req, union smb_open *oi)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->openfile) {
+ if (!ntvfs->ops->open) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->openfile(ntvfs, req, oi);
+ return ntvfs->ops->open(ntvfs, req, oi);
}
-_PUBLIC_ NTSTATUS ntvfs_mkdir(struct smbsrv_request *req, union smb_mkdir *md)
+_PUBLIC_ NTSTATUS ntvfs_mkdir(struct ntvfs_request *req, union smb_mkdir *md)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->mkdir) {
return ntvfs->ops->mkdir(ntvfs, req, md);
}
-_PUBLIC_ NTSTATUS ntvfs_rmdir(struct smbsrv_request *req, struct smb_rmdir *rd)
+_PUBLIC_ NTSTATUS ntvfs_rmdir(struct ntvfs_request *req, struct smb_rmdir *rd)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->rmdir) {
return ntvfs->ops->rmdir(ntvfs, req, rd);
}
-_PUBLIC_ NTSTATUS ntvfs_rename(struct smbsrv_request *req, union smb_rename *ren)
+_PUBLIC_ NTSTATUS ntvfs_rename(struct ntvfs_request *req, union smb_rename *ren)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->rename) {
return ntvfs->ops->rename(ntvfs, req, ren);
}
-_PUBLIC_ NTSTATUS ntvfs_copy(struct smbsrv_request *req, struct smb_copy *cp)
+_PUBLIC_ NTSTATUS ntvfs_copy(struct ntvfs_request *req, struct smb_copy *cp)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->copy) {
}
/* directory search */
-_PUBLIC_ NTSTATUS ntvfs_search_first(struct smbsrv_request *req, union smb_search_first *io, void *private,
+_PUBLIC_ NTSTATUS ntvfs_search_first(struct ntvfs_request *req, union smb_search_first *io, void *private,
BOOL ntvfs_callback(void *private, union smb_search_data *file))
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
return ntvfs->ops->search_first(ntvfs, req, io, private, ntvfs_callback);
}
-_PUBLIC_ NTSTATUS ntvfs_search_next(struct smbsrv_request *req, union smb_search_next *io, void *private,
+_PUBLIC_ NTSTATUS ntvfs_search_next(struct ntvfs_request *req, union smb_search_next *io, void *private,
BOOL ntvfs_callback(void *private, union smb_search_data *file))
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
return ntvfs->ops->search_next(ntvfs, req, io, private, ntvfs_callback);
}
-_PUBLIC_ NTSTATUS ntvfs_search_close(struct smbsrv_request *req, union smb_search_close *io)
+_PUBLIC_ NTSTATUS ntvfs_search_close(struct ntvfs_request *req, union smb_search_close *io)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->search_close) {
}
/* operations on open files */
-_PUBLIC_ NTSTATUS ntvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io)
+_PUBLIC_ NTSTATUS ntvfs_ioctl(struct ntvfs_request *req, union smb_ioctl *io)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->ioctl) {
return ntvfs->ops->ioctl(ntvfs, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_read(struct smbsrv_request *req, union smb_read *io)
+_PUBLIC_ NTSTATUS ntvfs_read(struct ntvfs_request *req, union smb_read *io)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->read) {
return ntvfs->ops->read(ntvfs, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_write(struct smbsrv_request *req, union smb_write *io)
+_PUBLIC_ NTSTATUS ntvfs_write(struct ntvfs_request *req, union smb_write *io)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->write) {
return ntvfs->ops->write(ntvfs, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_seek(struct smbsrv_request *req, struct smb_seek *io)
+_PUBLIC_ NTSTATUS ntvfs_seek(struct ntvfs_request *req, struct smb_seek *io)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->seek) {
return ntvfs->ops->seek(ntvfs, req, io);
}
-_PUBLIC_ NTSTATUS ntvfs_flush(struct smbsrv_request *req, struct smb_flush *flush)
+_PUBLIC_ NTSTATUS ntvfs_flush(struct ntvfs_request *req,
+ struct smb_flush *flush)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->flush) {
return ntvfs->ops->flush(ntvfs, req, flush);
}
-_PUBLIC_ NTSTATUS ntvfs_close(struct smbsrv_request *req, union smb_close *io)
-{
- struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->close) {
- return NT_STATUS_NOT_IMPLEMENTED;
- }
- return ntvfs->ops->close(ntvfs, req, io);
-}
-
-_PUBLIC_ NTSTATUS ntvfs_exit(struct smbsrv_request *req)
-{
- struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->exit) {
- return NT_STATUS_NOT_IMPLEMENTED;
- }
- return ntvfs->ops->exit(ntvfs, req);
-}
-
-_PUBLIC_ NTSTATUS ntvfs_lock(struct smbsrv_request *req, union smb_lock *lck)
+_PUBLIC_ NTSTATUS ntvfs_lock(struct ntvfs_request *req, union smb_lock *lck)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->lock) {
return ntvfs->ops->lock(ntvfs, req, lck);
}
-_PUBLIC_ NTSTATUS ntvfs_setfileinfo(struct smbsrv_request *req, union smb_setfileinfo *info)
+_PUBLIC_ NTSTATUS ntvfs_qfileinfo(struct ntvfs_request *req, union smb_fileinfo *info)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->setfileinfo) {
+ if (!ntvfs->ops->qfileinfo) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->setfileinfo(ntvfs, req, info);
+ return ntvfs->ops->qfileinfo(ntvfs, req, info);
}
-_PUBLIC_ NTSTATUS ntvfs_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *info)
+_PUBLIC_ NTSTATUS ntvfs_setfileinfo(struct ntvfs_request *req, union smb_setfileinfo *info)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->qfileinfo) {
+ if (!ntvfs->ops->setfileinfo) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->qfileinfo(ntvfs, req, info);
+ return ntvfs->ops->setfileinfo(ntvfs, req, info);
}
-/* filesystem operations */
-_PUBLIC_ NTSTATUS ntvfs_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs)
+_PUBLIC_ NTSTATUS ntvfs_close(struct ntvfs_request *req, union smb_close *io)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->fsinfo) {
+ if (!ntvfs->ops->close) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->fsinfo(ntvfs, req, fs);
+ return ntvfs->ops->close(ntvfs, req, io);
}
-/* printing specific operations */
-_PUBLIC_ NTSTATUS ntvfs_lpq(struct smbsrv_request *req, union smb_lpq *lpq)
+/* trans interface - used by IPC backend for pipes and RAP calls */
+_PUBLIC_ NTSTATUS ntvfs_trans(struct ntvfs_request *req, struct smb_trans2 *trans)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->lpq) {
+ if (!ntvfs->ops->trans) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->lpq(ntvfs, req, lpq);
+ return ntvfs->ops->trans(ntvfs, req, trans);
}
/* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
-_PUBLIC_ NTSTATUS ntvfs_trans2(struct smbsrv_request *req, struct smb_trans2 *trans2)
+_PUBLIC_ NTSTATUS ntvfs_trans2(struct ntvfs_request *req, struct smb_trans2 *trans2)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->trans2) {
return ntvfs->ops->trans2(ntvfs, req, trans2);
}
-/* trans interface - used by IPC backend for pipes and RAP calls */
-_PUBLIC_ NTSTATUS ntvfs_trans(struct smbsrv_request *req, struct smb_trans2 *trans)
+/* printing specific operations */
+_PUBLIC_ NTSTATUS ntvfs_lpq(struct ntvfs_request *req, union smb_lpq *lpq)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->trans) {
+ if (!ntvfs->ops->lpq) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->trans(ntvfs, req, trans);
+ return ntvfs->ops->lpq(ntvfs, req, lpq);
}
/* logoff - called when a vuid is closed */
-_PUBLIC_ NTSTATUS ntvfs_logoff(struct smbsrv_request *req)
+_PUBLIC_ NTSTATUS ntvfs_logoff(struct ntvfs_request *req)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
if (!ntvfs->ops->logoff) {
return ntvfs->ops->logoff(ntvfs, req);
}
-/* async setup - called by a backend that wants to setup any state for
- a async request */
-_PUBLIC_ NTSTATUS ntvfs_async_setup(struct smbsrv_request *req, void *private)
+_PUBLIC_ NTSTATUS ntvfs_exit(struct ntvfs_request *req)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->async_setup) {
+ if (!ntvfs->ops->exit) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->async_setup(ntvfs, req, private);
+ return ntvfs->ops->exit(ntvfs, req);
}
-
/*
- cancel an outstanding async request
+ change notify request
*/
-_PUBLIC_ NTSTATUS ntvfs_cancel(struct smbsrv_request *req)
+_PUBLIC_ NTSTATUS ntvfs_notify(struct ntvfs_request *req, struct smb_notify *info)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->cancel) {
+ if (!ntvfs->ops->notify) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->cancel(ntvfs, req);
+ return ntvfs->ops->notify(ntvfs, req, info);
}
-
/*
- change notify request
+ cancel an outstanding async request
*/
-_PUBLIC_ NTSTATUS ntvfs_notify(struct smbsrv_request *req, struct smb_notify *info)
+_PUBLIC_ NTSTATUS ntvfs_cancel(struct ntvfs_request *req)
{
struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
- if (!ntvfs->ops->notify) {
+ if (!ntvfs->ops->cancel) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->ops->notify(ntvfs, req, info);
+ return ntvfs->ops->cancel(ntvfs, req);
}
-
/* initial setup */
_PUBLIC_ NTSTATUS ntvfs_next_connect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename)
+ struct ntvfs_request *req, const char *sharename)
{
if (!ntvfs->next || !ntvfs->next->ops->connect) {
return NT_STATUS_NOT_IMPLEMENTED;
return ntvfs->next->ops->connect(ntvfs->next, req, sharename);
}
-_PUBLIC_ NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon)
+_PUBLIC_ NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs)
{
if (!ntvfs->next || !ntvfs->next->ops->disconnect) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->disconnect(ntvfs->next, tcon);
+ return ntvfs->next->ops->disconnect(ntvfs->next);
+}
+
+/* async_setup - called when setting up for a async request */
+_PUBLIC_ NTSTATUS ntvfs_next_async_setup(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ void *private)
+{
+ if (!ntvfs->next || !ntvfs->next->ops->async_setup) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+ return ntvfs->next->ops->async_setup(ntvfs->next, req, private);
+}
+
+/* filesystem operations */
+_PUBLIC_ NTSTATUS ntvfs_next_fsinfo(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_fsinfo *fs)
+{
+ if (!ntvfs->next || !ntvfs->next->ops->fsinfo) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+ return ntvfs->next->ops->fsinfo(ntvfs->next, req, fs);
}
/* path operations */
_PUBLIC_ NTSTATUS ntvfs_next_unlink(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_unlink *unl)
+ struct ntvfs_request *req,
+ struct smb_unlink *unl)
{
if (!ntvfs->next || !ntvfs->next->ops->unlink) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_chkpath(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_chkpath *cp)
+ struct ntvfs_request *req,
+ struct smb_chkpath *cp)
{
if (!ntvfs->next || !ntvfs->next->ops->chkpath) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_qpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *st)
+ struct ntvfs_request *req,
+ union smb_fileinfo *st)
{
if (!ntvfs->next || !ntvfs->next->ops->qpathinfo) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_setpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *st)
+ struct ntvfs_request *req,
+ union smb_setfileinfo *st)
{
if (!ntvfs->next || !ntvfs->next->ops->setpathinfo) {
return NT_STATUS_NOT_IMPLEMENTED;
return ntvfs->next->ops->setpathinfo(ntvfs->next, req, st);
}
-_PUBLIC_ NTSTATUS ntvfs_next_openfile(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *oi)
-{
- if (!ntvfs->next || !ntvfs->next->ops->openfile) {
- return NT_STATUS_NOT_IMPLEMENTED;
- }
- return ntvfs->next->ops->openfile(ntvfs->next, req, oi);
-}
-
_PUBLIC_ NTSTATUS ntvfs_next_mkdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_mkdir *md)
+ struct ntvfs_request *req,
+ union smb_mkdir *md)
{
if (!ntvfs->next || !ntvfs->next->ops->mkdir) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_rmdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_rmdir *rd)
+ struct ntvfs_request *req,
+ struct smb_rmdir *rd)
{
if (!ntvfs->next || !ntvfs->next->ops->rmdir) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_rename(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req,
+ union smb_rename *ren)
{
if (!ntvfs->next || !ntvfs->next->ops->rename) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_copy(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_copy *cp)
+ struct ntvfs_request *req,
+ struct smb_copy *cp)
{
if (!ntvfs->next || !ntvfs->next->ops->copy) {
return NT_STATUS_NOT_IMPLEMENTED;
return ntvfs->next->ops->copy(ntvfs->next, req, cp);
}
+_PUBLIC_ NTSTATUS ntvfs_next_open(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_open *oi)
+{
+ if (!ntvfs->next || !ntvfs->next->ops->open) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+ return ntvfs->next->ops->open(ntvfs->next, req, oi);
+}
+
+
/* directory search */
_PUBLIC_ NTSTATUS ntvfs_next_search_first(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_search_first *io, void *private,
+ struct ntvfs_request *req,
+ union smb_search_first *io, void *private,
BOOL (*callback)(void *private, union smb_search_data *file))
{
if (!ntvfs->next || !ntvfs->next->ops->search_first) {
}
_PUBLIC_ NTSTATUS ntvfs_next_search_next(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_search_next *io, void *private,
+ struct ntvfs_request *req,
+ union smb_search_next *io, void *private,
BOOL (*callback)(void *private, union smb_search_data *file))
{
if (!ntvfs->next || !ntvfs->next->ops->search_next) {
}
_PUBLIC_ NTSTATUS ntvfs_next_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)
{
if (!ntvfs->next || !ntvfs->next->ops->search_close) {
return NT_STATUS_NOT_IMPLEMENTED;
/* operations on open files */
_PUBLIC_ NTSTATUS ntvfs_next_ioctl(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req,
+ union smb_ioctl *io)
{
if (!ntvfs->next || !ntvfs->next->ops->ioctl) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_read(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_read *io)
+ struct ntvfs_request *req,
+ union smb_read *io)
{
if (!ntvfs->next || !ntvfs->next->ops->read) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_write(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_write *io)
+ struct ntvfs_request *req,
+ union smb_write *io)
{
if (!ntvfs->next || !ntvfs->next->ops->write) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_seek(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_seek *io)
+ struct ntvfs_request *req,
+ struct smb_seek *io)
{
if (!ntvfs->next || !ntvfs->next->ops->seek) {
return NT_STATUS_NOT_IMPLEMENTED;
}
_PUBLIC_ NTSTATUS ntvfs_next_flush(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_flush *flush)
+ struct ntvfs_request *req,
+ struct smb_flush *flush)
{
if (!ntvfs->next || !ntvfs->next->ops->flush) {
return NT_STATUS_NOT_IMPLEMENTED;
return ntvfs->next->ops->flush(ntvfs->next, req, flush);
}
-_PUBLIC_ NTSTATUS ntvfs_next_close(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_close *io)
-{
- if (!ntvfs->next || !ntvfs->next->ops->close) {
- return NT_STATUS_NOT_IMPLEMENTED;
- }
- return ntvfs->next->ops->close(ntvfs->next, req, io);
-}
-
-_PUBLIC_ NTSTATUS ntvfs_next_exit(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
-{
- if (!ntvfs->next || !ntvfs->next->ops->exit) {
- return NT_STATUS_NOT_IMPLEMENTED;
- }
- return ntvfs->next->ops->exit(ntvfs->next, req);
-}
-
_PUBLIC_ NTSTATUS ntvfs_next_lock(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lock *lck)
+ struct ntvfs_request *req,
+ union smb_lock *lck)
{
if (!ntvfs->next || !ntvfs->next->ops->lock) {
return NT_STATUS_NOT_IMPLEMENTED;
return ntvfs->next->ops->lock(ntvfs->next, req, lck);
}
-_PUBLIC_ NTSTATUS ntvfs_next_setfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *info)
+_PUBLIC_ NTSTATUS ntvfs_next_qfileinfo(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_fileinfo *info)
{
- if (!ntvfs->next || !ntvfs->next->ops->setfileinfo) {
+ if (!ntvfs->next || !ntvfs->next->ops->qfileinfo) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->setfileinfo(ntvfs->next, req, info);
+ return ntvfs->next->ops->qfileinfo(ntvfs->next, req, info);
}
-_PUBLIC_ NTSTATUS ntvfs_next_qfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+_PUBLIC_ NTSTATUS ntvfs_next_setfileinfo(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_setfileinfo *info)
{
- if (!ntvfs->next || !ntvfs->next->ops->qfileinfo) {
+ if (!ntvfs->next || !ntvfs->next->ops->setfileinfo) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->qfileinfo(ntvfs->next, req, info);
+ return ntvfs->next->ops->setfileinfo(ntvfs->next, req, info);
}
-/* filesystem operations */
-_PUBLIC_ NTSTATUS ntvfs_next_fsinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsinfo *fs)
+_PUBLIC_ NTSTATUS ntvfs_next_close(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_close *io)
{
- if (!ntvfs->next || !ntvfs->next->ops->fsinfo) {
+ if (!ntvfs->next || !ntvfs->next->ops->close) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->fsinfo(ntvfs->next, req, fs);
+ return ntvfs->next->ops->close(ntvfs->next, req, io);
}
-/* printing specific operations */
-_PUBLIC_ NTSTATUS ntvfs_next_lpq(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lpq *lpq)
+/* trans interface - used by IPC backend for pipes and RAP calls */
+_PUBLIC_ NTSTATUS ntvfs_next_trans(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_trans2 *trans)
{
- if (!ntvfs->next || !ntvfs->next->ops->lpq) {
+ if (!ntvfs->next || !ntvfs->next->ops->trans) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->lpq(ntvfs->next, req, lpq);
+ return ntvfs->next->ops->trans(ntvfs->next, req, trans);
}
/* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
_PUBLIC_ NTSTATUS ntvfs_next_trans2(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans2)
+ struct ntvfs_request *req,
+ struct smb_trans2 *trans2)
{
if (!ntvfs->next || !ntvfs->next->ops->trans2) {
return NT_STATUS_NOT_IMPLEMENTED;
return ntvfs->next->ops->trans2(ntvfs->next, req, trans2);
}
-/* trans interface - used by IPC backend for pipes and RAP calls */
-_PUBLIC_ NTSTATUS ntvfs_next_trans(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans)
+/*
+ change notify request
+*/
+_PUBLIC_ NTSTATUS ntvfs_next_notify(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ struct smb_notify *info)
{
- if (!ntvfs->next || !ntvfs->next->ops->trans) {
+ if (!ntvfs->next || !ntvfs->next->ops->notify) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->trans(ntvfs->next, req, trans);
+ return ntvfs->next->ops->notify(ntvfs, req, info);
}
-/* logoff - called when a vuid is closed */
-_PUBLIC_ NTSTATUS ntvfs_next_logoff(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+/* cancel - called to cancel an outstanding async request */
+_PUBLIC_ NTSTATUS ntvfs_next_cancel(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req)
{
- if (!ntvfs->next || !ntvfs->next->ops->logoff) {
+ if (!ntvfs->next || !ntvfs->next->ops->cancel) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->logoff(ntvfs->next, req);
+ return ntvfs->next->ops->cancel(ntvfs->next, req);
}
-/* async_setup - called when setting up for a async request */
-_PUBLIC_ NTSTATUS ntvfs_next_async_setup(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
- void *private)
+/* printing specific operations */
+_PUBLIC_ NTSTATUS ntvfs_next_lpq(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
+ union smb_lpq *lpq)
{
- if (!ntvfs->next || !ntvfs->next->ops->async_setup) {
+ if (!ntvfs->next || !ntvfs->next->ops->lpq) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->async_setup(ntvfs->next, req, private);
+ return ntvfs->next->ops->lpq(ntvfs->next, req, lpq);
}
-/* cancel - called to cancel an outstanding async request */
-_PUBLIC_ NTSTATUS ntvfs_next_cancel(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+
+/* logoff - called when a vuid is closed */
+_PUBLIC_ NTSTATUS ntvfs_next_logoff(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req)
{
- if (!ntvfs->next || !ntvfs->next->ops->cancel) {
+ if (!ntvfs->next || !ntvfs->next->ops->logoff) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->cancel(ntvfs->next, req);
+ return ntvfs->next->ops->logoff(ntvfs->next, req);
}
-/*
- change notify request
-*/
-_PUBLIC_ NTSTATUS ntvfs_next_notify(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_notify *info)
+_PUBLIC_ NTSTATUS ntvfs_next_exit(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req)
{
- if (!ntvfs->next || !ntvfs->next->ops->notify) {
+ if (!ntvfs->next || !ntvfs->next->ops->exit) {
return NT_STATUS_NOT_IMPLEMENTED;
}
- return ntvfs->next->ops->notify(ntvfs, req, info);
+ return ntvfs->next->ops->exit(ntvfs->next, req);
}
#include "ntvfs/ntvfs.h"
-_PUBLIC_ NTSTATUS ntvfs_async_state_push(struct smbsrv_request *req,
+_PUBLIC_ NTSTATUS ntvfs_async_state_push(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req,
void *private_data,
- void (*send_fn)(struct smbsrv_request *),
- struct ntvfs_module_context *ntvfs)
+ void (*send_fn)(struct ntvfs_request *))
{
struct ntvfs_async_state *async;
return NT_STATUS_OK;
}
-_PUBLIC_ void ntvfs_async_state_pop(struct smbsrv_request *req)
+_PUBLIC_ void ntvfs_async_state_pop(struct ntvfs_request *req)
{
struct ntvfs_async_state *async;
setup a default ACL for a file
*/
static NTSTATUS pvfs_default_acl(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name, int fd,
struct xattr_NTACL *acl)
{
answer a setfileinfo for an ACL
*/
NTSTATUS pvfs_acl_set(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name, int fd,
uint32_t access_mask,
union smb_setfileinfo *info)
answer a fileinfo query for the ACL
*/
NTSTATUS pvfs_acl_query(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name, int fd,
union smb_fileinfo *info)
{
specific NT ACL
*/
NTSTATUS pvfs_access_check_unix(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
uint32_t *access_mask)
{
*access_mask is modified with the access actually granted
*/
NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
uint32_t *access_mask)
{
do not take or return an access check mask
*/
NTSTATUS pvfs_access_check_simple(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
uint32_t access_needed)
{
access check for creating a new file/directory
*/
NTSTATUS pvfs_access_check_create(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
uint32_t *access_mask)
{
access check for creating a new file/directory - no access mask supplied
*/
NTSTATUS pvfs_access_check_parent(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
uint32_t access_mask)
{
as the default ACL applies anyway
*/
NTSTATUS pvfs_acl_inherit(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
int fd)
{
flush a fnum
*/
NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_flush *io)
+ struct ntvfs_request *req, struct smb_flush *io)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
return filesystem space info
*/
NTSTATUS pvfs_fsinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsinfo *fs)
+ struct ntvfs_request *req, union smb_fsinfo *fs)
{
NTSTATUS status;
struct pvfs_state *pvfs = ntvfs->private_data;
old ioctl interface
*/
static NTSTATUS pvfs_ioctl_old(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req, union smb_ioctl *io)
{
return NT_STATUS_DOS(ERRSRV, ERRerror);
}
nt ioctl interface
*/
static NTSTATUS pvfs_ntioctl(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req, union smb_ioctl *io)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
ioctl interface
*/
NTSTATUS pvfs_ioctl(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req, union smb_ioctl *io)
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
struct pvfs_state *pvfs;
union smb_lock *lck;
struct pvfs_file *f;
- struct smbsrv_request *req;
+ struct ntvfs_request *req;
int pending_lock;
void *wait_handle;
struct timeval end_time;
the locks we did get and send an error
*/
static void pvfs_lock_async_failed(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_file *f,
struct smb_lock_entry *locks,
int i,
struct pvfs_pending_lock *pending = private;
struct pvfs_state *pvfs = pending->pvfs;
struct pvfs_file *f = pending->f;
- struct smbsrv_request *req = pending->req;
+ struct ntvfs_request *req = pending->req;
union smb_lock *lck = pending->lck;
struct smb_lock_entry *locks;
enum brl_type rw;
/*
cancel a set of locks
*/
-static NTSTATUS pvfs_lock_cancel(struct pvfs_state *pvfs, struct smbsrv_request *req, union smb_lock *lck,
+static NTSTATUS pvfs_lock_cancel(struct pvfs_state *pvfs, struct ntvfs_request *req, union smb_lock *lck,
struct pvfs_file *f)
{
struct pvfs_pending_lock *p;
lock or unlock a byte range
*/
NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lock *lck)
+ struct ntvfs_request *req, union smb_lock *lck)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
NTSTATUS status;
if (lck->generic.level != RAW_LOCK_GENERIC) {
- return ntvfs_map_lock(req, lck, ntvfs);
+ return ntvfs_map_lock(ntvfs, req, lck);
}
f = pvfs_find_fd(pvfs, req, lck->lockx.in.fnum);
create a directory with EAs
*/
static NTSTATUS pvfs_t2mkdir(struct pvfs_state *pvfs,
- struct smbsrv_request *req, union smb_mkdir *md)
+ struct ntvfs_request *req, union smb_mkdir *md)
{
NTSTATUS status;
struct pvfs_filename *name;
create a directory
*/
NTSTATUS pvfs_mkdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_mkdir *md)
+ struct ntvfs_request *req, union smb_mkdir *md)
{
struct pvfs_state *pvfs = ntvfs->private_data;
NTSTATUS status;
remove a directory
*/
NTSTATUS pvfs_rmdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_rmdir *rd)
+ struct ntvfs_request *req, struct smb_rmdir *rd)
{
struct pvfs_state *pvfs = ntvfs->private_data;
NTSTATUS status;
find open file handle given fnum
*/
struct pvfs_file *pvfs_find_fd(struct pvfs_state *pvfs,
- struct smbsrv_request *req, uint16_t fnum)
+ struct ntvfs_request *req, uint16_t fnum)
{
struct pvfs_file *f;
setup any EAs and the ACL on newly created files/directories
*/
static NTSTATUS pvfs_open_setup_eas_acl(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
int fd, int fnum,
union smb_open *io)
open a directory
*/
static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
union smb_open *io)
{
create a new file
*/
static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
union smb_open *io)
{
*/
struct pvfs_open_retry {
struct ntvfs_module_context *ntvfs;
- struct smbsrv_request *req;
+ struct ntvfs_request *req;
union smb_open *io;
void *wait_handle;
DATA_BLOB odb_locking_key;
{
struct pvfs_open_retry *r = private;
struct ntvfs_module_context *ntvfs = r->ntvfs;
- struct smbsrv_request *req = r->req;
+ struct ntvfs_request *req = r->req;
union smb_open *io = r->io;
NTSTATUS status;
open processing continues.
*/
static NTSTATUS pvfs_open_deny_dos(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *io,
+ struct ntvfs_request *req, union smb_open *io,
struct pvfs_file *f, struct odb_lock *lck)
{
struct pvfs_state *pvfs = ntvfs->private_data;
setup for a open retry after a sharing violation
*/
static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
union smb_open *io,
struct pvfs_file *f,
struct odb_lock *lck)
open a file
*/
NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *io)
+ struct ntvfs_request *req, union smb_open *io)
{
struct pvfs_state *pvfs = ntvfs->private_data;
int flags;
different open calls. */
if (io->generic.level != RAW_OPEN_GENERIC &&
io->generic.level != RAW_OPEN_NTTRANS_CREATE) {
- return ntvfs_map_open(req, io, ntvfs);
+ return ntvfs_map_open(ntvfs, req, io);
}
/* resolve the cifs name to a posix name */
close a file
*/
NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_close *io)
+ struct ntvfs_request *req, union smb_close *io)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
}
if (io->generic.level != RAW_CLOSE_CLOSE) {
- return ntvfs_map_close(req, io, ntvfs);
+ return ntvfs_map_close(ntvfs, req, io);
}
f = pvfs_find_fd(pvfs, req, io->close.in.fnum);
logoff - close all file descriptors open by a vuid
*/
NTSTATUS pvfs_logoff(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f, *next;
exit - close files for the current pid
*/
NTSTATUS pvfs_exit(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f, *next;
change the delete on close flag on an already open file
*/
NTSTATUS pvfs_set_delete_on_close(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_file *f, BOOL del_on_close)
{
struct odb_lock *lck;
already open file
*/
NTSTATUS pvfs_can_delete(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
struct odb_lock **lckp)
{
already open file
*/
NTSTATUS pvfs_can_rename(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
struct odb_lock **lckp)
{
already open file
*/
NTSTATUS pvfs_can_stat(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name)
{
NTSTATUS status;
approximately map a struct pvfs_filename to a generic fileinfo struct
*/
static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name, union smb_fileinfo *info,
int fd)
{
return info on a pathname
*/
NTSTATUS pvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_filename *name;
query info on a open file
*/
NTSTATUS pvfs_qfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
read from a file
*/
NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_read *rd)
+ struct ntvfs_request *req, union smb_read *rd)
{
struct pvfs_state *pvfs = ntvfs->private_data;
ssize_t ret;
uint32_t mask;
if (rd->generic.level != RAW_READ_READX) {
- return ntvfs_map_read(req, rd, ntvfs);
+ return ntvfs_map_read(ntvfs, req, rd);
}
f = pvfs_find_fd(pvfs, req, rd->readx.in.fnum);
rename one file from a wildcard set
*/
static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
const char *dir_path,
const char *fname1,
const char *fname2,
rename a set of files with wildcards
*/
static NTSTATUS pvfs_rename_wildcard(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
union smb_rename *ren,
struct pvfs_filename *name1,
struct pvfs_filename *name2)
rename a set of files - SMBmv interface
*/
static NTSTATUS pvfs_rename_mv(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req, union smb_rename *ren)
{
struct pvfs_state *pvfs = ntvfs->private_data;
NTSTATUS status;
rename a set of files - ntrename interface
*/
static NTSTATUS pvfs_rename_nt(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req, union smb_rename *ren)
{
struct pvfs_state *pvfs = ntvfs->private_data;
NTSTATUS status;
rename a set of files - ntrename interface
*/
NTSTATUS pvfs_rename(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req, union smb_rename *ren)
{
switch (ren->generic.level) {
case RAW_RENAME_RENAME:
list files in a directory matching a wildcard pattern - old SMBsearch interface
*/
static NTSTATUS pvfs_search_first_old(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 *))
{
/* continue a old style search */
static NTSTATUS pvfs_search_next_old(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 *))
{
list files in a directory matching a wildcard pattern
*/
NTSTATUS pvfs_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 *))
{
/* continue a search */
NTSTATUS pvfs_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 *))
{
/* close a search */
NTSTATUS pvfs_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)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_search_state *search;
seek in a file
*/
NTSTATUS pvfs_seek(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_seek *io)
+ struct ntvfs_request *req, struct smb_seek *io)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
rename_information level
*/
static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
struct smb_rename_information *r)
{
set info on a open file
*/
NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
union smb_setfileinfo *info)
{
struct pvfs_state *pvfs = ntvfs->private_data;
set info on a pathname
*/
NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *info)
+ struct ntvfs_request *req, union smb_setfileinfo *info)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_filename *name;
unlink a stream
*/
static NTSTATUS pvfs_unlink_stream(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct pvfs_filename *name,
uint16_t attrib)
{
unlink one file
*/
static NTSTATUS pvfs_unlink_one(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
const char *unix_path,
const char *fname, uint32_t attrib)
{
The name can contain CIFS wildcards, but rarely does (except with OS/2 clients)
*/
NTSTATUS pvfs_unlink(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_unlink *unl)
+ struct ntvfs_request *req, struct smb_unlink *unl)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_dir *dir;
int msg_type;
struct messaging_context *msg_ctx;
struct event_context *ev;
- struct smbsrv_request *req;
+ struct ntvfs_request *req;
enum pvfs_wait_notice reason;
};
previous ntvfs handlers in the chain (such as security context)
*/
NTSTATUS pvfs_async_setup(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, void *private)
+ struct ntvfs_request *req, void *private)
{
struct pvfs_wait *pwait = private;
pwait->handler(pwait->private, pwait->reason);
uint32_t src, DATA_BLOB *data)
{
struct pvfs_wait *pwait = private;
- struct smbsrv_request *req;
+ struct ntvfs_request *req;
/* we need to check that this one is for us. See
messaging_send_ptr() for the other side of this.
struct timed_event *te, struct timeval t, void *private)
{
struct pvfs_wait *pwait = talloc_get_type(private, struct pvfs_wait);
- struct smbsrv_request *req = pwait->req;
+ struct ntvfs_request *req = pwait->req;
pwait->reason = PVFS_WAIT_TIMEOUT;
the return value is a handle. To stop waiting talloc_free this
handle.
*/
- void *pvfs_wait_message(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
+void *pvfs_wait_message(struct pvfs_state *pvfs,
+ struct ntvfs_request *req,
int msg_type,
struct timeval end_time,
void (*fn)(void *, enum pvfs_wait_notice),
/*
cancel an outstanding async request
*/
-NTSTATUS pvfs_cancel(struct ntvfs_module_context *ntvfs, struct smbsrv_request *req)
+NTSTATUS pvfs_cancel(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_wait *pwait;
write to a file
*/
NTSTATUS pvfs_write(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_write *wr)
+ struct ntvfs_request *req, union smb_write *wr)
{
struct pvfs_state *pvfs = ntvfs->private_data;
ssize_t ret;
NTSTATUS status;
if (wr->generic.level != RAW_WRITE_WRITEX) {
- return ntvfs_map_write(req, wr, ntvfs);
+ return ntvfs_map_write(ntvfs, req, wr);
}
f = pvfs_find_fd(pvfs, req, wr->writex.in.fnum);
that comes later)
*/
static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename)
+ struct ntvfs_request *req, const char *sharename)
{
struct smbsrv_tcon *tcon = req->tcon;
struct pvfs_state *pvfs;
/*
disconnect from a share
*/
-static NTSTATUS pvfs_disconnect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon)
+static NTSTATUS pvfs_disconnect(struct ntvfs_module_context *ntvfs)
{
return NT_STATUS_OK;
}
check if a directory exists
*/
static NTSTATUS pvfs_chkpath(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_chkpath *cp)
+ struct ntvfs_request *req, struct smb_chkpath *cp)
{
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_filename *name;
copy a set of files
*/
static NTSTATUS pvfs_copy(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_copy *cp)
+ struct ntvfs_request *req, struct smb_copy *cp)
{
DEBUG(0,("pvfs_copy not implemented\n"));
return NT_STATUS_NOT_SUPPORTED;
return print queue info
*/
static NTSTATUS pvfs_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_NOT_SUPPORTED;
}
/* SMBtrans - not used on file shares */
static NTSTATUS pvfs_trans(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans2)
+ struct ntvfs_request *req, struct smb_trans2 *trans2)
{
return NT_STATUS_ACCESS_DENIED;
}
ops.chkpath = pvfs_chkpath;
ops.qpathinfo = pvfs_qpathinfo;
ops.setpathinfo = pvfs_setpathinfo;
- ops.openfile = pvfs_open;
+ ops.open = pvfs_open;
ops.mkdir = pvfs_mkdir;
ops.rmdir = pvfs_rmdir;
ops.rename = pvfs_rename;
/* types of notification for pvfs wait events */
enum pvfs_wait_notice {PVFS_WAIT_EVENT, PVFS_WAIT_TIMEOUT, PVFS_WAIT_CANCEL};
-
-/* putting this prototype here avoids us having to expose this whole header in the
- rest of Samba */
-void *pvfs_wait_message(struct pvfs_state *pvfs,
- struct smbsrv_request *req,
- int msg_type,
- struct timeval end_time,
- void (*fn)(void *, enum pvfs_wait_notice),
- void *private);
-
#include "ntvfs/posix/vfs_posix_proto.h"
#endif /* _VFS_POSIX_H_ */
is available
*/
static NTSTATUS print_connect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename)
+ struct ntvfs_request *req, const char *sharename)
{
struct smbsrv_tcon *tcon = req->tcon;
/*
disconnect from a share
*/
-static NTSTATUS print_disconnect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon)
+static NTSTATUS print_disconnect(struct ntvfs_module_context *ntvfs)
{
return NT_STATUS_OK;
}
lots of operations are not allowed on printing shares - mostly return NT_STATUS_ACCESS_DENIED
*/
static NTSTATUS print_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;
}
ioctl - used for job query
*/
static NTSTATUS print_ioctl(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req, union smb_ioctl *io)
{
char *p;
convert a windows path to a unix path - don't do any manging or case sensitive handling
*/
char *svfs_unix_path(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *name)
+ struct ntvfs_request *req, const char *name)
{
struct svfs_private *private = ntvfs->private_data;
char *ret;
returned names are separate unix and DOS names. The returned names
are relative to the directory
*/
-struct svfs_dir *svfs_list_unix(TALLOC_CTX *mem_ctx, struct smbsrv_request *req, const char *unix_path)
+struct svfs_dir *svfs_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request *req, const char *unix_path)
{
char *p, *mask;
struct svfs_dir *dir;
returned names are separate unix and DOS names. The returned names
are relative to the directory
*/
-struct svfs_dir *svfs_list(struct ntvfs_module_context *ntvfs, struct smbsrv_request *req, const char *pattern)
+struct svfs_dir *svfs_list(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *pattern)
{
struct svfs_private *private = ntvfs->private_data;
char *unix_path;
that comes later)
*/
static NTSTATUS svfs_connect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename)
+ struct ntvfs_request *req, const char *sharename)
{
struct stat st;
struct smbsrv_tcon *tcon = req->tcon;
/*
disconnect from a share
*/
-static NTSTATUS svfs_disconnect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon)
+static NTSTATUS svfs_disconnect(struct ntvfs_module_context *ntvfs)
{
return NT_STATUS_OK;
}
The name can contain CIFS wildcards, but rarely does (except with OS/2 clients)
*/
static NTSTATUS svfs_unlink(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_unlink *unl)
+ struct ntvfs_request *req, struct smb_unlink *unl)
{
char *unix_path;
ioctl interface - we don't do any
*/
static NTSTATUS svfs_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_INVALID_PARAMETER;
}
check if a directory exists
*/
static NTSTATUS svfs_chkpath(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_chkpath *cp)
+ struct ntvfs_request *req, struct smb_chkpath *cp)
{
char *unix_path;
struct stat st;
approximately map a struct stat to a generic fileinfo struct
*/
static NTSTATUS svfs_map_fileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info,
+ struct ntvfs_request *req, union smb_fileinfo *info,
struct stat *st, const char *unix_path)
{
struct svfs_dir *dir = NULL;
return info on a pathname
*/
static NTSTATUS svfs_qpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
char *unix_path;
struct stat st;
DEBUG(19,("svfs_qpathinfo: file %s level 0x%x\n", info->generic.in.fname, info->generic.level));
if (info->generic.level != RAW_FILEINFO_GENERIC) {
- return ntvfs_map_qpathinfo(req, info, ntvfs);
+ return ntvfs_map_qpathinfo(ntvfs, req, info);
}
unix_path = svfs_unix_path(ntvfs, req, info->generic.in.fname);
query info on a open file
*/
static NTSTATUS svfs_qfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
struct svfs_private *private = ntvfs->private_data;
struct svfs_file *f;
struct stat st;
if (info->generic.level != RAW_FILEINFO_GENERIC) {
- return ntvfs_map_qfileinfo(req, info, ntvfs);
+ return ntvfs_map_qfileinfo(ntvfs, req, info);
}
f = find_fd(private, info->generic.in.fnum);
open a file
*/
static NTSTATUS svfs_open(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *io)
+ struct ntvfs_request *req, union smb_open *io)
{
struct svfs_private *private = ntvfs->private_data;
char *unix_path;
int create_flags, rdwr_flags;
if (io->generic.level != RAW_OPEN_GENERIC) {
- return ntvfs_map_open(req, io, ntvfs);
+ return ntvfs_map_open(ntvfs, req, io);
}
if (lp_readonly(req->tcon->service)) {
create a directory
*/
static NTSTATUS svfs_mkdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_mkdir *md)
+ struct ntvfs_request *req, union smb_mkdir *md)
{
char *unix_path;
remove a directory
*/
static NTSTATUS svfs_rmdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_rmdir *rd)
+ struct ntvfs_request *req, struct smb_rmdir *rd)
{
char *unix_path;
rename a set of files
*/
static NTSTATUS svfs_rename(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req, union smb_rename *ren)
{
char *unix_path1, *unix_path2;
copy a set of files
*/
static NTSTATUS svfs_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_NOT_SUPPORTED;
}
read from a file
*/
static NTSTATUS svfs_read(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_read *rd)
+ struct ntvfs_request *req, union smb_read *rd)
{
ssize_t ret;
write to a file
*/
static NTSTATUS svfs_write(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_write *wr)
+ struct ntvfs_request *req, union smb_write *wr)
{
ssize_t ret;
if (wr->generic.level != RAW_WRITE_WRITEX) {
- return ntvfs_map_write(req, wr, ntvfs);
+ return ntvfs_map_write(ntvfs, req, wr);
}
CHECK_READ_ONLY(req);
seek in a file
*/
static NTSTATUS svfs_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_NOT_SUPPORTED;
}
flush a file
*/
static NTSTATUS svfs_flush(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_flush *io)
+ struct ntvfs_request *req, struct smb_flush *io)
{
fsync(io->in.fnum);
return NT_STATUS_OK;
close a file
*/
static NTSTATUS svfs_close(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_close *io)
+ struct ntvfs_request *req, union smb_close *io)
{
struct svfs_private *private = ntvfs->private_data;
struct svfs_file *f;
exit - closing files
*/
static NTSTATUS svfs_exit(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
return NT_STATUS_NOT_SUPPORTED;
}
logoff - closing files
*/
static NTSTATUS svfs_logoff(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
return NT_STATUS_NOT_SUPPORTED;
}
setup for an async call
*/
static NTSTATUS svfs_async_setup(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
void *private)
{
return NT_STATUS_OK;
/*
cancel an async call
*/
-static NTSTATUS svfs_cancel(struct ntvfs_module_context *ntvfs, struct smbsrv_request *req)
+static NTSTATUS svfs_cancel(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req)
{
return NT_STATUS_UNSUCCESSFUL;
}
lock a byte range
*/
static NTSTATUS svfs_lock(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lock *lck)
+ struct ntvfs_request *req, union smb_lock *lck)
{
DEBUG(0,("REWRITE: not doing byte range locking!\n"));
return NT_STATUS_OK;
set info on a pathname
*/
static NTSTATUS svfs_setpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *st)
+ struct ntvfs_request *req, union smb_setfileinfo *st)
{
CHECK_READ_ONLY(req);
set info on a open file
*/
static NTSTATUS svfs_setfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
union smb_setfileinfo *info)
{
struct utimbuf unix_times;
return filesystem space info
*/
static NTSTATUS svfs_fsinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsinfo *fs)
+ struct ntvfs_request *req, union smb_fsinfo *fs)
{
struct svfs_private *private = ntvfs->private_data;
struct stat st;
if (fs->generic.level != RAW_QFS_GENERIC) {
- return ntvfs_map_fsinfo(req, fs, ntvfs);
+ return ntvfs_map_fsinfo(ntvfs, req, fs);
}
if (sys_fsusage(private->connectpath,
return filesystem attribute info
*/
static NTSTATUS svfs_fsattr(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsattr *fs)
+ struct ntvfs_request *req, union smb_fsattr *fs)
{
struct stat st;
struct svfs_private *private = ntvfs->private_data;
if (fs->generic.level != RAW_FSATTR_GENERIC) {
- return ntvfs_map_fsattr(req, fs, ntvfs);
+ return ntvfs_map_fsattr(ntvfs, req, fs);
}
if (stat(private->connectpath, &st) == -1) {
return print queue info
*/
static NTSTATUS svfs_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_NOT_SUPPORTED;
}
list files in a directory matching a wildcard pattern
*/
static NTSTATUS svfs_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 *))
{
/* continue a search */
static NTSTATUS svfs_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 *))
{
/* close a search */
static NTSTATUS svfs_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)
{
struct svfs_private *private = ntvfs->private_data;
struct search_state *search;
/* SMBtrans - not used on file shares */
static NTSTATUS svfs_trans(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans2)
+ struct ntvfs_request *req, struct smb_trans2 *trans2)
{
return NT_STATUS_ACCESS_DENIED;
}
ops.chkpath = svfs_chkpath;
ops.qpathinfo = svfs_qpathinfo;
ops.setpathinfo = svfs_setpathinfo;
- ops.openfile = svfs_open;
+ ops.open = svfs_open;
ops.mkdir = svfs_mkdir;
ops.rmdir = svfs_rmdir;
ops.rename = svfs_rename;
form a unix_sec_ctx from the current security_token
*/
static NTSTATUS nt_token_to_unix_security(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
struct security_token *token,
struct unix_sec_ctx **sec)
{
setup our unix security context according to the session authentication info
*/
static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct unix_sec_ctx **sec)
+ struct ntvfs_request *req, struct unix_sec_ctx **sec)
{
struct unixuid_private *private = ntvfs->private_data;
struct security_token *token;
connect to a share - used when a tree_connect operation comes in.
*/
static NTSTATUS unixuid_connect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, const char *sharename)
+ struct ntvfs_request *req, const char *sharename)
{
struct unixuid_private *private;
NTSTATUS status;
/*
disconnect from a share
*/
-static NTSTATUS unixuid_disconnect(struct ntvfs_module_context *ntvfs,
- struct smbsrv_tcon *tcon)
+static NTSTATUS unixuid_disconnect(struct ntvfs_module_context *ntvfs)
{
struct unixuid_private *private = ntvfs->private_data;
NTSTATUS status;
talloc_free(private);
ntvfs->private_data = NULL;
- status = ntvfs_next_disconnect(ntvfs, tcon);
+ status = ntvfs_next_disconnect(ntvfs);
return status;
}
delete a file
*/
static NTSTATUS unixuid_unlink(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_unlink *unl)
+ struct ntvfs_request *req, struct smb_unlink *unl)
{
NTSTATUS status;
ioctl interface
*/
static NTSTATUS unixuid_ioctl(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_ioctl *io)
+ struct ntvfs_request *req, union smb_ioctl *io)
{
NTSTATUS status;
check if a directory exists
*/
static NTSTATUS unixuid_chkpath(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_chkpath *cp)
+ struct ntvfs_request *req, struct smb_chkpath *cp)
{
NTSTATUS status;
return info on a pathname
*/
static NTSTATUS unixuid_qpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
NTSTATUS status;
query info on a open file
*/
static NTSTATUS unixuid_qfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fileinfo *info)
+ struct ntvfs_request *req, union smb_fileinfo *info)
{
NTSTATUS status;
set info on a pathname
*/
static NTSTATUS unixuid_setpathinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_setfileinfo *st)
+ struct ntvfs_request *req, union smb_setfileinfo *st)
{
NTSTATUS status;
/*
open a file
*/
-static NTSTATUS unixuid_openfile(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_open *io)
+static NTSTATUS unixuid_open(struct ntvfs_module_context *ntvfs,
+ struct ntvfs_request *req, union smb_open *io)
{
NTSTATUS status;
- PASS_THRU_REQ(ntvfs, req, openfile, (ntvfs, req, io));
+ PASS_THRU_REQ(ntvfs, req, open, (ntvfs, req, io));
return status;
}
create a directory
*/
static NTSTATUS unixuid_mkdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_mkdir *md)
+ struct ntvfs_request *req, union smb_mkdir *md)
{
NTSTATUS status;
remove a directory
*/
static NTSTATUS unixuid_rmdir(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_rmdir *rd)
+ struct ntvfs_request *req, struct smb_rmdir *rd)
{
NTSTATUS status;
rename a set of files
*/
static NTSTATUS unixuid_rename(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_rename *ren)
+ struct ntvfs_request *req, union smb_rename *ren)
{
NTSTATUS status;
copy a set of files
*/
static NTSTATUS unixuid_copy(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_copy *cp)
+ struct ntvfs_request *req, struct smb_copy *cp)
{
NTSTATUS status;
read from a file
*/
static NTSTATUS unixuid_read(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_read *rd)
+ struct ntvfs_request *req, union smb_read *rd)
{
NTSTATUS status;
write to a file
*/
static NTSTATUS unixuid_write(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_write *wr)
+ struct ntvfs_request *req, union smb_write *wr)
{
NTSTATUS status;
seek in a file
*/
static NTSTATUS unixuid_seek(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_seek *io)
+ struct ntvfs_request *req, struct smb_seek *io)
{
NTSTATUS status;
flush a file
*/
static NTSTATUS unixuid_flush(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_flush *io)
+ struct ntvfs_request *req, struct smb_flush *io)
{
NTSTATUS status;
close a file
*/
static NTSTATUS unixuid_close(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_close *io)
+ struct ntvfs_request *req, union smb_close *io)
{
NTSTATUS status;
exit - closing files
*/
static NTSTATUS unixuid_exit(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
NTSTATUS status;
logoff - closing files
*/
static NTSTATUS unixuid_logoff(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
struct unixuid_private *private = ntvfs->private_data;
NTSTATUS status;
async setup
*/
static NTSTATUS unixuid_async_setup(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
void *private)
{
NTSTATUS status;
cancel an async request
*/
static NTSTATUS unixuid_cancel(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req)
+ struct ntvfs_request *req)
{
NTSTATUS status;
lock a byte range
*/
static NTSTATUS unixuid_lock(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lock *lck)
+ struct ntvfs_request *req, union smb_lock *lck)
{
NTSTATUS status;
set info on a open file
*/
static NTSTATUS unixuid_setfileinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req,
+ struct ntvfs_request *req,
union smb_setfileinfo *info)
{
NTSTATUS status;
return filesystem space info
*/
static NTSTATUS unixuid_fsinfo(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_fsinfo *fs)
+ struct ntvfs_request *req, union smb_fsinfo *fs)
{
NTSTATUS status;
return print queue info
*/
static NTSTATUS unixuid_lpq(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, union smb_lpq *lpq)
+ struct ntvfs_request *req, union smb_lpq *lpq)
{
NTSTATUS status;
list files in a directory matching a wildcard pattern
*/
static NTSTATUS unixuid_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 *))
{
/* continue a search */
static NTSTATUS unixuid_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 *))
{
/* close a search */
static NTSTATUS unixuid_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)
{
NTSTATUS status;
/* SMBtrans - not used on file shares */
static NTSTATUS unixuid_trans(struct ntvfs_module_context *ntvfs,
- struct smbsrv_request *req, struct smb_trans2 *trans2)
+ struct ntvfs_request *req, struct smb_trans2 *trans2)
{
NTSTATUS status;
ops.chkpath = unixuid_chkpath;
ops.qpathinfo = unixuid_qpathinfo;
ops.setpathinfo = unixuid_setpathinfo;
- ops.openfile = unixuid_openfile;
+ ops.open = unixuid_open;
ops.mkdir = unixuid_mkdir;
ops.rmdir = unixuid_rmdir;
ops.rename = unixuid_rename;
op->send_fn = nttrans_create_send;
op->op_info = io;
- return ntvfs_openfile(req, io);
+ return ntvfs_open(req, io);
}
req->async_states->private_data = oi;
/* call backend */
- req->async_states->status = ntvfs_openfile(req, oi);
+ req->async_states->status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
req->async_states->private_data = oi;
/* call the backend */
- req->async_states->status = ntvfs_openfile(req, oi);
+ req->async_states->status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
req->async_states->private_data = oi;
/* call the backend */
- req->async_states->status = ntvfs_openfile(req, oi);
+ req->async_states->status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
req->async_states->private_data = oi;
/* call the backend */
- req->async_states->status = ntvfs_openfile(req, oi);
+ req->async_states->status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
req->async_states->private_data = oi;
/* call backend */
- req->async_states->status = ntvfs_openfile(req, oi);
+ req->async_states->status = ntvfs_open(req, oi);
REQ_ASYNC_TAIL;
}
req->async_states->private_data = io;
/* call the backend */
- req->async_states->status = ntvfs_openfile(req, io);
+ req->async_states->status = ntvfs_open(req, io);
REQ_ASYNC_TAIL;
}
return status;
}
- status = ntvfs_openfile(req, io);
+ status = ntvfs_open(req, io);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
functions */
struct smbsrv_request {
/* the smbsrv_connection needs a list of requests queued for send */
- struct smbsrv_request *next, *prev;
+ struct smbsrv_request_foo *next, *prev;
/* the server_context contains all context specific to this SMB socket */
struct smbsrv_connection *smb_conn;
/* tell the ntvfs backend that we are disconnecting */
if (tcon->ntvfs_ctx) {
- ntvfs_disconnect(tcon);
+ ntvfs_disconnect(tcon->ntvfs_ctx);
}
if (tcon->smb2.session) {