diff options
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/cifs/vfs_cifs.c | 90 | ||||
-rw-r--r-- | source4/ntvfs/ipc/vfs_ipc.c | 24 | ||||
-rw-r--r-- | source4/ntvfs/nbench/vfs_nbench.c | 80 | ||||
-rw-r--r-- | source4/ntvfs/ntvfs.h | 4 | ||||
-rw-r--r-- | source4/ntvfs/ntvfs_base.c | 10 | ||||
-rw-r--r-- | source4/ntvfs/ntvfs_generic.c | 10 | ||||
-rw-r--r-- | source4/ntvfs/print/vfs_print.c | 4 | ||||
-rw-r--r-- | source4/ntvfs/simple/svfs_util.c | 2 | ||||
-rw-r--r-- | source4/ntvfs/simple/vfs_simple.c | 50 |
9 files changed, 137 insertions, 137 deletions
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c index 0c00beecbb..6af8cd1878 100644 --- a/source4/ntvfs/cifs/vfs_cifs.c +++ b/source4/ntvfs/cifs/vfs_cifs.c @@ -31,7 +31,7 @@ struct cvfs_private { struct cli_tree *tree; struct cli_transport *transport; - struct tcon_context *conn; + struct smbsrv_tcon *tcon; const char *map_calls; }; @@ -51,8 +51,8 @@ struct async_info { static void idle_func(struct cli_transport *transport, void *p_private) { struct cvfs_private *private = p_private; - if (socket_pending(private->conn->smb_ctx->socket.fd)) { - smbd_process_async(private->conn->smb_ctx); + if (socket_pending(private->tcon->smb_ctx->socket.fd)) { + smbd_process_async(private->tcon->smb_ctx); } } @@ -65,7 +65,7 @@ static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16 struct cvfs_private *private = p_private; DEBUG(5,("vfs_cifs: sending oplock break level %d for fnum %d\n", level, fnum)); - return req_send_oplock_break(private->conn, fnum, level); + return req_send_oplock_break(private->tcon, fnum, level); } /* @@ -74,13 +74,13 @@ static BOOL oplock_handler(struct cli_transport *transport, uint16_t tid, uint16 static void cifs_socket_handler(struct event_context *ev, struct fd_event *fde, time_t t, uint16_t flags) { struct cvfs_private *private = fde->private; - struct tcon_context *conn = private->conn; + struct smbsrv_tcon *tcon = private->tcon; DEBUG(5,("cifs_socket_handler event on fd %d\n", fde->fd)); if (!cli_request_receive_next(private->transport)) { /* the connection to our server is dead */ - close_cnum(conn); + close_cnum(tcon); } } @@ -89,7 +89,7 @@ static void cifs_socket_handler(struct event_context *ev, struct fd_event *fde, */ static NTSTATUS cvfs_connect(struct request_context *req, const char *sharename) { - struct tcon_context *conn = req->conn; + struct smbsrv_tcon *tcon = req->tcon; NTSTATUS status; struct cvfs_private *private; const char *map_calls; @@ -100,11 +100,11 @@ static NTSTATUS cvfs_connect(struct request_context *req, const char *sharename) * For now we use parametric options, type cifs. * Later we will use security=server and auth_server.c. */ - host = lp_parm_string(req->conn->service, "cifs", "server"); - user = lp_parm_string(req->conn->service, "cifs", "user"); - pass = lp_parm_string(req->conn->service, "cifs", "password"); - domain = lp_parm_string(req->conn->service, "cifs", "domain"); - remote_share = lp_parm_string(req->conn->service, "cifs", "share"); + host = lp_parm_string(req->tcon->service, "cifs", "server"); + user = lp_parm_string(req->tcon->service, "cifs", "user"); + pass = lp_parm_string(req->tcon->service, "cifs", "password"); + domain = lp_parm_string(req->tcon->service, "cifs", "domain"); + remote_share = lp_parm_string(req->tcon->service, "cifs", "share"); if (!remote_share) { remote_share = sharename; } @@ -114,13 +114,13 @@ static NTSTATUS cvfs_connect(struct request_context *req, const char *sharename) return NT_STATUS_INVALID_PARAMETER; } - private = talloc(req->conn->mem_ctx, sizeof(struct cvfs_private)); + private = talloc(req->tcon->mem_ctx, sizeof(struct cvfs_private)); if (!private) { return NT_STATUS_NO_MEMORY; } ZERO_STRUCTP(private); - req->conn->ntvfs_private = (void *)private; + req->tcon->ntvfs_private = (void *)private; status = cli_tree_full_connection(&private->tree, "vfs_cifs", @@ -135,26 +135,26 @@ static NTSTATUS cvfs_connect(struct request_context *req, const char *sharename) private->transport = private->tree->session->transport; private->tree->session->pid = SVAL(req->in.hdr, HDR_PID); - private->conn = req->conn; + private->tcon = req->tcon; - conn->fs_type = talloc_strdup(conn->mem_ctx, "NTFS"); - conn->dev_type = talloc_strdup(conn->mem_ctx, "A:"); + tcon->fs_type = talloc_strdup(tcon->mem_ctx, "NTFS"); + tcon->dev_type = talloc_strdup(tcon->mem_ctx, "A:"); - map_calls = lp_parm_string(req->conn->service, "cifs", "map calls"); + map_calls = lp_parm_string(req->tcon->service, "cifs", "map calls"); if (map_calls) { - private->map_calls = talloc_strdup(conn->mem_ctx, map_calls); + private->map_calls = talloc_strdup(tcon->mem_ctx, map_calls); } /* if we are mapping trans2, then we need to give a trans2 pointer in the operations structure */ if (private->map_calls && in_list("trans2", private->map_calls, True)) { - struct ntvfs_ops *ops = talloc_memdup(conn->mem_ctx,conn->ntvfs_ops,sizeof(*ops)); + struct ntvfs_ops *ops = talloc_memdup(tcon->mem_ctx,tcon->ntvfs_ops,sizeof(*ops)); static NTSTATUS cvfs_trans2(struct request_context *,struct smb_trans2 *); if (!ops) { return NT_STATUS_NO_MEMORY; } ops->trans2 = cvfs_trans2; - conn->ntvfs_ops = ops; + tcon->ntvfs_ops = ops; } /* we need to tell the event loop that we wish to receive read events @@ -164,7 +164,7 @@ static NTSTATUS cvfs_connect(struct request_context *req, const char *sharename) fde.private = private; fde.handler = cifs_socket_handler; - event_add_fd(conn->smb_ctx->events, &fde); + event_add_fd(tcon->smb_ctx->events, &fde); /* we need to receive oplock break requests from the server */ cli_oplock_handler(private->transport, oplock_handler, private); @@ -176,11 +176,11 @@ static NTSTATUS cvfs_connect(struct request_context *req, const char *sharename) /* disconnect from a share */ -static NTSTATUS cvfs_disconnect(struct tcon_context *conn) +static NTSTATUS cvfs_disconnect(struct smbsrv_tcon *tcon) { - struct cvfs_private *private = conn->ntvfs_private; + struct cvfs_private *private = tcon->ntvfs_private; - event_remove_fd_all(conn->smb_ctx->events, private->transport->socket->fd); + event_remove_fd_all(tcon->smb_ctx->events, private->transport->socket->fd); smb_tree_disconnect(private->tree); cli_tree_close(private->tree); @@ -225,7 +225,7 @@ static void async_simple(struct cli_request *c_req) */ static NTSTATUS cvfs_unlink(struct request_context *req, struct smb_unlink *unl) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; /* see if the front end will allow us to perform this @@ -255,7 +255,7 @@ static void async_ioctl(struct cli_request *c_req) */ static NTSTATUS cvfs_ioctl(struct request_context *req, union smb_ioctl *io) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; /* see if the front end will allow us to perform this @@ -274,7 +274,7 @@ static NTSTATUS cvfs_ioctl(struct request_context *req, union smb_ioctl *io) */ static NTSTATUS cvfs_chkpath(struct request_context *req, struct smb_chkpath *cp) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -302,7 +302,7 @@ static void async_qpathinfo(struct cli_request *c_req) */ static NTSTATUS cvfs_qpathinfo(struct request_context *req, union smb_fileinfo *info) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -330,7 +330,7 @@ static void async_qfileinfo(struct cli_request *c_req) */ static NTSTATUS cvfs_qfileinfo(struct request_context *req, union smb_fileinfo *info) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -348,7 +348,7 @@ static NTSTATUS cvfs_qfileinfo(struct request_context *req, union smb_fileinfo * */ static NTSTATUS cvfs_setpathinfo(struct request_context *req, union smb_setfileinfo *st) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -377,7 +377,7 @@ static void async_open(struct cli_request *c_req) */ static NTSTATUS cvfs_open(struct request_context *req, union smb_open *io) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (private->map_calls && in_list("open", private->map_calls, True) && @@ -399,7 +399,7 @@ static NTSTATUS cvfs_open(struct request_context *req, union smb_open *io) */ static NTSTATUS cvfs_mkdir(struct request_context *req, union smb_mkdir *md) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -416,7 +416,7 @@ static NTSTATUS cvfs_mkdir(struct request_context *req, union smb_mkdir *md) */ static NTSTATUS cvfs_rmdir(struct request_context *req, struct smb_rmdir *rd) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -432,7 +432,7 @@ static NTSTATUS cvfs_rmdir(struct request_context *req, struct smb_rmdir *rd) */ static NTSTATUS cvfs_rename(struct request_context *req, union smb_rename *ren) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -468,7 +468,7 @@ static void async_read(struct cli_request *c_req) */ static NTSTATUS cvfs_read(struct request_context *req, union smb_read *rd) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -496,7 +496,7 @@ static void async_write(struct cli_request *c_req) */ static NTSTATUS cvfs_write(struct request_context *req, union smb_write *wr) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -529,7 +529,7 @@ static NTSTATUS cvfs_flush(struct request_context *req, struct smb_flush *io) */ static NTSTATUS cvfs_close(struct request_context *req, union smb_close *io) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -554,7 +554,7 @@ static NTSTATUS cvfs_exit(struct request_context *req) */ static NTSTATUS cvfs_lock(struct request_context *req, union smb_lock *lck) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -571,7 +571,7 @@ static NTSTATUS cvfs_lock(struct request_context *req, union smb_lock *lck) static NTSTATUS cvfs_setfileinfo(struct request_context *req, union smb_setfileinfo *info) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -599,7 +599,7 @@ static void async_fsinfo(struct cli_request *c_req) */ static NTSTATUS cvfs_fsinfo(struct request_context *req, union smb_fsinfo *fs) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { @@ -626,7 +626,7 @@ static NTSTATUS cvfs_search_first(struct request_context *req, union smb_search_ void *search_private, BOOL (*callback)(void *, union smb_search_data *)) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; return smb_raw_search_first(private->tree, req->mem_ctx, io, search_private, callback); } @@ -636,7 +636,7 @@ static NTSTATUS cvfs_search_next(struct request_context *req, union smb_search_n void *search_private, BOOL (*callback)(void *, union smb_search_data *)) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; return smb_raw_search_next(private->tree, req->mem_ctx, io, search_private, callback); } @@ -644,7 +644,7 @@ static NTSTATUS cvfs_search_next(struct request_context *req, union smb_search_n /* close a search */ static NTSTATUS cvfs_search_close(struct request_context *req, union smb_search_close *io) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; return smb_raw_search_close(private->tree, io); } @@ -663,7 +663,7 @@ static void async_trans2(struct cli_request *c_req) /* raw trans2 */ static NTSTATUS cvfs_trans2(struct request_context *req, struct smb_trans2 *trans2) { - struct cvfs_private *private = req->conn->ntvfs_private; + struct cvfs_private *private = req->tcon->ntvfs_private; struct cli_request *c_req; if (!req->async.send_fn) { diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index 8cef711d69..b726dd6116 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -107,18 +107,18 @@ static struct pipe_state *pipe_state_find(struct ipc_private *private, uint16_t */ static NTSTATUS ipc_connect(struct request_context *req, const char *sharename) { - struct tcon_context *conn = req->conn; + struct smbsrv_tcon *tcon = req->tcon; struct ipc_private *private; - conn->fs_type = talloc_strdup(conn->mem_ctx, "IPC"); - conn->dev_type = talloc_strdup(conn->mem_ctx, "IPC"); + tcon->fs_type = talloc_strdup(tcon->mem_ctx, "IPC"); + tcon->dev_type = talloc_strdup(tcon->mem_ctx, "IPC"); /* prepare the private state for this connection */ - private = talloc(conn->mem_ctx, sizeof(struct ipc_private)); + private = talloc(tcon->mem_ctx, sizeof(struct ipc_private)); if (!private) { return NT_STATUS_NO_MEMORY; } - conn->ntvfs_private = (void *)private; + tcon->ntvfs_private = (void *)private; private->pipe_list = NULL; private->next_fnum = 1; @@ -130,7 +130,7 @@ static NTSTATUS ipc_connect(struct request_context *req, const char *sharename) /* disconnect from a share */ -static NTSTATUS ipc_disconnect(struct tcon_context *tcon) +static NTSTATUS ipc_disconnect(struct smbsrv_tcon *tcon) { struct ipc_private *private = tcon->ntvfs_private; @@ -196,7 +196,7 @@ static NTSTATUS ipc_open_generic(struct request_context *req, const char *fname, NTSTATUS status; struct dcesrv_ep_description ep_description; struct auth_session_info *session_info = NULL; - struct ipc_private *private = req->conn->ntvfs_private; + struct ipc_private *private = req->tcon->ntvfs_private; mem_ctx = talloc_init("ipc_open '%s'", fname); if (!mem_ctx) { @@ -374,7 +374,7 @@ static NTSTATUS ipc_copy(struct request_context *req, struct smb_copy *cp) */ static NTSTATUS ipc_read(struct request_context *req, union smb_read *rd) { - struct ipc_private *private = req->conn->ntvfs_private; + struct ipc_private *private = req->tcon->ntvfs_private; DATA_BLOB data; uint16_t fnum; struct pipe_state *p; @@ -426,7 +426,7 @@ static NTSTATUS ipc_read(struct request_context *req, union smb_read *rd) */ static NTSTATUS ipc_write(struct request_context *req, union smb_write *wr) { - struct ipc_private *private = req->conn->ntvfs_private; + struct ipc_private *private = req->tcon->ntvfs_private; DATA_BLOB data; uint16_t fnum; struct pipe_state *p; @@ -495,7 +495,7 @@ static NTSTATUS ipc_flush(struct request_context *req, struct smb_flush *io) */ static NTSTATUS ipc_close(struct request_context *req, union smb_close *io) { - struct ipc_private *private = req->conn->ntvfs_private; + struct ipc_private *private = req->tcon->ntvfs_private; struct pipe_state *p; if (io->generic.level != RAW_CLOSE_CLOSE) { @@ -595,7 +595,7 @@ NTSTATUS ipc_search_close(struct request_context *req, union smb_search_close *i static NTSTATUS ipc_dcerpc_cmd(struct request_context *req, struct smb_trans2 *trans) { struct pipe_state *p; - struct ipc_private *private = req->conn->ntvfs_private; + struct ipc_private *private = req->tcon->ntvfs_private; NTSTATUS status; /* the fnum is in setup[1] */ @@ -640,7 +640,7 @@ static NTSTATUS ipc_dcerpc_cmd(struct request_context *req, struct smb_trans2 *t static NTSTATUS ipc_set_nm_pipe_state(struct request_context *req, struct smb_trans2 *trans) { struct pipe_state *p; - struct ipc_private *private = req->conn->ntvfs_private; + struct ipc_private *private = req->tcon->ntvfs_private; /* the fnum is in setup[1] */ p = pipe_state_find(private, trans->in.setup[1]); diff --git a/source4/ntvfs/nbench/vfs_nbench.c b/source4/ntvfs/nbench/vfs_nbench.c index acdeec455a..5e9fd430cc 100644 --- a/source4/ntvfs/nbench/vfs_nbench.c +++ b/source4/ntvfs/nbench/vfs_nbench.c @@ -59,17 +59,17 @@ static void nbench_log(struct nbench_private *private, Then we need to restore both of these after the call, as the next level could modify either of these */ -#define PASS_THRU(conn, op, args) do { \ - conn->ntvfs_private = private->passthru_private; \ - conn->ntvfs_ops = private->passthru_ops; \ +#define PASS_THRU(tcon, op, args) do { \ + tcon->ntvfs_private = private->passthru_private; \ + tcon->ntvfs_ops = private->passthru_ops; \ \ status = private->passthru_ops->op args; \ \ - private->passthru_private = conn->ntvfs_private; \ - private->passthru_ops = conn->ntvfs_ops; \ + private->passthru_private = tcon->ntvfs_private; \ + private->passthru_ops = tcon->ntvfs_ops; \ \ - conn->ntvfs_private = private; \ - conn->ntvfs_ops = private->nbench_ops; \ + tcon->ntvfs_private = private; \ + tcon->ntvfs_ops = private->nbench_ops; \ } while (0) /* @@ -82,7 +82,7 @@ static void nbench_log(struct nbench_private *private, #define PASS_THRU_REQ(req, op, args) do { \ void *send_fn_saved = req->async.send_fn; \ req->async.send_fn = NULL; \ - PASS_THRU(req->conn, op, args); \ + PASS_THRU(req->tcon, op, args); \ req->async.send_fn = send_fn_saved; \ } while (0) @@ -97,7 +97,7 @@ static NTSTATUS nbench_connect(struct request_context *req, const char *sharenam NTSTATUS status; char *logname = NULL; - private = talloc_p(req->conn->mem_ctx, struct nbench_private); + private = talloc_p(req->tcon->mem_ctx, struct nbench_private); if (!private) { return NT_STATUS_NO_MEMORY; } @@ -111,10 +111,10 @@ static NTSTATUS nbench_connect(struct request_context *req, const char *sharenam return NT_STATUS_UNSUCCESSFUL; } - passthru = lp_parm_string(req->conn->service, "nbench", "passthru"); + passthru = lp_parm_string(req->tcon->service, "nbench", "passthru"); private->passthru_private = NULL; - private->nbench_ops = req->conn->ntvfs_ops; + private->nbench_ops = req->tcon->ntvfs_ops; private->passthru_ops = ntvfs_backend_byname(passthru, NTVFS_DISK); if (!private->passthru_ops) { @@ -122,7 +122,7 @@ static NTSTATUS nbench_connect(struct request_context *req, const char *sharenam return NT_STATUS_UNSUCCESSFUL; } - PASS_THRU(req->conn, connect, (req, sharename)); + PASS_THRU(req->tcon, connect, (req, sharename)); return status; } @@ -130,12 +130,12 @@ static NTSTATUS nbench_connect(struct request_context *req, const char *sharenam /* disconnect from a share */ -static NTSTATUS nbench_disconnect(struct tcon_context *conn) +static NTSTATUS nbench_disconnect(struct smbsrv_tcon *tcon) { - struct nbench_private *private = conn->ntvfs_private; + struct nbench_private *private = tcon->ntvfs_private; NTSTATUS status; - PASS_THRU(conn, disconnect, (conn)); + PASS_THRU(tcon, disconnect, (tcon)); close(private->log_fd); @@ -148,7 +148,7 @@ static NTSTATUS nbench_disconnect(struct tcon_context *conn) */ static NTSTATUS nbench_unlink(struct request_context *req, struct smb_unlink *unl) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, unlink, (req, unl)); @@ -165,7 +165,7 @@ static NTSTATUS nbench_unlink(struct request_context *req, struct smb_unlink *un */ static NTSTATUS nbench_ioctl(struct request_context *req, union smb_ioctl *io) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, ioctl, (req, io)); @@ -180,7 +180,7 @@ static NTSTATUS nbench_ioctl(struct request_context *req, union smb_ioctl *io) */ static NTSTATUS nbench_chkpath(struct request_context *req, struct smb_chkpath *cp) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, chkpath, (req, cp)); @@ -197,7 +197,7 @@ static NTSTATUS nbench_chkpath(struct request_context *req, struct smb_chkpath * */ static NTSTATUS nbench_qpathinfo(struct request_context *req, union smb_fileinfo *info) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, qpathinfo, (req, info)); @@ -215,7 +215,7 @@ static NTSTATUS nbench_qpathinfo(struct request_context *req, union smb_fileinfo */ static NTSTATUS nbench_qfileinfo(struct request_context *req, union smb_fileinfo *info) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, qfileinfo, (req, info)); @@ -234,7 +234,7 @@ static NTSTATUS nbench_qfileinfo(struct request_context *req, union smb_fileinfo */ static NTSTATUS nbench_setpathinfo(struct request_context *req, union smb_setfileinfo *st) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, setpathinfo, (req, st)); @@ -252,7 +252,7 @@ static NTSTATUS nbench_setpathinfo(struct request_context *req, union smb_setfil */ static NTSTATUS nbench_open(struct request_context *req, union smb_open *io) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, open, (req, io)); @@ -281,7 +281,7 @@ static NTSTATUS nbench_open(struct request_context *req, union smb_open *io) */ static NTSTATUS nbench_mkdir(struct request_context *req, union smb_mkdir *md) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, mkdir, (req, md)); @@ -296,7 +296,7 @@ static NTSTATUS nbench_mkdir(struct request_context *req, union smb_mkdir *md) */ static NTSTATUS nbench_rmdir(struct request_context *req, struct smb_rmdir *rd) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, rmdir, (req, rd)); @@ -313,7 +313,7 @@ static NTSTATUS nbench_rmdir(struct request_context *req, struct smb_rmdir *rd) */ static NTSTATUS nbench_rename(struct request_context *req, union smb_rename *ren) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, rename, (req, ren)); @@ -340,7 +340,7 @@ static NTSTATUS nbench_rename(struct request_context *req, union smb_rename *ren */ static NTSTATUS nbench_copy(struct request_context *req, struct smb_copy *cp) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, copy, (req, cp)); @@ -355,7 +355,7 @@ static NTSTATUS nbench_copy(struct request_context *req, struct smb_copy *cp) */ static NTSTATUS nbench_read(struct request_context *req, union smb_read *rd) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, read, (req, rd)); @@ -383,7 +383,7 @@ static NTSTATUS nbench_read(struct request_context *req, union smb_read *rd) */ static NTSTATUS nbench_write(struct request_context *req, union smb_write *wr) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, write, (req, wr)); @@ -421,7 +421,7 @@ static NTSTATUS nbench_write(struct request_context *req, union smb_write *wr) */ static NTSTATUS nbench_seek(struct request_context *req, struct smb_seek *io) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, seek, (req, io)); @@ -436,7 +436,7 @@ static NTSTATUS nbench_seek(struct request_context *req, struct smb_seek *io) */ static NTSTATUS nbench_flush(struct request_context *req, struct smb_flush *io) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, flush, (req, io)); @@ -453,7 +453,7 @@ static NTSTATUS nbench_flush(struct request_context *req, struct smb_flush *io) */ static NTSTATUS nbench_close(struct request_context *req, union smb_close *io) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, close, (req, io)); @@ -479,7 +479,7 @@ static NTSTATUS nbench_close(struct request_context *req, union smb_close *io) */ static NTSTATUS nbench_exit(struct request_context *req) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, exit, (req)); @@ -492,7 +492,7 @@ static NTSTATUS nbench_exit(struct request_context *req) */ static NTSTATUS nbench_lock(struct request_context *req, union smb_lock *lck) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, lock, (req, lck)); @@ -525,7 +525,7 @@ static NTSTATUS nbench_lock(struct request_context *req, union smb_lock *lck) static NTSTATUS nbench_setfileinfo(struct request_context *req, union smb_setfileinfo *info) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, setfileinfo, (req, info)); @@ -544,7 +544,7 @@ static NTSTATUS nbench_setfileinfo(struct request_context *req, */ static NTSTATUS nbench_fsinfo(struct request_context *req, union smb_fsinfo *fs) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, fsinfo, (req, fs)); @@ -561,7 +561,7 @@ static NTSTATUS nbench_fsinfo(struct request_context *req, union smb_fsinfo *fs) */ static NTSTATUS nbench_lpq(struct request_context *req, union smb_lpq *lpq) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, lpq, (req, lpq)); @@ -578,7 +578,7 @@ static NTSTATUS nbench_search_first(struct request_context *req, union smb_searc void *search_private, BOOL (*callback)(void *, union smb_search_data *)) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, search_first, (req, io, search_private, callback)); @@ -606,7 +606,7 @@ static NTSTATUS nbench_search_next(struct request_context *req, union smb_search void *search_private, BOOL (*callback)(void *, union smb_search_data *)) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, search_next, (req, io, search_private, callback)); @@ -619,7 +619,7 @@ static NTSTATUS nbench_search_next(struct request_context *req, union smb_search /* close a search */ static NTSTATUS nbench_search_close(struct request_context *req, union smb_search_close *io) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, search_close, (req, io)); @@ -632,7 +632,7 @@ static NTSTATUS nbench_search_close(struct request_context *req, union smb_searc /* SMBtrans - not used on file shares */ static NTSTATUS nbench_trans(struct request_context *req, struct smb_trans2 *trans2) { - struct nbench_private *private = req->conn->ntvfs_private; + struct nbench_private *private = req->tcon->ntvfs_private; NTSTATUS status; PASS_THRU_REQ(req, trans, (req,trans2)); diff --git a/source4/ntvfs/ntvfs.h b/source4/ntvfs/ntvfs.h index b03ab218c6..dd245b09ce 100644 --- a/source4/ntvfs/ntvfs.h +++ b/source4/ntvfs/ntvfs.h @@ -31,7 +31,7 @@ struct ntvfs_ops { /* initial setup */ NTSTATUS (*connect)(struct request_context *req, const char *sharename); - NTSTATUS (*disconnect)(struct tcon_context *conn); + NTSTATUS (*disconnect)(struct smbsrv_tcon *tcon); /* path operations */ NTSTATUS (*unlink)(struct request_context *req, struct smb_unlink *unl); @@ -82,6 +82,6 @@ struct ntvfs_critical_sizes { int interface_version; int sizeof_ntvfs_ops; int sizeof_SMB_OFF_T; - int sizeof_tcon_context; + int sizeof_smbsrv_tcon; int sizeof_request_context; }; diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c index 7ed8c738b6..bb751bae01 100644 --- a/source4/ntvfs/ntvfs_base.c +++ b/source4/ntvfs/ntvfs_base.c @@ -102,7 +102,7 @@ const struct ntvfs_critical_sizes *ntvfs_interface_version(void) NTVFS_INTERFACE_VERSION, sizeof(struct ntvfs_ops), sizeof(SMB_OFF_T), - sizeof(struct tcon_context), + sizeof(struct smbsrv_tcon), sizeof(struct request_context), }; @@ -135,12 +135,12 @@ BOOL ntvfs_init(void) */ NTSTATUS ntvfs_init_connection(struct request_context *req) { - const char *handler = lp_ntvfs_handler(req->conn->service); + const char *handler = lp_ntvfs_handler(req->tcon->service); - req->conn->ntvfs_ops = ntvfs_backend_byname(handler, req->conn->type); + req->tcon->ntvfs_ops = ntvfs_backend_byname(handler, req->tcon->type); - if (!req->conn->ntvfs_ops) { - DEBUG(1,("ntvfs_init_connection: failed to find backend=%s, type=%d\n", handler, req->conn->type)); + if (!req->tcon->ntvfs_ops) { + DEBUG(1,("ntvfs_init_connection: failed to find backend=%s, type=%d\n", handler, req->tcon->type)); return NT_STATUS_UNSUCCESSFUL; } diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 0f5f0badcb..b2cf107b7d 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -145,7 +145,7 @@ NTSTATUS ntvfs_map_open(struct request_context *req, union smb_open *io) io2.generic.in.file_attr = io->openx.in.file_attrs; io2.generic.in.fname = io->openx.in.fname; - status = req->conn->ntvfs_ops->open(req, &io2); + status = req->tcon->ntvfs_ops->open(req, &io2); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -227,7 +227,7 @@ NTSTATUS ntvfs_map_open(struct request_context *req, union smb_open *io) DEBUG(9,("ntvfs_map_open(OPEN): mapped flags=0x%x to access_mask=0x%x and share_access=0x%x\n", io->open.in.flags, io2.generic.in.access_mask, io2.generic.in.share_access)); - status = req->conn->ntvfs_ops->open(req, &io2); + status = req->tcon->ntvfs_ops->open(req, &io2); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -261,7 +261,7 @@ NTSTATUS ntvfs_map_fsinfo(struct request_context *req, union smb_fsinfo *fs) /* ask the backend for the generic info */ fs2.generic.level = RAW_QFS_GENERIC; - status = req->conn->ntvfs_ops->fsinfo(req, &fs2); + status = req->tcon->ntvfs_ops->fsinfo(req, &fs2); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -603,7 +603,7 @@ NTSTATUS ntvfs_map_qfileinfo(struct request_context *req, union smb_fileinfo *in info2.generic.level = RAW_FILEINFO_GENERIC; info2.generic.in.fnum = info->generic.in.fnum; - status = req->conn->ntvfs_ops->qfileinfo(req, &info2); + status = req->tcon->ntvfs_ops->qfileinfo(req, &info2); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -626,7 +626,7 @@ NTSTATUS ntvfs_map_qpathinfo(struct request_context *req, union smb_fileinfo *in info2.generic.level = RAW_FILEINFO_GENERIC; info2.generic.in.fname = info->generic.in.fname; - status = req->conn->ntvfs_ops->qpathinfo(req, &info2); + status = req->tcon->ntvfs_ops->qpathinfo(req, &info2); if (!NT_STATUS_IS_OK(status)) { return status; } diff --git a/source4/ntvfs/print/vfs_print.c b/source4/ntvfs/print/vfs_print.c index f56b906501..a2ac429458 100644 --- a/source4/ntvfs/print/vfs_print.c +++ b/source4/ntvfs/print/vfs_print.c @@ -37,7 +37,7 @@ static NTSTATUS print_connect(struct request_context *req, const char *sharename /* disconnect from a share */ -static NTSTATUS print_disconnect(struct tcon_context *conn) +static NTSTATUS print_disconnect(struct smbsrv_tcon *tcon) { return NT_STATUS_OK; } @@ -71,7 +71,7 @@ static NTSTATUS print_ioctl(struct request_context *req, union smb_ioctl *io) p = io->ioctl.out.blob.data; SSVAL(p,0, 1 /* REWRITE: fsp->rap_print_jobid */); push_string(NULL, p+2, lp_netbios_name(), 15, STR_TERMINATE|STR_ASCII); - push_string(NULL, p+18, lp_servicename(req->conn->service), 13, STR_TERMINATE|STR_ASCII); + push_string(NULL, p+18, lp_servicename(req->tcon->service), 13, STR_TERMINATE|STR_ASCII); return NT_STATUS_OK; } diff --git a/source4/ntvfs/simple/svfs_util.c b/source4/ntvfs/simple/svfs_util.c index ec1c07dff7..0f0555ac18 100644 --- a/source4/ntvfs/simple/svfs_util.c +++ b/source4/ntvfs/simple/svfs_util.c @@ -31,7 +31,7 @@ */ char *svfs_unix_path(struct request_context *req, const char *name) { - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; char *ret; if (*name != '\\') { diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c index 1abf5ed9af..013419e4ee 100644 --- a/source4/ntvfs/simple/vfs_simple.c +++ b/source4/ntvfs/simple/vfs_simple.c @@ -33,7 +33,7 @@ #define O_DIRECTORY 0 #endif -#define CHECK_READ_ONLY(req) do { if (lp_readonly(req->conn->service)) return NT_STATUS_ACCESS_DENIED; } while (0) +#define CHECK_READ_ONLY(req) do { if (lp_readonly(req->tcon->service)) return NT_STATUS_ACCESS_DENIED; } while (0) #ifndef HAVE_PREAD static ssize_t pread(int __fd, void *__buf, size_t __nbytes, off_t __offset) @@ -64,15 +64,15 @@ static ssize_t pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offs static NTSTATUS svfs_connect(struct request_context *req, const char *sharename) { struct stat st; - struct tcon_context *conn = req->conn; + struct smbsrv_tcon *tcon = req->tcon; struct svfs_private *private; - conn->ntvfs_private = talloc_p(conn->mem_ctx, struct svfs_private); + tcon->ntvfs_private = talloc_p(tcon->mem_ctx, struct svfs_private); - private = conn->ntvfs_private; + private = tcon->ntvfs_private; private->next_search_handle = 0; - private->connectpath = talloc_strdup(conn->mem_ctx, lp_pathname(conn->service)); + private->connectpath = talloc_strdup(tcon->mem_ctx, lp_pathname(tcon->service)); private->open_files = NULL; /* the directory must exist */ @@ -82,8 +82,8 @@ static NTSTATUS svfs_connect(struct request_context *req, const char *sharename) return NT_STATUS_BAD_NETWORK_NAME; } - conn->fs_type = talloc_strdup(conn->mem_ctx, "NTFS"); - conn->dev_type = talloc_strdup(conn->mem_ctx, "A:"); + tcon->fs_type = talloc_strdup(tcon->mem_ctx, "NTFS"); + tcon->dev_type = talloc_strdup(tcon->mem_ctx, "A:"); DEBUG(0,("WARNING: ntvfs simple: connect to share [%s] with ROOT privileges!!!\n",sharename)); @@ -93,7 +93,7 @@ static NTSTATUS svfs_connect(struct request_context *req, const char *sharename) /* disconnect from a share */ -static NTSTATUS svfs_disconnect(struct tcon_context *req) +static NTSTATUS svfs_disconnect(struct smbsrv_tcon *tcon) { return NT_STATUS_OK; } @@ -268,7 +268,7 @@ static NTSTATUS svfs_qpathinfo(struct request_context *req, union smb_fileinfo * */ static NTSTATUS svfs_qfileinfo(struct request_context *req, union smb_fileinfo *info) { - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; struct svfs_file *f; struct stat st; @@ -296,7 +296,7 @@ static NTSTATUS svfs_qfileinfo(struct request_context *req, union smb_fileinfo * */ static NTSTATUS svfs_open(struct request_context *req, union smb_open *io) { - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; char *unix_path; struct stat st; int fd, flags; @@ -307,7 +307,7 @@ static NTSTATUS svfs_open(struct request_context *req, union smb_open *io) return ntvfs_map_open(req, io); } - if (lp_readonly(req->conn->service)) { + if (lp_readonly(req->tcon->service)) { create_flags = 0; rdwr_flags = O_RDONLY; } else { @@ -341,7 +341,7 @@ static NTSTATUS svfs_open(struct request_context *req, union smb_open *io) if (io->generic.in.create_options & NTCREATEX_OPTIONS_DIRECTORY) { flags = O_RDONLY | O_DIRECTORY; - if (lp_readonly(req->conn->service)) { + if (lp_readonly(req->tcon->service)) { goto do_open; } switch (io->generic.in.open_disposition) { @@ -376,9 +376,9 @@ do_open: return map_nt_error_from_unix(errno); } - f = talloc_p(req->conn->mem_ctx, struct svfs_file); + f = talloc_p(req->tcon->mem_ctx, struct svfs_file); f->fd = fd; - f->name = talloc_strdup(req->conn->mem_ctx, unix_path); + f->name = talloc_strdup(req->tcon->mem_ctx, unix_path); DLIST_ADD(private->open_files, f); @@ -562,7 +562,7 @@ static NTSTATUS svfs_flush(struct request_context *req, struct smb_flush *io) */ static NTSTATUS svfs_close(struct request_context *req, union smb_close *io) { - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; struct svfs_file *f; if (io->generic.level != RAW_CLOSE_CLOSE) { @@ -580,8 +580,8 @@ static NTSTATUS svfs_close(struct request_context *req, union smb_close *io) } DLIST_REMOVE(private->open_files, f); - talloc_free(req->conn->mem_ctx, f->name); - talloc_free(req->conn->mem_ctx, f); + talloc_free(req->tcon->mem_ctx, f->name); + talloc_free(req->tcon->mem_ctx, f); return NT_STATUS_OK; } @@ -661,7 +661,7 @@ static NTSTATUS svfs_setfileinfo(struct request_context *req, */ static NTSTATUS svfs_fsinfo(struct request_context *req, union smb_fsinfo *fs) { - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; struct stat st; if (fs->generic.level != RAW_QFS_GENERIC) { @@ -690,8 +690,8 @@ static NTSTATUS svfs_fsinfo(struct request_context *req, union smb_fsinfo *fs) fs->generic.out.quota_soft = 0; fs->generic.out.quota_hard = 0; fs->generic.out.quota_flags = 0; - fs->generic.out.volume_name = talloc_strdup(req->mem_ctx, lp_servicename(req->conn->service)); - fs->generic.out.fs_type = req->conn->fs_type; + fs->generic.out.volume_name = talloc_strdup(req->mem_ctx, lp_servicename(req->tcon->service)); + fs->generic.out.fs_type = req->tcon->fs_type; return NT_STATUS_OK; } @@ -703,7 +703,7 @@ static NTSTATUS svfs_fsinfo(struct request_context *req, union smb_fsinfo *fs) static NTSTATUS svfs_fsattr(struct request_context *req, union smb_fsattr *fs) { struct stat st; - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; if (fs->generic.level != RAW_FSATTR_GENERIC) { return ntvfs_map_fsattr(req, fs); @@ -722,7 +722,7 @@ static NTSTATUS svfs_fsattr(struct request_context *req, union smb_fsattr *fs) fs->generic.out.serial_number = 1; fs->generic.out.fs_type = talloc_strdup(req->mem_ctx, "NTFS"); fs->generic.out.volume_name = talloc_strdup(req->mem_ctx, - lp_servicename(req->conn->service)); + lp_servicename(req->tcon->service)); return NT_STATUS_OK; } @@ -745,7 +745,7 @@ static NTSTATUS svfs_search_first(struct request_context *req, union smb_search_ { struct svfs_dir *dir; int i; - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; struct search_state *search; union smb_search_data file; TALLOC_CTX *mem_ctx; @@ -819,7 +819,7 @@ static NTSTATUS svfs_search_next(struct request_context *req, union smb_search_n { struct svfs_dir *dir; int i; - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; struct search_state *search; union smb_search_data file; uint_t max_count; @@ -902,7 +902,7 @@ found: /* close a search */ static NTSTATUS svfs_search_close(struct request_context *req, union smb_search_close *io) { - struct svfs_private *private = req->conn->ntvfs_private; + struct svfs_private *private = req->tcon->ntvfs_private; struct search_state *search; for (search=private->search; search; search = search->next) { |