diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-23 07:44:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:06 -0500 |
commit | a3cec511bbef2cc7768906f3af947ce2f900bde6 (patch) | |
tree | 16c0df54ed092084abd2265acc01a111cdb4c4b3 /source4/ntvfs/ntvfs_base.c | |
parent | 5821c39553f1d9899f6bcfb703876de767ccebf4 (diff) | |
download | samba-a3cec511bbef2cc7768906f3af947ce2f900bde6.tar.gz samba-a3cec511bbef2cc7768906f3af947ce2f900bde6.tar.bz2 samba-a3cec511bbef2cc7768906f3af947ce2f900bde6.zip |
r2561: completely redid the ntvfs module chaining code, You can now do something like:
ntvfs handler = nbench posix
and the nbench pass-thru module will be called before the posix
module. The chaining logic is now much saner, and less racy, with each
level in the chain getting its own private pointer rather than relying
on save/restore logic in the pass-thru module.
The only pass-thru module we have at the moment is the nbench one
(which records all traffic in a nbench compatibe format), but I plan
on soon writing a "unixuid" pass-thru module that will implement the
setegid()/setgroups()/seteuid() logic for standard posix uid
handling. This separation of the posix backend from the uid handling
should simplify the code, and make development easier.
I also modified the nbench module so it can do multiple chaining, so
if you want to you can do:
ntvfs module = nbench nbench posix
and it will save 2 copies of the log file in /tmp. This is really only
useful for testing at the moment until we have more than one pass-thru
module.
(This used to be commit f84c0af35cb54c8fdc4933afefc18fa4c062aae4)
Diffstat (limited to 'source4/ntvfs/ntvfs_base.c')
-rw-r--r-- | source4/ntvfs/ntvfs_base.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c index 923a131d5e..03873ce697 100644 --- a/source4/ntvfs/ntvfs_base.c +++ b/source4/ntvfs/ntvfs_base.c @@ -135,14 +135,29 @@ BOOL ntvfs_init(void) */ NTSTATUS ntvfs_init_connection(struct smbsrv_request *req) { - const char *handler = lp_ntvfs_handler(req->tcon->service); + const char **handlers = lp_ntvfs_handler(req->tcon->service); - req->tcon->ntvfs_ops = ntvfs_backend_byname(handler, req->tcon->type); + req->tcon->ntvfs_ops = ntvfs_backend_byname(handlers[0], req->tcon->type); if (!req->tcon->ntvfs_ops) { - DEBUG(1,("ntvfs_init_connection: failed to find backend=%s, type=%d\n", handler, req->tcon->type)); + DEBUG(1,("ntvfs_init_connection: failed to find backend=%s, type=%d\n", handlers[0], req->tcon->type)); return NT_STATUS_UNSUCCESSFUL; } return NT_STATUS_OK; } + + +/* + set the private pointer for a backend +*/ +void ntvfs_set_private(struct smbsrv_tcon *tcon, int depth, void *value) +{ + if (!tcon->ntvfs_private_list) { + tcon->ntvfs_private_list = talloc_array_p(tcon, void *, depth+1); + } else { + tcon->ntvfs_private_list = talloc_realloc_p(tcon->ntvfs_private_list, + void *, depth+1); + } + tcon->ntvfs_private_list[depth] = value; +} |