diff options
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/cifs/vfs_cifs.c | 240 | ||||
-rw-r--r-- | source4/ntvfs/cifs_posix_cli/svfs_util.c | 12 | ||||
-rw-r--r-- | source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c | 92 | ||||
-rw-r--r-- | source4/ntvfs/common/opendb.c | 8 | ||||
-rw-r--r-- | source4/ntvfs/common/opendb.h | 4 | ||||
-rw-r--r-- | source4/ntvfs/common/opendb_tdb.c | 8 | ||||
-rw-r--r-- | source4/ntvfs/ipc/rap_server.c | 1 | ||||
-rw-r--r-- | source4/ntvfs/ipc/vfs_ipc.c | 88 | ||||
-rw-r--r-- | source4/ntvfs/nbench/vfs_nbench.c | 8 | ||||
-rw-r--r-- | source4/ntvfs/ntvfs.h | 10 | ||||
-rw-r--r-- | source4/ntvfs/ntvfs_interface.c | 32 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_aio.c | 8 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_lock.c | 4 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_notify.c | 8 | ||||
-rw-r--r-- | source4/ntvfs/posix/vfs_posix.c | 1 | ||||
-rw-r--r-- | source4/ntvfs/posix/vfs_posix.h | 2 | ||||
-rw-r--r-- | source4/ntvfs/simple/svfs_util.c | 12 | ||||
-rw-r--r-- | source4/ntvfs/simple/vfs_simple.c | 92 | ||||
-rw-r--r-- | source4/ntvfs/smb2/vfs_smb2.c | 78 | ||||
-rw-r--r-- | source4/ntvfs/unixuid/vfs_unixuid.c | 46 |
20 files changed, 377 insertions, 377 deletions
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c index e615401e51..be9096b01f 100644 --- a/source4/ntvfs/cifs/vfs_cifs.c +++ b/source4/ntvfs/cifs/vfs_cifs.c @@ -64,14 +64,14 @@ struct async_info { }; #define CHECK_UPSTREAM_OPEN do { \ - if (! private->transport->socket->sock) { \ + if (! p->transport->socket->sock) { \ req->async_states->state|=NTVFS_ASYNC_STATE_CLOSE; \ return NT_STATUS_CONNECTION_DISCONNECTED; \ } \ } while(0) #define SETUP_PID do { \ - private->tree->session->pid = req->smbpid; \ + p->tree->session->pid = req->smbpid; \ CHECK_UPSTREAM_OPEN; \ } while(0) @@ -110,12 +110,12 @@ struct async_info { */ static bool oplock_handler(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *p_private) { - struct cvfs_private *private = p_private; + struct cvfs_private *p = p_private; NTSTATUS status; struct ntvfs_handle *h = NULL; struct cvfs_file *f; - for (f=private->files; f; f=f->next) { + for (f=p->files; f; f=f->next) { if (f->fnum != fnum) continue; h = f->h; break; @@ -127,7 +127,7 @@ static bool oplock_handler(struct smbcli_transport *transport, uint16_t tid, uin } DEBUG(5,("vfs_cifs: sending oplock break level %d for fnum %d\n", level, fnum)); - status = ntvfs_send_oplock_break(private->ntvfs, h, level); + status = ntvfs_send_oplock_break(p->ntvfs, h, level); if (!NT_STATUS_IS_OK(status)) return false; return true; } @@ -139,7 +139,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *sharename) { NTSTATUS status; - struct cvfs_private *private; + struct cvfs_private *p; const char *host, *user, *pass, *domain, *remote_share; struct smb_composite_connect io; struct composite_context *creq; @@ -163,12 +163,12 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, machine_account = share_bool_option(scfg, CIFS_USE_MACHINE_ACCT, CIFS_USE_MACHINE_ACCT_DEFAULT); - private = talloc_zero(ntvfs, struct cvfs_private); - if (!private) { + p = talloc_zero(ntvfs, struct cvfs_private); + if (!p) { return NT_STATUS_NO_MEMORY; } - ntvfs->private_data = private; + ntvfs->private_data = p; if (!host) { DEBUG(1,("CIFS backend: You must supply server\n")); @@ -177,7 +177,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, if (user && pass) { DEBUG(5, ("CIFS backend: Using specified password\n")); - credentials = cli_credentials_init(private); + credentials = cli_credentials_init(p); if (!credentials) { return NT_STATUS_NO_MEMORY; } @@ -189,7 +189,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, cli_credentials_set_password(credentials, pass, CRED_SPECIFIED); } else if (machine_account) { DEBUG(5, ("CIFS backend: Using machine account\n")); - credentials = cli_credentials_init(private); + credentials = cli_credentials_init(p); cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx); if (domain) { cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED); @@ -217,7 +217,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, io.in.service = remote_share; io.in.service_type = "?????"; io.in.iconv_convenience = lp_iconv_convenience(ntvfs->ctx->lp_ctx); - io.in.gensec_settings = lp_gensec_settings(private, ntvfs->ctx->lp_ctx); + io.in.gensec_settings = lp_gensec_settings(p, ntvfs->ctx->lp_ctx); lp_smbcli_options(ntvfs->ctx->lp_ctx, &io.in.options); lp_smbcli_session_options(ntvfs->ctx->lp_ctx, &io.in.session_options); @@ -225,17 +225,17 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, io.in.options.use_level2_oplocks = false; } - creq = smb_composite_connect_send(&io, private, + creq = smb_composite_connect_send(&io, p, lp_resolve_context(ntvfs->ctx->lp_ctx), ntvfs->ctx->event_ctx); - status = smb_composite_connect_recv(creq, private); + status = smb_composite_connect_recv(creq, p); NT_STATUS_NOT_OK_RETURN(status); - private->tree = io.out.tree; + p->tree = io.out.tree; - private->transport = private->tree->session->transport; + p->transport = p->tree->session->transport; SETUP_PID; - private->ntvfs = ntvfs; + p->ntvfs = ntvfs; ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "NTFS"); NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type); @@ -243,11 +243,11 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type); /* we need to receive oplock break requests from the server */ - smbcli_oplock_handler(private->transport, oplock_handler, private); + smbcli_oplock_handler(p->transport, oplock_handler, p); - private->map_generic = share_bool_option(scfg, CIFS_MAP_GENERIC, CIFS_MAP_GENERIC_DEFAULT); + p->map_generic = share_bool_option(scfg, CIFS_MAP_GENERIC, CIFS_MAP_GENERIC_DEFAULT); - private->map_trans2 = share_bool_option(scfg, CIFS_MAP_TRANS2, CIFS_MAP_TRANS2_DEFAULT); + p->map_trans2 = share_bool_option(scfg, CIFS_MAP_TRANS2, CIFS_MAP_TRANS2_DEFAULT); return NT_STATUS_OK; } @@ -257,17 +257,17 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, */ static NTSTATUS cvfs_disconnect(struct ntvfs_module_context *ntvfs) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct async_info *a, *an; /* first cleanup pending requests */ - for (a=private->pending; a; a = an) { + for (a=p->pending; a; a = an) { an = a->next; smbcli_request_destroy(a->c_req); talloc_free(a); } - talloc_free(private); + talloc_free(p); ntvfs->private_data = NULL; return NT_STATUS_OK; @@ -289,7 +289,7 @@ static int async_info_destructor(struct async_info *async) */ static void async_simple(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smbcli_request_simple_recv(c_req); talloc_free(async); @@ -307,10 +307,10 @@ static void async_simple(struct smbcli_request *c_req) async->parms = io; \ async->req = req; \ async->f = file; \ - async->cvfs = private; \ + async->cvfs = p; \ async->c_req = c_req; \ - DLIST_ADD(private->pending, async); \ - c_req->async.private = async; \ + DLIST_ADD(p->pending, async); \ + c_req->async.private_data = async; \ talloc_set_destructor(async, async_info_destructor); \ } \ c_req->async.fn = async_fn; \ @@ -329,7 +329,7 @@ static void async_simple(struct smbcli_request *c_req) static NTSTATUS cvfs_unlink(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_unlink *unl) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; @@ -337,10 +337,10 @@ static NTSTATUS cvfs_unlink(struct ntvfs_module_context *ntvfs, /* see if the front end will allow us to perform this function asynchronously. */ if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_unlink(private->tree, unl); + return smb_raw_unlink(p->tree, unl); } - c_req = smb_raw_unlink_send(private->tree, unl); + c_req = smb_raw_unlink_send(p->tree, unl); SIMPLE_ASYNC_TAIL; } @@ -350,7 +350,7 @@ static NTSTATUS cvfs_unlink(struct ntvfs_module_context *ntvfs, */ static void async_ioctl(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_ioctl_recv(c_req, req, async->parms); talloc_free(async); @@ -363,7 +363,7 @@ static void async_ioctl(struct smbcli_request *c_req) static NTSTATUS cvfs_ioctl(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_ioctl *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID_AND_FILE; @@ -371,10 +371,10 @@ static NTSTATUS cvfs_ioctl(struct ntvfs_module_context *ntvfs, /* see if the front end will allow us to perform this function asynchronously. */ if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_ioctl(private->tree, req, io); + return smb_raw_ioctl(p->tree, req, io); } - c_req = smb_raw_ioctl_send(private->tree, io); + c_req = smb_raw_ioctl_send(p->tree, io); ASYNC_RECV_TAIL(io, async_ioctl); } @@ -385,16 +385,16 @@ static NTSTATUS cvfs_ioctl(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_chkpath *cp) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_chkpath(private->tree, cp); + return smb_raw_chkpath(p->tree, cp); } - c_req = smb_raw_chkpath_send(private->tree, cp); + c_req = smb_raw_chkpath_send(p->tree, cp); SIMPLE_ASYNC_TAIL; } @@ -404,7 +404,7 @@ static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs, */ static void async_qpathinfo(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_pathinfo_recv(c_req, req, async->parms); talloc_free(async); @@ -417,16 +417,16 @@ static void async_qpathinfo(struct smbcli_request *c_req) static NTSTATUS cvfs_qpathinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fileinfo *info) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_pathinfo(private->tree, req, info); + return smb_raw_pathinfo(p->tree, req, info); } - c_req = smb_raw_pathinfo_send(private->tree, info); + c_req = smb_raw_pathinfo_send(p->tree, info); ASYNC_RECV_TAIL(info, async_qpathinfo); } @@ -436,7 +436,7 @@ static NTSTATUS cvfs_qpathinfo(struct ntvfs_module_context *ntvfs, */ static void async_qfileinfo(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_fileinfo_recv(c_req, req, async->parms); talloc_free(async); @@ -449,16 +449,16 @@ static void async_qfileinfo(struct smbcli_request *c_req) static NTSTATUS cvfs_qfileinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fileinfo *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID_AND_FILE; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_fileinfo(private->tree, req, io); + return smb_raw_fileinfo(p->tree, req, io); } - c_req = smb_raw_fileinfo_send(private->tree, io); + c_req = smb_raw_fileinfo_send(p->tree, io); ASYNC_RECV_TAIL(io, async_qfileinfo); } @@ -470,16 +470,16 @@ static NTSTATUS cvfs_qfileinfo(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_setpathinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_setfileinfo *st) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_setpathinfo(private->tree, st); + return smb_raw_setpathinfo(p->tree, st); } - c_req = smb_raw_setpathinfo_send(private->tree, st); + c_req = smb_raw_setpathinfo_send(p->tree, st); SIMPLE_ASYNC_TAIL; } @@ -490,7 +490,7 @@ static NTSTATUS cvfs_setpathinfo(struct ntvfs_module_context *ntvfs, */ static void async_open(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct cvfs_private *cvfs = async->cvfs; struct ntvfs_request *req = async->req; struct cvfs_file *f = async->f; @@ -516,7 +516,7 @@ failed: static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_open *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; struct ntvfs_handle *h; struct cvfs_file *f; @@ -525,7 +525,7 @@ static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs, SETUP_PID; if (io->generic.level != RAW_OPEN_GENERIC && - private->map_generic) { + p->map_generic) { return ntvfs_map_open(ntvfs, req, io); } @@ -539,21 +539,21 @@ static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs, if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { union smb_handle *file; - status = smb_raw_open(private->tree, req, io); + status = smb_raw_open(p->tree, req, io); NT_STATUS_NOT_OK_RETURN(status); SMB_OPEN_OUT_FILE(io, file); f->fnum = file->fnum; file->ntvfs = NULL; - status = ntvfs_handle_set_backend_data(f->h, private->ntvfs, f); + status = ntvfs_handle_set_backend_data(f->h, p->ntvfs, f); NT_STATUS_NOT_OK_RETURN(status); file->ntvfs = f->h; - DLIST_ADD(private->files, f); + DLIST_ADD(p->files, f); return NT_STATUS_OK; } - c_req = smb_raw_open_send(private->tree, io); + c_req = smb_raw_open_send(p->tree, io); ASYNC_RECV_TAIL_F(io, async_open, f); } @@ -564,16 +564,16 @@ static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_mkdir(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_mkdir *md) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_mkdir(private->tree, md); + return smb_raw_mkdir(p->tree, md); } - c_req = smb_raw_mkdir_send(private->tree, md); + c_req = smb_raw_mkdir_send(p->tree, md); SIMPLE_ASYNC_TAIL; } @@ -584,15 +584,15 @@ static NTSTATUS cvfs_mkdir(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_rmdir(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, struct smb_rmdir *rd) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_rmdir(private->tree, rd); + return smb_raw_rmdir(p->tree, rd); } - c_req = smb_raw_rmdir_send(private->tree, rd); + c_req = smb_raw_rmdir_send(p->tree, rd); SIMPLE_ASYNC_TAIL; } @@ -603,7 +603,7 @@ static NTSTATUS cvfs_rmdir(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_rename(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_rename *ren) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; @@ -616,10 +616,10 @@ static NTSTATUS cvfs_rename(struct ntvfs_module_context *ntvfs, } if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_rename(private->tree, ren); + return smb_raw_rename(p->tree, ren); } - c_req = smb_raw_rename_send(private->tree, ren); + c_req = smb_raw_rename_send(p->tree, ren); SIMPLE_ASYNC_TAIL; } @@ -638,7 +638,7 @@ static NTSTATUS cvfs_copy(struct ntvfs_module_context *ntvfs, */ static void async_read(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_read_recv(c_req, async->parms); talloc_free(async); @@ -651,23 +651,23 @@ static void async_read(struct smbcli_request *c_req) static NTSTATUS cvfs_read(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_read *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (io->generic.level != RAW_READ_GENERIC && - private->map_generic) { + p->map_generic) { return ntvfs_map_read(ntvfs, req, io); } SETUP_FILE; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_read(private->tree, io); + return smb_raw_read(p->tree, io); } - c_req = smb_raw_read_send(private->tree, io); + c_req = smb_raw_read_send(p->tree, io); ASYNC_RECV_TAIL(io, async_read); } @@ -677,7 +677,7 @@ static NTSTATUS cvfs_read(struct ntvfs_module_context *ntvfs, */ static void async_write(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_write_recv(c_req, async->parms); talloc_free(async); @@ -690,22 +690,22 @@ static void async_write(struct smbcli_request *c_req) static NTSTATUS cvfs_write(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_write *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (io->generic.level != RAW_WRITE_GENERIC && - private->map_generic) { + p->map_generic) { return ntvfs_map_write(ntvfs, req, io); } SETUP_FILE; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_write(private->tree, io); + return smb_raw_write(p->tree, io); } - c_req = smb_raw_write_send(private->tree, io); + c_req = smb_raw_write_send(p->tree, io); ASYNC_RECV_TAIL(io, async_write); } @@ -715,7 +715,7 @@ static NTSTATUS cvfs_write(struct ntvfs_module_context *ntvfs, */ static void async_seek(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_seek_recv(c_req, async->parms); talloc_free(async); @@ -729,16 +729,16 @@ static NTSTATUS cvfs_seek(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_seek *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID_AND_FILE; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_seek(private->tree, io); + return smb_raw_seek(p->tree, io); } - c_req = smb_raw_seek_send(private->tree, io); + c_req = smb_raw_seek_send(p->tree, io); ASYNC_RECV_TAIL(io, async_seek); } @@ -750,7 +750,7 @@ static NTSTATUS cvfs_flush(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_flush *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; @@ -766,10 +766,10 @@ static NTSTATUS cvfs_flush(struct ntvfs_module_context *ntvfs, } if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_flush(private->tree, io); + return smb_raw_flush(p->tree, io); } - c_req = smb_raw_flush_send(private->tree, io); + c_req = smb_raw_flush_send(p->tree, io); SIMPLE_ASYNC_TAIL; } @@ -780,7 +780,7 @@ static NTSTATUS cvfs_flush(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_close *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; struct cvfs_file *f; union smb_close io2; @@ -788,7 +788,7 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs, SETUP_PID; if (io->generic.level != RAW_CLOSE_GENERIC && - private->map_generic) { + p->map_generic) { return ntvfs_map_close(ntvfs, req, io); } @@ -805,13 +805,13 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs, even if file-close fails, we'll remove it from the list, what else would we do? Maybe we should not remove until after the proxied call completes? */ - DLIST_REMOVE(private->files, f); + DLIST_REMOVE(p->files, f); if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_close(private->tree, io); + return smb_raw_close(p->tree, io); } - c_req = smb_raw_close_send(private->tree, io); + c_req = smb_raw_close_send(p->tree, io); SIMPLE_ASYNC_TAIL; } @@ -822,16 +822,16 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_exit(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_exit(private->tree->session); + return smb_raw_exit(p->tree->session); } - c_req = smb_raw_exit_send(private->tree->session); + c_req = smb_raw_exit_send(p->tree->session); SIMPLE_ASYNC_TAIL; } @@ -851,7 +851,7 @@ static NTSTATUS cvfs_logoff(struct ntvfs_module_context *ntvfs, */ static NTSTATUS cvfs_async_setup(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - void *private) + void *private_data) { return NT_STATUS_OK; } @@ -862,11 +862,11 @@ static NTSTATUS cvfs_async_setup(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_cancel(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct async_info *a; /* find the matching request */ - for (a=private->pending;a;a=a->next) { + for (a=p->pending;a;a=a->next) { if (a->req == req) { break; } @@ -885,22 +885,22 @@ static NTSTATUS cvfs_cancel(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_lock(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_lock *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (io->generic.level != RAW_LOCK_GENERIC && - private->map_generic) { + p->map_generic) { return ntvfs_map_lock(ntvfs, req, io); } SETUP_FILE; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_lock(private->tree, io); + return smb_raw_lock(p->tree, io); } - c_req = smb_raw_lock_send(private->tree, io); + c_req = smb_raw_lock_send(p->tree, io); SIMPLE_ASYNC_TAIL; } @@ -911,15 +911,15 @@ static NTSTATUS cvfs_setfileinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_setfileinfo *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID_AND_FILE; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_setfileinfo(private->tree, io); + return smb_raw_setfileinfo(p->tree, io); } - c_req = smb_raw_setfileinfo_send(private->tree, io); + c_req = smb_raw_setfileinfo_send(p->tree, io); SIMPLE_ASYNC_TAIL; } @@ -930,7 +930,7 @@ static NTSTATUS cvfs_setfileinfo(struct ntvfs_module_context *ntvfs, */ static void async_fsinfo(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_fsinfo_recv(c_req, req, async->parms); talloc_free(async); @@ -943,16 +943,16 @@ static void async_fsinfo(struct smbcli_request *c_req) static NTSTATUS cvfs_fsinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fsinfo *fs) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; SETUP_PID; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_fsinfo(private->tree, req, fs); + return smb_raw_fsinfo(p->tree, req, fs); } - c_req = smb_raw_fsinfo_send(private->tree, req, fs); + c_req = smb_raw_fsinfo_send(p->tree, req, fs); ASYNC_RECV_TAIL(fs, async_fsinfo); } @@ -974,11 +974,11 @@ static NTSTATUS cvfs_search_first(struct ntvfs_module_context *ntvfs, void *search_private, bool (*callback)(void *, const union smb_search_data *)) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; SETUP_PID; - return smb_raw_search_first(private->tree, req, io, search_private, callback); + return smb_raw_search_first(p->tree, req, io, search_private, callback); } /* continue a search */ @@ -987,22 +987,22 @@ static NTSTATUS cvfs_search_next(struct ntvfs_module_context *ntvfs, void *search_private, bool (*callback)(void *, const union smb_search_data *)) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; SETUP_PID; - return smb_raw_search_next(private->tree, req, io, search_private, callback); + return smb_raw_search_next(p->tree, req, io, search_private, callback); } /* close a search */ static NTSTATUS cvfs_search_close(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_search_close *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; SETUP_PID; - return smb_raw_search_close(private->tree, io); + return smb_raw_search_close(p->tree, io); } /* @@ -1010,7 +1010,7 @@ static NTSTATUS cvfs_search_close(struct ntvfs_module_context *ntvfs, */ static void async_trans2(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_trans2_recv(c_req, req, async->parms); talloc_free(async); @@ -1022,20 +1022,20 @@ static NTSTATUS cvfs_trans2(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, struct smb_trans2 *trans2) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; - if (private->map_trans2) { + if (p->map_trans2) { return NT_STATUS_NOT_IMPLEMENTED; } SETUP_PID; if (!(req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC)) { - return smb_raw_trans2(private->tree, req, trans2); + return smb_raw_trans2(p->tree, req, trans2); } - c_req = smb_raw_trans2_send(private->tree, trans2); + c_req = smb_raw_trans2_send(p->tree, trans2); ASYNC_RECV_TAIL(trans2, async_trans2); } @@ -1054,7 +1054,7 @@ static NTSTATUS cvfs_trans(struct ntvfs_module_context *ntvfs, */ static void async_changenotify(struct smbcli_request *c_req) { - struct async_info *async = c_req->async.private; + struct async_info *async = c_req->async.private_data; struct ntvfs_request *req = async->req; req->async_states->status = smb_raw_changenotify_recv(c_req, req, async->parms); talloc_free(async); @@ -1066,9 +1066,9 @@ static NTSTATUS cvfs_notify(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_notify *io) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smbcli_request *c_req; - int saved_timeout = private->transport->options.request_timeout; + int saved_timeout = p->transport->options.request_timeout; struct cvfs_file *f; if (io->nttrans.level != RAW_NOTIFY_NTTRANS) { @@ -1088,11 +1088,11 @@ static NTSTATUS cvfs_notify(struct ntvfs_module_context *ntvfs, /* we must not timeout on notify requests - they wait forever */ - private->transport->options.request_timeout = 0; + p->transport->options.request_timeout = 0; - c_req = smb_raw_changenotify_send(private->tree, io); + c_req = smb_raw_changenotify_send(p->tree, io); - private->transport->options.request_timeout = saved_timeout; + p->transport->options.request_timeout = saved_timeout; ASYNC_RECV_TAIL(io, async_changenotify); } diff --git a/source4/ntvfs/cifs_posix_cli/svfs_util.c b/source4/ntvfs/cifs_posix_cli/svfs_util.c index e502340229..03a46205a7 100644 --- a/source4/ntvfs/cifs_posix_cli/svfs_util.c +++ b/source4/ntvfs/cifs_posix_cli/svfs_util.c @@ -39,17 +39,17 @@ char *cifspsx_unix_path(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *name) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; char *ret; if (*name != '\\') { - ret = talloc_asprintf(req, "%s/%s", private->connectpath, name); + ret = talloc_asprintf(req, "%s/%s", p->connectpath, name); } else { - ret = talloc_asprintf(req, "%s%s", private->connectpath, name); + ret = talloc_asprintf(req, "%s%s", p->connectpath, name); } all_string_sub(ret, "\\", "/", 0); - strlower(ret + strlen(private->connectpath)); + strlower(ret + strlen(p->connectpath)); return ret; } @@ -145,13 +145,13 @@ struct cifspsx_dir *cifspsx_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request */ struct cifspsx_dir *cifspsx_list(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *pattern) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; char *unix_path; unix_path = cifspsx_unix_path(ntvfs, req, pattern); if (!unix_path) { return NULL; } - return cifspsx_list_unix(private, req, unix_path); + return cifspsx_list_unix(p, req, unix_path); } diff --git a/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c b/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c index 34a26b06b4..02fe9f2264 100644 --- a/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c +++ b/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c @@ -51,21 +51,21 @@ static NTSTATUS cifspsx_connect(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *sharename) { struct stat st; - struct cifspsx_private *private; + struct cifspsx_private *p; struct share_config *scfg = ntvfs->ctx->config; - private = talloc(ntvfs, struct cifspsx_private); - NT_STATUS_HAVE_NO_MEMORY(private); - private->ntvfs = ntvfs; - private->next_search_handle = 0; - private->connectpath = talloc_strdup(private, share_string_option(scfg, SHARE_PATH, "")); - private->open_files = NULL; - private->search = NULL; + p = talloc(ntvfs, struct cifspsx_private); + NT_STATUS_HAVE_NO_MEMORY(p); + p->ntvfs = ntvfs; + p->next_search_handle = 0; + p->connectpath = talloc_strdup(p, share_string_option(scfg, SHARE_PATH, "")); + p->open_files = NULL; + p->search = NULL; /* the directory must exist */ - if (stat(private->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) { + if (stat(p->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) { DEBUG(0,("'%s' is not a directory, when connecting to [%s]\n", - private->connectpath, sharename)); + p->connectpath, sharename)); return NT_STATUS_BAD_NETWORK_NAME; } @@ -74,7 +74,7 @@ static NTSTATUS cifspsx_connect(struct ntvfs_module_context *ntvfs, ntvfs->ctx->dev_type = talloc_strdup(ntvfs->ctx, "A:"); NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type); - ntvfs->private_data = private; + ntvfs->private_data = p; DEBUG(0,("WARNING: ntvfs cifs posix: connect to share [%s] with ROOT privileges!!!\n",sharename)); @@ -92,12 +92,12 @@ static NTSTATUS cifspsx_disconnect(struct ntvfs_module_context *ntvfs) /* find open file handle given fd */ -static struct cifspsx_file *find_fd(struct cifspsx_private *private, struct ntvfs_handle *handle) +static struct cifspsx_file *find_fd(struct cifspsx_private *cp, struct ntvfs_handle *handle) { struct cifspsx_file *f; void *p; - p = ntvfs_handle_get_backend_data(handle, private->ntvfs); + p = ntvfs_handle_get_backend_data(handle, cp->ntvfs); if (!p) return NULL; f = talloc_get_type(p, struct cifspsx_file); @@ -278,7 +278,7 @@ static NTSTATUS cifspsx_qpathinfo(struct ntvfs_module_context *ntvfs, static NTSTATUS cifspsx_qfileinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fileinfo *info) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct cifspsx_file *f; struct stat st; @@ -286,7 +286,7 @@ static NTSTATUS cifspsx_qfileinfo(struct ntvfs_module_context *ntvfs, return ntvfs_map_qfileinfo(ntvfs, req, info); } - f = find_fd(private, info->generic.in.file.ntvfs); + f = find_fd(p, info->generic.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -305,7 +305,7 @@ static NTSTATUS cifspsx_qfileinfo(struct ntvfs_module_context *ntvfs, static NTSTATUS cifspsx_open(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_open *io) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; char *unix_path; struct stat st; int fd, flags; @@ -394,7 +394,7 @@ do_open: f->name = talloc_strdup(f, unix_path); NT_STATUS_HAVE_NO_MEMORY(f->name); - DLIST_ADD(private->open_files, f); + DLIST_ADD(p->open_files, f); status = ntvfs_handle_set_backend_data(handle, ntvfs, f); NT_STATUS_NOT_OK_RETURN(status); @@ -495,7 +495,7 @@ static NTSTATUS cifspsx_copy(struct ntvfs_module_context *ntvfs, static NTSTATUS cifspsx_read(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_read *rd) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct cifspsx_file *f; ssize_t ret; @@ -503,7 +503,7 @@ static NTSTATUS cifspsx_read(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } - f = find_fd(private, rd->readx.in.file.ntvfs); + f = find_fd(p, rd->readx.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -529,7 +529,7 @@ static NTSTATUS cifspsx_read(struct ntvfs_module_context *ntvfs, static NTSTATUS cifspsx_write(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_write *wr) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct cifspsx_file *f; ssize_t ret; @@ -539,7 +539,7 @@ static NTSTATUS cifspsx_write(struct ntvfs_module_context *ntvfs, CHECK_READ_ONLY(req); - f = find_fd(private, wr->writex.in.file.ntvfs); + f = find_fd(p, wr->writex.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -575,14 +575,14 @@ static NTSTATUS cifspsx_flush(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_flush *io) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct cifspsx_file *f; switch (io->generic.level) { case RAW_FLUSH_FLUSH: case RAW_FLUSH_SMB2: /* ignore the additional unknown option in SMB2 */ - f = find_fd(private, io->generic.in.file.ntvfs); + f = find_fd(p, io->generic.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -590,7 +590,7 @@ static NTSTATUS cifspsx_flush(struct ntvfs_module_context *ntvfs, return NT_STATUS_OK; case RAW_FLUSH_ALL: - for (f=private->open_files;f;f=f->next) { + for (f=p->open_files;f;f=f->next) { fsync(f->fd); } return NT_STATUS_OK; @@ -606,7 +606,7 @@ static NTSTATUS cifspsx_close(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_close *io) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct cifspsx_file *f; if (io->generic.level != RAW_CLOSE_CLOSE) { @@ -614,7 +614,7 @@ static NTSTATUS cifspsx_close(struct ntvfs_module_context *ntvfs, return NT_STATUS_INVALID_LEVEL; } - f = find_fd(private, io->close.in.file.ntvfs); + f = find_fd(p, io->close.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -623,7 +623,7 @@ static NTSTATUS cifspsx_close(struct ntvfs_module_context *ntvfs, return map_nt_error_from_unix(errno); } - DLIST_REMOVE(private->open_files, f); + DLIST_REMOVE(p->open_files, f); talloc_free(f->name); talloc_free(f); @@ -653,7 +653,7 @@ static NTSTATUS cifspsx_logoff(struct ntvfs_module_context *ntvfs, */ static NTSTATUS cifspsx_async_setup(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - void *private) + void *private_data) { return NT_STATUS_OK; } @@ -694,13 +694,13 @@ static NTSTATUS cifspsx_setfileinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_setfileinfo *info) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct cifspsx_file *f; struct utimbuf unix_times; CHECK_READ_ONLY(req); - f = find_fd(private, info->generic.in.file.ntvfs); + f = find_fd(p, info->generic.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -746,14 +746,14 @@ static NTSTATUS cifspsx_setfileinfo(struct ntvfs_module_context *ntvfs, static NTSTATUS cifspsx_fsinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fsinfo *fs) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct stat st; if (fs->generic.level != RAW_QFS_GENERIC) { return ntvfs_map_fsinfo(ntvfs, req, fs); } - if (sys_fsusage(private->connectpath, + if (sys_fsusage(p->connectpath, &fs->generic.out.blocks_free, &fs->generic.out.blocks_total) == -1) { return map_nt_error_from_unix(errno); @@ -761,7 +761,7 @@ static NTSTATUS cifspsx_fsinfo(struct ntvfs_module_context *ntvfs, fs->generic.out.block_size = 512; - if (stat(private->connectpath, &st) != 0) { + if (stat(p->connectpath, &st) != 0) { return NT_STATUS_DISK_CORRUPT_ERROR; } @@ -789,13 +789,13 @@ static NTSTATUS cifspsx_fsattr(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fsattr *fs) { struct stat st; - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; if (fs->generic.level != RAW_FSATTR_GENERIC) { return ntvfs_map_fsattr(ntvfs, req, fs); } - if (stat(private->connectpath, &st) == -1) { + if (stat(p->connectpath, &st) == -1) { return map_nt_error_from_unix(errno); } @@ -833,7 +833,7 @@ static NTSTATUS cifspsx_search_first(struct ntvfs_module_context *ntvfs, { struct cifspsx_dir *dir; int i; - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct search_state *search; union smb_search_data file; uint_t max_count; @@ -846,7 +846,7 @@ static NTSTATUS cifspsx_search_first(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } - search = talloc_zero(private, struct search_state); + search = talloc_zero(p, struct search_state); if (!search) { return NT_STATUS_NO_MEMORY; } @@ -858,7 +858,7 @@ static NTSTATUS cifspsx_search_first(struct ntvfs_module_context *ntvfs, return NT_STATUS_FOOBAR; } - search->handle = private->next_search_handle; + search->handle = p->next_search_handle; search->dir = dir; if (dir->count < max_count) { @@ -892,8 +892,8 @@ static NTSTATUS cifspsx_search_first(struct ntvfs_module_context *ntvfs, ((io->t2ffirst.in.flags & FLAG_TRANS2_FIND_CLOSE_IF_END) && (i == dir->count))) { talloc_free(search); } else { - private->next_search_handle++; - DLIST_ADD(private->search, search); + p->next_search_handle++; + DLIST_ADD(p->search, search); } return NT_STATUS_OK; @@ -907,7 +907,7 @@ static NTSTATUS cifspsx_search_next(struct ntvfs_module_context *ntvfs, { struct cifspsx_dir *dir; int i; - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct search_state *search; union smb_search_data file; uint_t max_count; @@ -920,7 +920,7 @@ static NTSTATUS cifspsx_search_next(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } - for (search=private->search; search; search = search->next) { + for (search=p->search; search; search = search->next) { if (search->handle == io->t2fnext.in.handle) break; } @@ -984,7 +984,7 @@ found: /* work out if we are going to keep the search state */ if ((io->t2fnext.in.flags & FLAG_TRANS2_FIND_CLOSE) || ((io->t2fnext.in.flags & FLAG_TRANS2_FIND_CLOSE_IF_END) && (i == dir->count))) { - DLIST_REMOVE(private->search, search); + DLIST_REMOVE(p->search, search); talloc_free(search); } @@ -995,10 +995,10 @@ found: static NTSTATUS cifspsx_search_close(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_search_close *io) { - struct cifspsx_private *private = ntvfs->private_data; + struct cifspsx_private *p = ntvfs->private_data; struct search_state *search; - for (search=private->search; search; search = search->next) { + for (search=p->search; search; search = search->next) { if (search->handle == io->findclose.in.handle) break; } @@ -1007,7 +1007,7 @@ static NTSTATUS cifspsx_search_close(struct ntvfs_module_context *ntvfs, return NT_STATUS_FOOBAR; } - DLIST_REMOVE(private->search, search); + DLIST_REMOVE(p->search, search); talloc_free(search); return NT_STATUS_OK; diff --git a/source4/ntvfs/common/opendb.c b/source4/ntvfs/common/opendb.c index cfbb88f90e..12fe7015a7 100644 --- a/source4/ntvfs/common/opendb.c +++ b/source4/ntvfs/common/opendb.c @@ -107,9 +107,9 @@ NTSTATUS odb_open_file(struct odb_lock *lck, /* register a pending open file in the open files database */ -NTSTATUS odb_open_file_pending(struct odb_lock *lck, void *private) +NTSTATUS odb_open_file_pending(struct odb_lock *lck, void *private_data) { - return ops->odb_open_file_pending(lck, private); + return ops->odb_open_file_pending(lck, private_data); } @@ -126,9 +126,9 @@ NTSTATUS odb_close_file(struct odb_lock *lck, void *file_handle, /* remove a pending opendb entry */ -NTSTATUS odb_remove_pending(struct odb_lock *lck, void *private) +NTSTATUS odb_remove_pending(struct odb_lock *lck, void *private_data) { - return ops->odb_remove_pending(lck, private); + return ops->odb_remove_pending(lck, private_data); } diff --git a/source4/ntvfs/common/opendb.h b/source4/ntvfs/common/opendb.h index 179db111ca..446df1777f 100644 --- a/source4/ntvfs/common/opendb.h +++ b/source4/ntvfs/common/opendb.h @@ -30,10 +30,10 @@ struct opendb_ops { int *fd, NTTIME open_write_time, bool allow_level_II_oplock, uint32_t oplock_level, uint32_t *oplock_granted); - NTSTATUS (*odb_open_file_pending)(struct odb_lock *lck, void *private); + NTSTATUS (*odb_open_file_pending)(struct odb_lock *lck, void *private_data); NTSTATUS (*odb_close_file)(struct odb_lock *lck, void *file_handle, const char **delete_path); - NTSTATUS (*odb_remove_pending)(struct odb_lock *lck, void *private); + NTSTATUS (*odb_remove_pending)(struct odb_lock *lck, void *private_data); NTSTATUS (*odb_rename)(struct odb_lock *lck, const char *path); NTSTATUS (*odb_get_path)(struct odb_lock *lck, const char **path); NTSTATUS (*odb_set_delete_on_close)(struct odb_lock *lck, bool del_on_close); diff --git a/source4/ntvfs/common/opendb_tdb.c b/source4/ntvfs/common/opendb_tdb.c index 83da122fe2..8f5d10f902 100644 --- a/source4/ntvfs/common/opendb_tdb.c +++ b/source4/ntvfs/common/opendb_tdb.c @@ -548,7 +548,7 @@ static NTSTATUS odb_tdb_open_file(struct odb_lock *lck, /* register a pending open file in the open files database */ -static NTSTATUS odb_tdb_open_file_pending(struct odb_lock *lck, void *private) +static NTSTATUS odb_tdb_open_file_pending(struct odb_lock *lck, void *private_data) { struct odb_context *odb = lck->odb; @@ -562,7 +562,7 @@ static NTSTATUS odb_tdb_open_file_pending(struct odb_lock *lck, void *private) NT_STATUS_HAVE_NO_MEMORY(lck->file.pending); lck->file.pending[lck->file.num_pending].server = odb->ntvfs_ctx->server_id; - lck->file.pending[lck->file.num_pending].notify_ptr = private; + lck->file.pending[lck->file.num_pending].notify_ptr = private_data; lck->file.num_pending++; @@ -710,7 +710,7 @@ static NTSTATUS odb_tdb_break_oplocks(struct odb_lock *lck) /* remove a pending opendb entry */ -static NTSTATUS odb_tdb_remove_pending(struct odb_lock *lck, void *private) +static NTSTATUS odb_tdb_remove_pending(struct odb_lock *lck, void *private_data) { struct odb_context *odb = lck->odb; int i; @@ -721,7 +721,7 @@ static NTSTATUS odb_tdb_remove_pending(struct odb_lock *lck, void *private) /* find the entry, and delete it */ for (i=0;i<lck->file.num_pending;i++) { - if (private == lck->file.pending[i].notify_ptr && + if (private_data == lck->file.pending[i].notify_ptr && cluster_id_equal(&odb->ntvfs_ctx->server_id, &lck->file.pending[i].server)) { if (i < lck->file.num_pending-1) { memmove(lck->file.pending+i, lck->file.pending+i+1, diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c index df065eb5e2..2bc07c3e7b 100644 --- a/source4/ntvfs/ipc/rap_server.c +++ b/source4/ntvfs/ipc/rap_server.c @@ -21,6 +21,7 @@ #include "includes.h" #include "param/share.h" #include "libcli/rap/rap.h" +#include "libcli/raw/interfaces.h" #include "librpc/gen_ndr/srvsvc.h" #include "rpc_server/common/common.h" #include "param/param.h" diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c index 5a63edcc3e..2f05a86dfa 100644 --- a/source4/ntvfs/ipc/vfs_ipc.c +++ b/source4/ntvfs/ipc/vfs_ipc.c @@ -44,7 +44,7 @@ struct ipc_private { /* a list of open pipes */ struct pipe_state { struct pipe_state *next, *prev; - struct ipc_private *private; + struct ipc_private *ipriv; const char *pipe_name; struct ntvfs_handle *handle; struct dcesrv_connection *dce_conn; @@ -56,12 +56,12 @@ struct ipc_private { /* find a open pipe give a file handle */ -static struct pipe_state *pipe_state_find(struct ipc_private *private, struct ntvfs_handle *handle) +static struct pipe_state *pipe_state_find(struct ipc_private *ipriv, struct ntvfs_handle *handle) { struct pipe_state *s; void *p; - p = ntvfs_handle_get_backend_data(handle, private->ntvfs); + p = ntvfs_handle_get_backend_data(handle, ipriv->ntvfs); if (!p) return NULL; s = talloc_get_type(p, struct pipe_state); @@ -73,14 +73,14 @@ static struct pipe_state *pipe_state_find(struct ipc_private *private, struct nt /* find a open pipe give a wire fnum */ -static struct pipe_state *pipe_state_find_key(struct ipc_private *private, struct ntvfs_request *req, const DATA_BLOB *key) +static struct pipe_state *pipe_state_find_key(struct ipc_private *ipriv, struct ntvfs_request *req, const DATA_BLOB *key) { struct ntvfs_handle *h; - h = ntvfs_handle_search_by_wire_key(private->ntvfs, req, key); + h = ntvfs_handle_search_by_wire_key(ipriv->ntvfs, req, key); if (!h) return NULL; - return pipe_state_find(private, h); + return pipe_state_find(ipriv, h); } @@ -91,7 +91,7 @@ static NTSTATUS ipc_connect(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *sharename) { NTSTATUS status; - struct ipc_private *private; + struct ipc_private *ipriv; ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "IPC"); NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type); @@ -100,16 +100,16 @@ static NTSTATUS ipc_connect(struct ntvfs_module_context *ntvfs, NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type); /* prepare the private state for this connection */ - private = talloc(ntvfs, struct ipc_private); - NT_STATUS_HAVE_NO_MEMORY(private); + ipriv = talloc(ntvfs, struct ipc_private); + NT_STATUS_HAVE_NO_MEMORY(ipriv); - ntvfs->private_data = private; + ntvfs->private_data = ipriv; - private->ntvfs = ntvfs; - private->pipe_list = NULL; + ipriv->ntvfs = ntvfs; + ipriv->pipe_list = NULL; /* setup the DCERPC server subsystem */ - status = dcesrv_init_ipc_context(private, ntvfs->ctx->lp_ctx, &private->dcesrv); + status = dcesrv_init_ipc_context(ipriv, ntvfs->ctx->lp_ctx, &ipriv->dcesrv); NT_STATUS_NOT_OK_RETURN(status); return NT_STATUS_OK; @@ -174,23 +174,23 @@ static NTSTATUS ipc_setpathinfo(struct ntvfs_module_context *ntvfs, */ static int ipc_fd_destructor(struct pipe_state *p) { - DLIST_REMOVE(p->private->pipe_list, p); - ntvfs_handle_remove_backend_data(p->handle, p->private->ntvfs); + DLIST_REMOVE(p->ipriv->pipe_list, p); + ntvfs_handle_remove_backend_data(p->handle, p->ipriv->ntvfs); return 0; } static struct socket_address *ipc_get_my_addr(struct dcesrv_connection *dce_conn, TALLOC_CTX *mem_ctx) { - struct ipc_private *private = dce_conn->transport.private_data; + struct ipc_private *ipriv = dce_conn->transport.private_data; - return ntvfs_get_my_addr(private->ntvfs, mem_ctx); + return ntvfs_get_my_addr(ipriv->ntvfs, mem_ctx); } static struct socket_address *ipc_get_peer_addr(struct dcesrv_connection *dce_conn, TALLOC_CTX *mem_ctx) { - struct ipc_private *private = dce_conn->transport.private_data; + struct ipc_private *ipriv = dce_conn->transport.private_data; - return ntvfs_get_peer_addr(private->ntvfs, mem_ctx); + return ntvfs_get_peer_addr(ipriv->ntvfs, mem_ctx); } /* @@ -203,7 +203,7 @@ static NTSTATUS ipc_open_generic(struct ntvfs_module_context *ntvfs, struct pipe_state *p; NTSTATUS status; struct dcerpc_binding *ep_description; - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; struct ntvfs_handle *h; status = ntvfs_handle_new(ntvfs, req, &h); @@ -235,7 +235,7 @@ static NTSTATUS ipc_open_generic(struct ntvfs_module_context *ntvfs, /* The session info is refcount-increased in the * dcesrv_endpoint_search_connect() function */ - status = dcesrv_endpoint_search_connect(private->dcesrv, + status = dcesrv_endpoint_search_connect(ipriv->dcesrv, p, ep_description, h->session_info, @@ -246,18 +246,18 @@ static NTSTATUS ipc_open_generic(struct ntvfs_module_context *ntvfs, &p->dce_conn); NT_STATUS_NOT_OK_RETURN(status); - p->dce_conn->transport.private_data = private; + p->dce_conn->transport.private_data = ipriv; p->dce_conn->transport.report_output_data = NULL; p->dce_conn->transport.get_my_addr = ipc_get_my_addr; p->dce_conn->transport.get_peer_addr = ipc_get_peer_addr; - DLIST_ADD(private->pipe_list, p); + DLIST_ADD(ipriv->pipe_list, p); - p->private = private; + p->ipriv = ipriv; talloc_set_destructor(p, ipc_fd_destructor); - status = ntvfs_handle_set_backend_data(h, private->ntvfs, p); + status = ntvfs_handle_set_backend_data(h, ipriv->ntvfs, p); NT_STATUS_NOT_OK_RETURN(status); *ps = p; @@ -417,7 +417,7 @@ static NTSTATUS ipc_readx_dcesrv_output(void *private_data, DATA_BLOB *out, size static NTSTATUS ipc_read(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_read *rd) { - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; DATA_BLOB data; struct pipe_state *p; NTSTATUS status = NT_STATUS_OK; @@ -426,7 +426,7 @@ static NTSTATUS ipc_read(struct ntvfs_module_context *ntvfs, return ntvfs_map_read(ntvfs, req, rd); } - p = pipe_state_find(private, rd->readx.in.file.ntvfs); + p = pipe_state_find(ipriv, rd->readx.in.file.ntvfs); if (!p) { return NT_STATUS_INVALID_HANDLE; } @@ -457,7 +457,7 @@ static NTSTATUS ipc_read(struct ntvfs_module_context *ntvfs, static NTSTATUS ipc_write(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_write *wr) { - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; DATA_BLOB data; struct pipe_state *p; NTSTATUS status; @@ -469,7 +469,7 @@ static NTSTATUS ipc_write(struct ntvfs_module_context *ntvfs, data.data = discard_const_p(void, wr->writex.in.data); data.length = wr->writex.in.count; - p = pipe_state_find(private, wr->writex.in.file.ntvfs); + p = pipe_state_find(ipriv, wr->writex.in.file.ntvfs); if (!p) { return NT_STATUS_INVALID_HANDLE; } @@ -511,14 +511,14 @@ static NTSTATUS ipc_flush(struct ntvfs_module_context *ntvfs, static NTSTATUS ipc_close(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_close *io) { - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; struct pipe_state *p; if (io->generic.level != RAW_CLOSE_CLOSE) { return ntvfs_map_close(ntvfs, req, io); } - p = pipe_state_find(private, io->close.in.file.ntvfs); + p = pipe_state_find(ipriv, io->close.in.file.ntvfs); if (!p) { return NT_STATUS_INVALID_HANDLE; } @@ -534,10 +534,10 @@ static NTSTATUS ipc_close(struct ntvfs_module_context *ntvfs, static NTSTATUS ipc_exit(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req) { - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; struct pipe_state *p, *next; - for (p=private->pipe_list; p; p=next) { + for (p=ipriv->pipe_list; p; p=next) { next = p->next; if (p->handle->session_info == req->session_info && p->handle->smbpid == req->smbpid) { @@ -554,10 +554,10 @@ static NTSTATUS ipc_exit(struct ntvfs_module_context *ntvfs, static NTSTATUS ipc_logoff(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req) { - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; struct pipe_state *p, *next; - for (p=private->pipe_list; p; p=next) { + for (p=ipriv->pipe_list; p; p=next) { next = p->next; if (p->handle->session_info == req->session_info) { talloc_free(p); @@ -572,7 +572,7 @@ static NTSTATUS ipc_logoff(struct ntvfs_module_context *ntvfs, */ static NTSTATUS ipc_async_setup(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - void *private) + void *private_data) { return NT_STATUS_OK; } @@ -610,8 +610,8 @@ static NTSTATUS ipc_setfileinfo(struct ntvfs_module_context *ntvfs, static NTSTATUS ipc_qfileinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fileinfo *info) { - struct ipc_private *private = ntvfs->private_data; - struct pipe_state *p = pipe_state_find(private, info->generic.in.file.ntvfs); + struct ipc_private *ipriv = ntvfs->private_data; + struct pipe_state *p = pipe_state_find(ipriv, info->generic.in.file.ntvfs); if (!p) { return NT_STATUS_INVALID_HANDLE; } @@ -717,7 +717,7 @@ static NTSTATUS ipc_dcerpc_cmd(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, struct smb_trans2 *trans) { struct pipe_state *p; - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; NTSTATUS status; DATA_BLOB fnum_key; uint16_t fnum; @@ -731,7 +731,7 @@ static NTSTATUS ipc_dcerpc_cmd(struct ntvfs_module_context *ntvfs, SSVAL(&fnum, 0, trans->in.setup[1]); fnum_key = data_blob_const(&fnum, 2); - p = pipe_state_find_key(private, req, &fnum_key); + p = pipe_state_find_key(ipriv, req, &fnum_key); if (!p) { return NT_STATUS_INVALID_HANDLE; } @@ -772,14 +772,14 @@ static NTSTATUS ipc_dcerpc_cmd(struct ntvfs_module_context *ntvfs, static NTSTATUS ipc_set_nm_pipe_state(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, struct smb_trans2 *trans) { - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; struct pipe_state *p; DATA_BLOB fnum_key; /* the fnum is in setup[1] */ fnum_key = data_blob_const(&trans->in.setup[1], sizeof(trans->in.setup[1])); - p = pipe_state_find_key(private, req, &fnum_key); + p = pipe_state_find_key(ipriv, req, &fnum_key); if (!p) { return NT_STATUS_INVALID_HANDLE; } @@ -830,7 +830,7 @@ static NTSTATUS ipc_ioctl_smb2(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_ioctl *io) { struct pipe_state *p; - struct ipc_private *private = ntvfs->private_data; + struct ipc_private *ipriv = ntvfs->private_data; NTSTATUS status; switch (io->smb2.in.function) { @@ -841,7 +841,7 @@ static NTSTATUS ipc_ioctl_smb2(struct ntvfs_module_context *ntvfs, return NT_STATUS_FS_DRIVER_REQUIRED; } - p = pipe_state_find(private, io->smb2.in.file.ntvfs); + p = pipe_state_find(ipriv, io->smb2.in.file.ntvfs); if (!p) { return NT_STATUS_INVALID_HANDLE; } diff --git a/source4/ntvfs/nbench/vfs_nbench.c b/source4/ntvfs/nbench/vfs_nbench.c index 987227a0b7..7ba2e7c649 100644 --- a/source4/ntvfs/nbench/vfs_nbench.c +++ b/source4/ntvfs/nbench/vfs_nbench.c @@ -41,7 +41,7 @@ static void nbench_log(struct ntvfs_request *req, static void nbench_log(struct ntvfs_request *req, const char *format, ...) { - struct nbench_private *private = req->async_states->ntvfs->private_data; + struct nbench_private *nprivates = req->async_states->ntvfs->private_data; va_list ap; char *s = NULL; @@ -49,7 +49,7 @@ static void nbench_log(struct ntvfs_request *req, vasprintf(&s, format, ap); va_end(ap); - write(private->log_fd, s, strlen(s)); + write(nprivates->log_fd, s, strlen(s)); free(s); } @@ -671,11 +671,11 @@ static void nbench_async_setup_send(struct ntvfs_request *req) */ static NTSTATUS nbench_async_setup(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - void *private) + void *private_data) { NTSTATUS status; - PASS_THRU_REQ(ntvfs, req, async_setup, NULL, (ntvfs, req, private)); + PASS_THRU_REQ(ntvfs, req, async_setup, NULL, (ntvfs, req, private_data)); return status; } diff --git a/source4/ntvfs/ntvfs.h b/source4/ntvfs/ntvfs.h index 5e86030efa..b62595967f 100644 --- a/source4/ntvfs/ntvfs.h +++ b/source4/ntvfs/ntvfs.h @@ -55,7 +55,7 @@ struct ntvfs_ops { /* 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); + void *private_data); /* filesystem operations */ NTSTATUS (*fsinfo)(struct ntvfs_module_context *ntvfs, @@ -94,12 +94,12 @@ struct ntvfs_ops { /* directory search */ NTSTATUS (*search_first)(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - union smb_search_first *io, void *private, - bool (*callback)(void *private, const union smb_search_data *file)); + union smb_search_first *io, void *private_data, + bool (*callback)(void *private_data, const union smb_search_data *file)); NTSTATUS (*search_next)(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - union smb_search_next *io, void *private, - bool (*callback)(void *private, const union smb_search_data *file)); + union smb_search_next *io, void *private_data, + bool (*callback)(void *private_data, const union smb_search_data *file)); NTSTATUS (*search_close)(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_search_close *io); diff --git a/source4/ntvfs/ntvfs_interface.c b/source4/ntvfs/ntvfs_interface.c index c348558fca..6d3fe55c06 100644 --- a/source4/ntvfs/ntvfs_interface.c +++ b/source4/ntvfs/ntvfs_interface.c @@ -46,13 +46,13 @@ NTSTATUS ntvfs_disconnect(struct ntvfs_context *ntvfs_ctx) /* async setup - called by a backend that wants to setup any state for a async request */ -NTSTATUS ntvfs_async_setup(struct ntvfs_request *req, void *private) +NTSTATUS ntvfs_async_setup(struct ntvfs_request *req, void *private_data) { struct ntvfs_module_context *ntvfs = req->ctx->modules; if (!ntvfs->ops->async_setup) { return NT_STATUS_NOT_IMPLEMENTED; } - return ntvfs->ops->async_setup(ntvfs, req, private); + return ntvfs->ops->async_setup(ntvfs, req, private_data); } /* filesystem operations */ @@ -148,24 +148,24 @@ NTSTATUS ntvfs_copy(struct ntvfs_request *req, struct smb_copy *cp) } /* directory search */ -NTSTATUS ntvfs_search_first(struct ntvfs_request *req, union smb_search_first *io, void *private, - bool ntvfs_callback(void *private, const union smb_search_data *file)) +NTSTATUS ntvfs_search_first(struct ntvfs_request *req, union smb_search_first *io, void *private_data, + bool ntvfs_callback(void *private_data, const union smb_search_data *file)) { struct ntvfs_module_context *ntvfs = req->ctx->modules; if (!ntvfs->ops->search_first) { return NT_STATUS_NOT_IMPLEMENTED; } - return ntvfs->ops->search_first(ntvfs, req, io, private, ntvfs_callback); + return ntvfs->ops->search_first(ntvfs, req, io, private_data, ntvfs_callback); } -NTSTATUS ntvfs_search_next(struct ntvfs_request *req, union smb_search_next *io, void *private, - bool ntvfs_callback(void *private, const union smb_search_data *file)) +NTSTATUS ntvfs_search_next(struct ntvfs_request *req, union smb_search_next *io, void *private_data, + bool ntvfs_callback(void *private_data, const union smb_search_data *file)) { struct ntvfs_module_context *ntvfs = req->ctx->modules; if (!ntvfs->ops->search_next) { return NT_STATUS_NOT_IMPLEMENTED; } - return ntvfs->ops->search_next(ntvfs, req, io, private, ntvfs_callback); + return ntvfs->ops->search_next(ntvfs, req, io, private_data, ntvfs_callback); } NTSTATUS ntvfs_search_close(struct ntvfs_request *req, union smb_search_close *io) @@ -354,12 +354,12 @@ NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs) /* async_setup - called when setting up for a async request */ NTSTATUS ntvfs_next_async_setup(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - void *private) + void *private_data) { if (!ntvfs->next || !ntvfs->next->ops->async_setup) { return NT_STATUS_NOT_IMPLEMENTED; } - return ntvfs->next->ops->async_setup(ntvfs->next, req, private); + return ntvfs->next->ops->async_setup(ntvfs->next, req, private_data); } /* filesystem operations */ @@ -468,24 +468,24 @@ NTSTATUS ntvfs_next_open(struct ntvfs_module_context *ntvfs, /* directory search */ NTSTATUS ntvfs_next_search_first(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - union smb_search_first *io, void *private, - bool (*callback)(void *private, const union smb_search_data *file)) + union smb_search_first *io, void *private_data, + bool (*callback)(void *private_data, const union smb_search_data *file)) { if (!ntvfs->next || !ntvfs->next->ops->search_first) { return NT_STATUS_NOT_IMPLEMENTED; } - return ntvfs->next->ops->search_first(ntvfs->next, req, io, private, callback); + return ntvfs->next->ops->search_first(ntvfs->next, req, io, private_data, callback); } NTSTATUS ntvfs_next_search_next(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - union smb_search_next *io, void *private, - bool (*callback)(void *private, const union smb_search_data *file)) + union smb_search_next *io, void *private_data, + bool (*callback)(void *private_data, const union smb_search_data *file)) { if (!ntvfs->next || !ntvfs->next->ops->search_next) { return NT_STATUS_NOT_IMPLEMENTED; } - return ntvfs->next->ops->search_next(ntvfs->next, req, io, private, callback); + return ntvfs->next->ops->search_next(ntvfs->next, req, io, private_data, callback); } NTSTATUS ntvfs_next_search_close(struct ntvfs_module_context *ntvfs, diff --git a/source4/ntvfs/posix/pvfs_aio.c b/source4/ntvfs/posix/pvfs_aio.c index 7a090e214a..56566e3592 100644 --- a/source4/ntvfs/posix/pvfs_aio.c +++ b/source4/ntvfs/posix/pvfs_aio.c @@ -42,9 +42,9 @@ struct pvfs_aio_write_state { called when an aio read has finished */ static void pvfs_aio_read_handler(struct tevent_context *ev, struct tevent_aio *ae, - int ret, void *private) + int ret, void *private_data) { - struct pvfs_aio_read_state *state = talloc_get_type(private, + struct pvfs_aio_read_state *state = talloc_get_type(private_data, struct pvfs_aio_read_state); struct pvfs_file *f = state->f; union smb_read *rd = state->rd; @@ -107,9 +107,9 @@ NTSTATUS pvfs_aio_pread(struct ntvfs_request *req, union smb_read *rd, called when an aio write has finished */ static void pvfs_aio_write_handler(struct tevent_context *ev, struct tevent_aio *ae, - int ret, void *private) + int ret, void *private_data) { - struct pvfs_aio_write_state *state = talloc_get_type(private, + struct pvfs_aio_write_state *state = talloc_get_type(private_data, struct pvfs_aio_write_state); struct pvfs_file *f = state->f; union smb_write *wr = state->wr; diff --git a/source4/ntvfs/posix/pvfs_lock.c b/source4/ntvfs/posix/pvfs_lock.c index 173b2fe187..2353baeff4 100644 --- a/source4/ntvfs/posix/pvfs_lock.c +++ b/source4/ntvfs/posix/pvfs_lock.c @@ -88,9 +88,9 @@ static void pvfs_lock_async_failed(struct pvfs_state *pvfs, range, so we should try the lock again. Note that on timeout we do retry the lock, giving it a last chance. */ -static void pvfs_pending_lock_continue(void *private, enum pvfs_wait_notice reason) +static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice reason) { - struct pvfs_pending_lock *pending = private; + struct pvfs_pending_lock *pending = private_data; struct pvfs_state *pvfs = pending->pvfs; struct pvfs_file *f = pending->f; struct ntvfs_request *req = pending->req; diff --git a/source4/ntvfs/posix/pvfs_notify.c b/source4/ntvfs/posix/pvfs_notify.c index 8224d36b7d..09aa0f64e6 100644 --- a/source4/ntvfs/posix/pvfs_notify.c +++ b/source4/ntvfs/posix/pvfs_notify.c @@ -126,9 +126,9 @@ static int pvfs_notify_destructor(struct pvfs_notify_buffer *n) /* called when a async notify event comes in */ -static void pvfs_notify_callback(void *private, const struct notify_event *ev) +static void pvfs_notify_callback(void *private_data, const struct notify_event *ev) { - struct pvfs_notify_buffer *n = talloc_get_type(private, struct pvfs_notify_buffer); + struct pvfs_notify_buffer *n = talloc_get_type(private_data, struct pvfs_notify_buffer); size_t len; struct notify_changes *n2; char *new_path; @@ -201,9 +201,9 @@ static NTSTATUS pvfs_notify_setup(struct pvfs_state *pvfs, struct pvfs_file *f, called from the pvfs_wait code when either an event has come in, or the notify request has been cancelled */ -static void pvfs_notify_end(void *private, enum pvfs_wait_notice reason) +static void pvfs_notify_end(void *private_data, enum pvfs_wait_notice reason) { - struct pvfs_notify_buffer *notify_buffer = talloc_get_type(private, + struct pvfs_notify_buffer *notify_buffer = talloc_get_type(private_data, struct pvfs_notify_buffer); if (reason == PVFS_WAIT_CANCEL) { pvfs_notify_send(notify_buffer, NT_STATUS_CANCELLED, false); diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 601c876cfb..6b0f32e65a 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -28,7 +28,6 @@ #include "librpc/gen_ndr/security.h" #include "../tdb/include/tdb.h" #include "tdb_wrap.h" -#include "../lib/util/util_ldb.h" #include "libcli/security/security.h" #include "lib/events/events.h" #include "param/param.h" diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h index 342d28325e..b032ab3f93 100644 --- a/source4/ntvfs/posix/vfs_posix.h +++ b/source4/ntvfs/posix/vfs_posix.h @@ -27,7 +27,7 @@ #include "ntvfs/ntvfs.h" #include "ntvfs/common/ntvfs_common.h" #include "libcli/wbclient/wbclient.h" -#include "dsdb/samdb/samdb.h" +#include "lib/events/events.h" struct pvfs_wait; struct pvfs_oplock; diff --git a/source4/ntvfs/simple/svfs_util.c b/source4/ntvfs/simple/svfs_util.c index a0cdbe9c39..f7f011572a 100644 --- a/source4/ntvfs/simple/svfs_util.c +++ b/source4/ntvfs/simple/svfs_util.c @@ -36,17 +36,17 @@ char *svfs_unix_path(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *name) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; char *ret; if (*name != '\\') { - ret = talloc_asprintf(req, "%s/%s", private->connectpath, name); + ret = talloc_asprintf(req, "%s/%s", p->connectpath, name); } else { - ret = talloc_asprintf(req, "%s%s", private->connectpath, name); + ret = talloc_asprintf(req, "%s%s", p->connectpath, name); } all_string_sub(ret, "\\", "/", 0); - strlower(ret + strlen(private->connectpath)); + strlower(ret + strlen(p->connectpath)); return ret; } @@ -142,13 +142,13 @@ struct svfs_dir *svfs_list_unix(TALLOC_CTX *mem_ctx, struct ntvfs_request *req, */ struct svfs_dir *svfs_list(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *pattern) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; char *unix_path; unix_path = svfs_unix_path(ntvfs, req, pattern); if (!unix_path) { return NULL; } - return svfs_list_unix(private, req, unix_path); + return svfs_list_unix(p, req, unix_path); } diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c index 5d904b4fcb..bf0afcec0a 100644 --- a/source4/ntvfs/simple/vfs_simple.c +++ b/source4/ntvfs/simple/vfs_simple.c @@ -50,21 +50,21 @@ static NTSTATUS svfs_connect(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *sharename) { struct stat st; - struct svfs_private *private; + struct svfs_private *p; struct share_config *scfg = ntvfs->ctx->config; - private = talloc(ntvfs, struct svfs_private); - NT_STATUS_HAVE_NO_MEMORY(private); - private->ntvfs = ntvfs; - private->next_search_handle = 0; - private->connectpath = talloc_strdup(private, share_string_option(scfg, SHARE_PATH, "")); - private->open_files = NULL; - private->search = NULL; + p = talloc(ntvfs, struct svfs_private); + NT_STATUS_HAVE_NO_MEMORY(p); + p->ntvfs = ntvfs; + p->next_search_handle = 0; + p->connectpath = talloc_strdup(p, share_string_option(scfg, SHARE_PATH, "")); + p->open_files = NULL; + p->search = NULL; /* the directory must exist */ - if (stat(private->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) { + if (stat(p->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) { DEBUG(0,("'%s' is not a directory, when connecting to [%s]\n", - private->connectpath, sharename)); + p->connectpath, sharename)); return NT_STATUS_BAD_NETWORK_NAME; } @@ -73,7 +73,7 @@ static NTSTATUS svfs_connect(struct ntvfs_module_context *ntvfs, ntvfs->ctx->dev_type = talloc_strdup(ntvfs->ctx, "A:"); NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type); - ntvfs->private_data = private; + ntvfs->private_data = p; return NT_STATUS_OK; } @@ -89,12 +89,12 @@ static NTSTATUS svfs_disconnect(struct ntvfs_module_context *ntvfs) /* find open file handle given fd */ -static struct svfs_file *find_fd(struct svfs_private *private, struct ntvfs_handle *handle) +static struct svfs_file *find_fd(struct svfs_private *sp, struct ntvfs_handle *handle) { struct svfs_file *f; void *p; - p = ntvfs_handle_get_backend_data(handle, private->ntvfs); + p = ntvfs_handle_get_backend_data(handle, sp->ntvfs); if (!p) return NULL; f = talloc_get_type(p, struct svfs_file); @@ -275,7 +275,7 @@ static NTSTATUS svfs_qpathinfo(struct ntvfs_module_context *ntvfs, static NTSTATUS svfs_qfileinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fileinfo *info) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct svfs_file *f; struct stat st; @@ -283,7 +283,7 @@ static NTSTATUS svfs_qfileinfo(struct ntvfs_module_context *ntvfs, return ntvfs_map_qfileinfo(ntvfs, req, info); } - f = find_fd(private, info->generic.in.file.ntvfs); + f = find_fd(p, info->generic.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -302,7 +302,7 @@ static NTSTATUS svfs_qfileinfo(struct ntvfs_module_context *ntvfs, static NTSTATUS svfs_open(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_open *io) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; char *unix_path; struct stat st; int fd, flags; @@ -391,7 +391,7 @@ do_open: f->name = talloc_strdup(f, unix_path); NT_STATUS_HAVE_NO_MEMORY(f->name); - DLIST_ADD(private->open_files, f); + DLIST_ADD(p->open_files, f); status = ntvfs_handle_set_backend_data(handle, ntvfs, f); NT_STATUS_NOT_OK_RETURN(status); @@ -492,7 +492,7 @@ static NTSTATUS svfs_copy(struct ntvfs_module_context *ntvfs, static NTSTATUS svfs_read(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_read *rd) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct svfs_file *f; ssize_t ret; @@ -500,7 +500,7 @@ static NTSTATUS svfs_read(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } - f = find_fd(private, rd->readx.in.file.ntvfs); + f = find_fd(p, rd->readx.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -526,7 +526,7 @@ static NTSTATUS svfs_read(struct ntvfs_module_context *ntvfs, static NTSTATUS svfs_write(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_write *wr) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct svfs_file *f; ssize_t ret; @@ -536,7 +536,7 @@ static NTSTATUS svfs_write(struct ntvfs_module_context *ntvfs, CHECK_READ_ONLY(req); - f = find_fd(private, wr->writex.in.file.ntvfs); + f = find_fd(p, wr->writex.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -572,14 +572,14 @@ static NTSTATUS svfs_flush(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_flush *io) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct svfs_file *f; switch (io->generic.level) { case RAW_FLUSH_FLUSH: case RAW_FLUSH_SMB2: /* ignore the additional unknown option in SMB2 */ - f = find_fd(private, io->generic.in.file.ntvfs); + f = find_fd(p, io->generic.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -587,7 +587,7 @@ static NTSTATUS svfs_flush(struct ntvfs_module_context *ntvfs, return NT_STATUS_OK; case RAW_FLUSH_ALL: - for (f=private->open_files;f;f=f->next) { + for (f=p->open_files;f;f=f->next) { fsync(f->fd); } return NT_STATUS_OK; @@ -603,7 +603,7 @@ static NTSTATUS svfs_close(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_close *io) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct svfs_file *f; if (io->generic.level != RAW_CLOSE_CLOSE) { @@ -611,7 +611,7 @@ static NTSTATUS svfs_close(struct ntvfs_module_context *ntvfs, return NT_STATUS_INVALID_LEVEL; } - f = find_fd(private, io->close.in.file.ntvfs); + f = find_fd(p, io->close.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -620,7 +620,7 @@ static NTSTATUS svfs_close(struct ntvfs_module_context *ntvfs, return map_nt_error_from_unix(errno); } - DLIST_REMOVE(private->open_files, f); + DLIST_REMOVE(p->open_files, f); talloc_free(f->name); talloc_free(f); @@ -650,7 +650,7 @@ static NTSTATUS svfs_logoff(struct ntvfs_module_context *ntvfs, */ static NTSTATUS svfs_async_setup(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - void *private) + void *private_data) { return NT_STATUS_OK; } @@ -691,13 +691,13 @@ static NTSTATUS svfs_setfileinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_setfileinfo *info) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct svfs_file *f; struct utimbuf unix_times; CHECK_READ_ONLY(req); - f = find_fd(private, info->generic.in.file.ntvfs); + f = find_fd(p, info->generic.in.file.ntvfs); if (!f) { return NT_STATUS_INVALID_HANDLE; } @@ -743,14 +743,14 @@ static NTSTATUS svfs_setfileinfo(struct ntvfs_module_context *ntvfs, static NTSTATUS svfs_fsinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fsinfo *fs) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct stat st; if (fs->generic.level != RAW_QFS_GENERIC) { return ntvfs_map_fsinfo(ntvfs, req, fs); } - if (sys_fsusage(private->connectpath, + if (sys_fsusage(p->connectpath, &fs->generic.out.blocks_free, &fs->generic.out.blocks_total) == -1) { return map_nt_error_from_unix(errno); @@ -758,7 +758,7 @@ static NTSTATUS svfs_fsinfo(struct ntvfs_module_context *ntvfs, fs->generic.out.block_size = 512; - if (stat(private->connectpath, &st) != 0) { + if (stat(p->connectpath, &st) != 0) { return NT_STATUS_DISK_CORRUPT_ERROR; } @@ -786,13 +786,13 @@ static NTSTATUS svfs_fsattr(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fsattr *fs) { struct stat st; - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; if (fs->generic.level != RAW_FSATTR_GENERIC) { return ntvfs_map_fsattr(ntvfs, req, fs); } - if (stat(private->connectpath, &st) == -1) { + if (stat(p->connectpath, &st) == -1) { return map_nt_error_from_unix(errno); } @@ -830,7 +830,7 @@ static NTSTATUS svfs_search_first(struct ntvfs_module_context *ntvfs, { struct svfs_dir *dir; int i; - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct search_state *search; union smb_search_data file; uint_t max_count; @@ -843,7 +843,7 @@ static NTSTATUS svfs_search_first(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } - search = talloc_zero(private, struct search_state); + search = talloc_zero(p, struct search_state); if (!search) { return NT_STATUS_NO_MEMORY; } @@ -855,7 +855,7 @@ static NTSTATUS svfs_search_first(struct ntvfs_module_context *ntvfs, return NT_STATUS_FOOBAR; } - search->handle = private->next_search_handle; + search->handle = p->next_search_handle; search->dir = dir; if (dir->count < max_count) { @@ -889,8 +889,8 @@ static NTSTATUS svfs_search_first(struct ntvfs_module_context *ntvfs, ((io->t2ffirst.in.flags & FLAG_TRANS2_FIND_CLOSE_IF_END) && (i == dir->count))) { talloc_free(search); } else { - private->next_search_handle++; - DLIST_ADD(private->search, search); + p->next_search_handle++; + DLIST_ADD(p->search, search); } return NT_STATUS_OK; @@ -904,7 +904,7 @@ static NTSTATUS svfs_search_next(struct ntvfs_module_context *ntvfs, { struct svfs_dir *dir; int i; - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct search_state *search; union smb_search_data file; uint_t max_count; @@ -917,7 +917,7 @@ static NTSTATUS svfs_search_next(struct ntvfs_module_context *ntvfs, return NT_STATUS_NOT_SUPPORTED; } - for (search=private->search; search; search = search->next) { + for (search=p->search; search; search = search->next) { if (search->handle == io->t2fnext.in.handle) break; } @@ -981,7 +981,7 @@ found: /* work out if we are going to keep the search state */ if ((io->t2fnext.in.flags & FLAG_TRANS2_FIND_CLOSE) || ((io->t2fnext.in.flags & FLAG_TRANS2_FIND_CLOSE_IF_END) && (i == dir->count))) { - DLIST_REMOVE(private->search, search); + DLIST_REMOVE(p->search, search); talloc_free(search); } @@ -992,10 +992,10 @@ found: static NTSTATUS svfs_search_close(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_search_close *io) { - struct svfs_private *private = ntvfs->private_data; + struct svfs_private *p = ntvfs->private_data; struct search_state *search; - for (search=private->search; search; search = search->next) { + for (search=p->search; search; search = search->next) { if (search->handle == io->findclose.in.handle) break; } @@ -1004,7 +1004,7 @@ static NTSTATUS svfs_search_close(struct ntvfs_module_context *ntvfs, return NT_STATUS_FOOBAR; } - DLIST_REMOVE(private->search, search); + DLIST_REMOVE(p->search, search); talloc_free(search); return NT_STATUS_OK; diff --git a/source4/ntvfs/smb2/vfs_smb2.c b/source4/ntvfs/smb2/vfs_smb2.c index ebb17e2806..d1e194f638 100644 --- a/source4/ntvfs/smb2/vfs_smb2.c +++ b/source4/ntvfs/smb2/vfs_smb2.c @@ -100,12 +100,12 @@ struct async_info { */ static bool oplock_handler(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *p_private) { - struct cvfs_private *private = p_private; + struct cvfs_private *p = p_private; NTSTATUS status; struct ntvfs_handle *h = NULL; struct cvfs_file *f; - for (f=private->files; f; f=f->next) { + for (f=p->files; f; f=f->next) { if (f->fnum != fnum) continue; h = f->h; break; @@ -117,7 +117,7 @@ static bool oplock_handler(struct smbcli_transport *transport, uint16_t tid, uin } DEBUG(5,("vfs_smb2: sending oplock break level %d for fnum %d\n", level, fnum)); - status = ntvfs_send_oplock_break(private->ntvfs, h, level); + status = ntvfs_send_oplock_break(p->ntvfs, h, level); if (!NT_STATUS_IS_OK(status)) return false; return true; } @@ -157,7 +157,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *sharename) { NTSTATUS status; - struct cvfs_private *private; + struct cvfs_private *p; const char *host, *user, *pass, *domain, *remote_share; struct composite_context *creq; struct share_config *scfg = ntvfs->ctx->config; @@ -181,12 +181,12 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, machine_account = share_bool_option(scfg, SMB2_USE_MACHINE_ACCT, SMB2_USE_MACHINE_ACCT_DEFAULT); - private = talloc_zero(ntvfs, struct cvfs_private); - if (!private) { + p = talloc_zero(ntvfs, struct cvfs_private); + if (!p) { return NT_STATUS_NO_MEMORY; } - ntvfs->private_data = private; + ntvfs->private_data = p; if (!host) { DEBUG(1,("CIFS backend: You must supply server\n")); @@ -195,7 +195,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, if (user && pass) { DEBUG(5, ("CIFS backend: Using specified password\n")); - credentials = cli_credentials_init(private); + credentials = cli_credentials_init(p); if (!credentials) { return NT_STATUS_NO_MEMORY; } @@ -207,7 +207,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, cli_credentials_set_password(credentials, pass, CRED_SPECIFIED); } else if (machine_account) { DEBUG(5, ("CIFS backend: Using machine account\n")); - credentials = cli_credentials_init(private); + credentials = cli_credentials_init(p); cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx); if (domain) { cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED); @@ -226,25 +226,25 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, lp_smbcli_options(ntvfs->ctx->lp_ctx, &options); - creq = smb2_connect_send(private, host, - lp_parm_string_list(private, ntvfs->ctx->lp_ctx, NULL, "smb2", "ports", NULL), + creq = smb2_connect_send(p, host, + lp_parm_string_list(p, ntvfs->ctx->lp_ctx, NULL, "smb2", "ports", NULL), remote_share, lp_resolve_context(ntvfs->ctx->lp_ctx), credentials, ntvfs->ctx->event_ctx, &options, lp_socket_options(ntvfs->ctx->lp_ctx), - lp_gensec_settings(private, ntvfs->ctx->lp_ctx) + lp_gensec_settings(p, ntvfs->ctx->lp_ctx) ); - status = smb2_connect_recv(creq, private, &tree); + status = smb2_connect_recv(creq, p, &tree); NT_STATUS_NOT_OK_RETURN(status); - status = smb2_get_roothandle(tree, &private->roothandle); + status = smb2_get_roothandle(tree, &p->roothandle); NT_STATUS_NOT_OK_RETURN(status); - private->tree = tree; - private->transport = private->tree->session->transport; - private->ntvfs = ntvfs; + p->tree = tree; + p->transport = p->tree->session->transport; + p->ntvfs = ntvfs; ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "NTFS"); NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type); @@ -253,7 +253,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, /* we need to receive oplock break requests from the server */ /* TODO: enable oplocks - smbcli_oplock_handler(private->transport, oplock_handler, private); + smbcli_oplock_handler(p->transport, oplock_handler, p); */ return NT_STATUS_OK; } @@ -263,17 +263,17 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs, */ static NTSTATUS cvfs_disconnect(struct ntvfs_module_context *ntvfs) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct async_info *a, *an; /* first cleanup pending requests */ - for (a=private->pending; a; a = an) { + for (a=p->pending; a; a = an) { an = a->next; talloc_free(a->c_req); talloc_free(a); } - talloc_free(private); + talloc_free(p); ntvfs->private_data = NULL; return NT_STATUS_OK; @@ -330,9 +330,9 @@ static void async_simple_composite(struct composite_context *c_req) async->parms = io; \ async->req = req; \ async->f = file; \ - async->cvfs = private; \ + async->cvfs = p; \ async->c_req = c_req; \ - DLIST_ADD(private->pending, async); \ + DLIST_ADD(p->pending, async); \ c_req->async.private_data = async; \ talloc_set_destructor(async, async_info_destructor); \ } \ @@ -364,12 +364,12 @@ static void async_simple_composite(struct composite_context *c_req) static NTSTATUS cvfs_unlink(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_unlink *unl) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct composite_context *c_req; CHECK_ASYNC(req); - c_req = smb2_composite_unlink_send(private->tree, unl); + c_req = smb2_composite_unlink_send(p->tree, unl); SIMPLE_COMPOSITE_TAIL; } @@ -389,7 +389,7 @@ static NTSTATUS cvfs_ioctl(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_chkpath *cp) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smb2_request *c_req; struct smb2_find f; @@ -400,7 +400,7 @@ static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs, find call, using the roothandle we established at connect time */ ZERO_STRUCT(f); - f.in.file.handle = private->roothandle; + f.in.file.handle = p->roothandle; f.in.level = SMB2_FIND_DIRECTORY_INFO; f.in.pattern = cp->chkpath.in.path; /* SMB2 find doesn't accept \ or the empty string - this is the best @@ -412,7 +412,7 @@ static NTSTATUS cvfs_chkpath(struct ntvfs_module_context *ntvfs, f.in.continue_flags = SMB2_CONTINUE_FLAG_SINGLE | SMB2_CONTINUE_FLAG_RESTART; f.in.max_response_size = 0x1000; - c_req = smb2_find_send(private->tree, &f); + c_req = smb2_find_send(p->tree, &f); SIMPLE_ASYNC_TAIL; } @@ -461,12 +461,12 @@ static NTSTATUS cvfs_open(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_mkdir(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_mkdir *md) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct composite_context *c_req; CHECK_ASYNC(req); - c_req = smb2_composite_mkdir_send(private->tree, md); + c_req = smb2_composite_mkdir_send(p->tree, md); SIMPLE_COMPOSITE_TAIL; } @@ -477,12 +477,12 @@ static NTSTATUS cvfs_mkdir(struct ntvfs_module_context *ntvfs, static NTSTATUS cvfs_rmdir(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, struct smb_rmdir *rd) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct composite_context *c_req; CHECK_ASYNC(req); - c_req = smb2_composite_rmdir_send(private->tree, rd); + c_req = smb2_composite_rmdir_send(p->tree, rd); SIMPLE_COMPOSITE_TAIL; } @@ -576,7 +576,7 @@ static NTSTATUS cvfs_logoff(struct ntvfs_module_context *ntvfs, */ static NTSTATUS cvfs_async_setup(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - void *private) + void *private_data) { return NT_STATUS_OK; } @@ -628,7 +628,7 @@ static void async_fsinfo(struct smb2_request *c_req) static NTSTATUS cvfs_fsinfo(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, union smb_fsinfo *fs) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smb2_request *c_req; enum smb_fsinfo_level level = fs->generic.level; @@ -667,9 +667,9 @@ static NTSTATUS cvfs_fsinfo(struct ntvfs_module_context *ntvfs, } fs->generic.level = level; - fs->generic.handle = private->roothandle; + fs->generic.handle = p->roothandle; - c_req = smb2_getinfo_fs_send(private->tree, fs); + c_req = smb2_getinfo_fs_send(p->tree, fs); ASYNC_RECV_TAIL(fs, async_fsinfo); } @@ -691,7 +691,7 @@ static NTSTATUS cvfs_search_first(struct ntvfs_module_context *ntvfs, void *search_private, bool (*callback)(void *, const union smb_search_data *)) { - struct cvfs_private *private = ntvfs->private_data; + struct cvfs_private *p = ntvfs->private_data; struct smb2_find f; enum smb_search_data_level smb2_level; uint_t count, i; @@ -733,7 +733,7 @@ static NTSTATUS cvfs_search_first(struct ntvfs_module_context *ntvfs, distinguish multiple searches happening at once */ ZERO_STRUCT(f); - f.in.file.handle = private->roothandle; + f.in.file.handle = p->roothandle; f.in.level = smb2_level; f.in.pattern = io->t2ffirst.in.pattern; while (f.in.pattern[0] == '\\') { @@ -742,7 +742,7 @@ static NTSTATUS cvfs_search_first(struct ntvfs_module_context *ntvfs, f.in.continue_flags = 0; f.in.max_response_size = 0x10000; - status = smb2_find_level(private->tree, req, &f, &count, &data); + status = smb2_find_level(p->tree, req, &f, &count, &data); NT_STATUS_NOT_OK_RETURN(status); for (i=0;i<count;i++) { diff --git a/source4/ntvfs/unixuid/vfs_unixuid.c b/source4/ntvfs/unixuid/vfs_unixuid.c index 448d610819..db22a85492 100644 --- a/source4/ntvfs/unixuid/vfs_unixuid.c +++ b/source4/ntvfs/unixuid/vfs_unixuid.c @@ -170,7 +170,7 @@ static NTSTATUS nt_token_to_unix_security(struct ntvfs_module_context *ntvfs, static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, struct unix_sec_ctx **sec) { - struct unixuid_private *private = ntvfs->private_data; + struct unixuid_private *priv = ntvfs->private_data; struct security_token *token; struct unix_sec_ctx *newsec; NTSTATUS status; @@ -186,20 +186,20 @@ static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs, return NT_STATUS_NO_MEMORY; } - if (token == private->last_token) { - newsec = private->last_sec_ctx; + if (token == priv->last_token) { + newsec = priv->last_sec_ctx; } else { status = nt_token_to_unix_security(ntvfs, req, token, &newsec); if (!NT_STATUS_IS_OK(status)) { talloc_free(*sec); return status; } - if (private->last_sec_ctx) { - talloc_free(private->last_sec_ctx); + if (priv->last_sec_ctx) { + talloc_free(priv->last_sec_ctx); } - private->last_sec_ctx = newsec; - private->last_token = token; - talloc_steal(private, newsec); + priv->last_sec_ctx = newsec; + priv->last_token = token; + talloc_steal(priv, newsec); } status = set_unix_security(newsec); @@ -233,24 +233,24 @@ static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs, static NTSTATUS unixuid_connect(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, const char *sharename) { - struct unixuid_private *private; + struct unixuid_private *priv; NTSTATUS status; - private = talloc(ntvfs, struct unixuid_private); - if (!private) { + priv = talloc(ntvfs, struct unixuid_private); + if (!priv) { return NT_STATUS_NO_MEMORY; } - private->wbc_ctx = wbc_init(private, ntvfs->ctx->msg_ctx, + priv->wbc_ctx = wbc_init(priv, ntvfs->ctx->msg_ctx, ntvfs->ctx->event_ctx); - if (private->wbc_ctx == NULL) { - talloc_free(private); + if (priv->wbc_ctx == NULL) { + talloc_free(priv); return NT_STATUS_INTERNAL_ERROR; } - ntvfs->private_data = private; - private->last_sec_ctx = NULL; - private->last_token = NULL; + ntvfs->private_data = priv; + priv->last_sec_ctx = NULL; + priv->last_token = NULL; /* we don't use PASS_THRU_REQ here, as the connect operation runs with root privileges. This allows the backends to setup any database @@ -265,10 +265,10 @@ static NTSTATUS unixuid_connect(struct ntvfs_module_context *ntvfs, */ static NTSTATUS unixuid_disconnect(struct ntvfs_module_context *ntvfs) { - struct unixuid_private *private = ntvfs->private_data; + struct unixuid_private *priv = ntvfs->private_data; NTSTATUS status; - talloc_free(private); + talloc_free(priv); ntvfs->private_data = NULL; status = ntvfs_next_disconnect(ntvfs); @@ -509,12 +509,12 @@ static NTSTATUS unixuid_exit(struct ntvfs_module_context *ntvfs, static NTSTATUS unixuid_logoff(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req) { - struct unixuid_private *private = ntvfs->private_data; + struct unixuid_private *priv = ntvfs->private_data; NTSTATUS status; PASS_THRU_REQ(ntvfs, req, logoff, (ntvfs, req)); - private->last_token = NULL; + priv->last_token = NULL; return status; } @@ -524,11 +524,11 @@ static NTSTATUS unixuid_logoff(struct ntvfs_module_context *ntvfs, */ static NTSTATUS unixuid_async_setup(struct ntvfs_module_context *ntvfs, struct ntvfs_request *req, - void *private) + void *private_data) { NTSTATUS status; - PASS_THRU_REQ(ntvfs, req, async_setup, (ntvfs, req, private)); + PASS_THRU_REQ(ntvfs, req, async_setup, (ntvfs, req, private_data)); return status; } |