2004-09-29 17:17:09 +04:00
/*
Unix SMB / CIFS implementation .
NTVFS interface functions
Copyright ( C ) Stefan ( metze ) Metzmacher 2004
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2004-09-29 17:17:09 +04:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2004-09-29 17:17:09 +04:00
*/
# include "includes.h"
2005-12-28 01:51:30 +03:00
# include "ntvfs/ntvfs.h"
2010-04-26 15:40:15 +04:00
# include "lib/tsocket/tsocket.h"
2004-09-29 17:17:09 +04:00
/* connect/disconnect */
2009-05-14 11:58:50 +04:00
NTSTATUS ntvfs_connect ( struct ntvfs_request * req , union smb_tcon * tcon )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > connect ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2009-05-14 11:58:50 +04:00
return ntvfs - > ops - > connect ( ntvfs , req , tcon ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_disconnect ( struct ntvfs_context * ntvfs_ctx )
2004-09-29 17:17:09 +04:00
{
2005-08-05 01:00:38 +04:00
struct ntvfs_module_context * ntvfs ;
2006-03-10 17:31:17 +03:00
if ( ntvfs_ctx = = NULL ) {
2005-08-05 01:00:38 +04:00
return NT_STATUS_INVALID_CONNECTION ;
}
2006-03-10 17:31:17 +03:00
ntvfs = ntvfs_ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > disconnect ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > disconnect ( ntvfs ) ;
}
/* async setup - called by a backend that wants to setup any state for
a async request */
2009-02-02 10:29:13 +03:00
NTSTATUS ntvfs_async_setup ( struct ntvfs_request * req , void * private_data )
2006-03-10 17:31:17 +03:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > async_setup ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2009-02-02 10:29:13 +03:00
return ntvfs - > ops - > async_setup ( ntvfs , req , private_data ) ;
2006-03-10 17:31:17 +03:00
}
/* filesystem operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_fsinfo ( struct ntvfs_request * req , union smb_fsinfo * fs )
2006-03-10 17:31:17 +03:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > fsinfo ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > fsinfo ( ntvfs , req , fs ) ;
2004-09-29 17:17:09 +04:00
}
/* path operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_unlink ( struct ntvfs_request * req , union smb_unlink * unl )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > unlink ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > unlink ( ntvfs , req , unl ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_chkpath ( struct ntvfs_request * req , union smb_chkpath * cp )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > chkpath ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > chkpath ( ntvfs , req , cp ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_qpathinfo ( struct ntvfs_request * req , union smb_fileinfo * st )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > qpathinfo ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > qpathinfo ( ntvfs , req , st ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_setpathinfo ( struct ntvfs_request * req , union smb_setfileinfo * st )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > setpathinfo ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > setpathinfo ( ntvfs , req , st ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_open ( struct ntvfs_request * req , union smb_open * oi )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > open ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > open ( ntvfs , req , oi ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_mkdir ( struct ntvfs_request * req , union smb_mkdir * md )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > mkdir ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > mkdir ( ntvfs , req , md ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_rmdir ( struct ntvfs_request * req , struct smb_rmdir * rd )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > rmdir ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > rmdir ( ntvfs , req , rd ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_rename ( struct ntvfs_request * req , union smb_rename * ren )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > rename ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > rename ( ntvfs , req , ren ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_copy ( struct ntvfs_request * req , struct smb_copy * cp )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > copy ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > copy ( ntvfs , req , cp ) ;
}
/* directory search */
2009-02-02 10:29:13 +03:00
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 ) )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > search_first ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2009-02-02 10:29:13 +03:00
return ntvfs - > ops - > search_first ( ntvfs , req , io , private_data , ntvfs_callback ) ;
2004-09-29 17:17:09 +04:00
}
2009-02-02 10:29:13 +03:00
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 ) )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > search_next ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2009-02-02 10:29:13 +03:00
return ntvfs - > ops - > search_next ( ntvfs , req , io , private_data , ntvfs_callback ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_search_close ( struct ntvfs_request * req , union smb_search_close * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > search_close ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > search_close ( ntvfs , req , io ) ;
}
/* operations on open files */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_ioctl ( struct ntvfs_request * req , union smb_ioctl * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > ioctl ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > ioctl ( ntvfs , req , io ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_read ( struct ntvfs_request * req , union smb_read * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > read ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > read ( ntvfs , req , io ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_write ( struct ntvfs_request * req , union smb_write * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > write ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > write ( ntvfs , req , io ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_seek ( struct ntvfs_request * req , union smb_seek * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > seek ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > seek ( ntvfs , req , io ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_flush ( struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_flush * flush )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > flush ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > flush ( ntvfs , req , flush ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_lock ( struct ntvfs_request * req , union smb_lock * lck )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > lock ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > lock ( ntvfs , req , lck ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_qfileinfo ( struct ntvfs_request * req , union smb_fileinfo * info )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > qfileinfo ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > qfileinfo ( ntvfs , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_setfileinfo ( struct ntvfs_request * req , union smb_setfileinfo * info )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > setfileinfo ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > setfileinfo ( ntvfs , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_close ( struct ntvfs_request * req , union smb_close * io )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > close ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > close ( ntvfs , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2006-03-10 17:31:17 +03:00
/* trans interface - used by IPC backend for pipes and RAP calls */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_trans ( struct ntvfs_request * req , struct smb_trans2 * trans )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > trans ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > trans ( ntvfs , req , trans ) ;
2004-09-29 17:17:09 +04:00
}
/* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_trans2 ( struct ntvfs_request * req , struct smb_trans2 * trans2 )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > trans2 ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > trans2 ( ntvfs , req , trans2 ) ;
}
2006-03-10 17:31:17 +03:00
/* printing specific operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_lpq ( struct ntvfs_request * req , union smb_lpq * lpq )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > lpq ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > lpq ( ntvfs , req , lpq ) ;
2004-09-29 17:17:09 +04:00
}
/* logoff - called when a vuid is closed */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_logoff ( struct ntvfs_request * req )
2004-09-29 17:17:09 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2004-09-29 17:17:09 +04:00
if ( ! ntvfs - > ops - > logoff ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > ops - > logoff ( ntvfs , req ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_exit ( struct ntvfs_request * req )
2004-10-18 17:27:22 +04:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > exit ) {
2004-10-18 17:27:22 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > exit ( ntvfs , req ) ;
2004-10-18 17:27:22 +04:00
}
2004-11-04 14:28:38 +03:00
/*
2006-03-10 17:31:17 +03:00
change notify request
2004-11-04 14:28:38 +03:00
*/
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_notify ( struct ntvfs_request * req , union smb_notify * info )
2004-11-04 14:28:38 +03:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > notify ) {
2004-11-04 14:28:38 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > notify ( ntvfs , req , info ) ;
2004-11-04 14:28:38 +03:00
}
2006-03-08 06:54:24 +03:00
/*
2006-03-10 17:31:17 +03:00
cancel an outstanding async request
2006-03-08 06:54:24 +03:00
*/
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_cancel ( struct ntvfs_request * req )
2006-03-08 06:54:24 +03:00
{
2006-03-16 21:54:19 +03:00
struct ntvfs_module_context * ntvfs = req - > ctx - > modules ;
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > ops - > cancel ) {
2006-03-08 06:54:24 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > ops - > cancel ( ntvfs , req ) ;
2006-03-08 06:54:24 +03:00
}
2004-09-29 17:17:09 +04:00
/* initial setup */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_connect ( struct ntvfs_module_context * ntvfs ,
2009-05-14 11:58:50 +04:00
struct ntvfs_request * req ,
union smb_tcon * tcon )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > connect ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2009-05-14 11:58:50 +04:00
return ntvfs - > next - > ops - > connect ( ntvfs - > next , req , tcon ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_disconnect ( struct ntvfs_module_context * ntvfs )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > disconnect ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > disconnect ( ntvfs - > next ) ;
}
/* async_setup - called when setting up for a async request */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_async_setup ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2009-02-02 10:29:13 +03:00
void * private_data )
2006-03-10 17:31:17 +03:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > async_setup ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2009-02-02 10:29:13 +03:00
return ntvfs - > next - > ops - > async_setup ( ntvfs - > next , req , private_data ) ;
2006-03-10 17:31:17 +03:00
}
/* filesystem operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_fsinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_fsinfo * fs )
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > fsinfo ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > fsinfo ( ntvfs - > next , req , fs ) ;
2004-09-29 17:17:09 +04:00
}
/* path operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_unlink ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_unlink * unl )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > unlink ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > unlink ( ntvfs - > next , req , unl ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_chkpath ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_chkpath * cp )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > chkpath ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > chkpath ( ntvfs - > next , req , cp ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_qpathinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_fileinfo * st )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > qpathinfo ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > qpathinfo ( ntvfs - > next , req , st ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_setpathinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_setfileinfo * st )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > setpathinfo ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > setpathinfo ( ntvfs - > next , req , st ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_mkdir ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_mkdir * md )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > mkdir ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > mkdir ( ntvfs - > next , req , md ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_rmdir ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
struct smb_rmdir * rd )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > rmdir ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > rmdir ( ntvfs - > next , req , rd ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_rename ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_rename * ren )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > rename ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > rename ( ntvfs - > next , req , ren ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_copy ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
struct smb_copy * cp )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > copy ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > copy ( ntvfs - > next , req , cp ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_open ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_open * oi )
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > open ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > open ( ntvfs - > next , req , oi ) ;
}
2004-09-29 17:17:09 +04:00
/* directory search */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_search_first ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2009-02-02 10:29:13 +03:00
union smb_search_first * io , void * private_data ,
bool ( * callback ) ( void * private_data , const union smb_search_data * file ) )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > search_first ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2009-02-02 10:29:13 +03:00
return ntvfs - > next - > ops - > search_first ( ntvfs - > next , req , io , private_data , callback ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_search_next ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2009-02-02 10:29:13 +03:00
union smb_search_next * io , void * private_data ,
bool ( * callback ) ( void * private_data , const union smb_search_data * file ) )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > search_next ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
2009-02-02 10:29:13 +03:00
return ntvfs - > next - > ops - > search_next ( ntvfs - > next , req , io , private_data , callback ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_search_close ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_search_close * io )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > search_close ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > search_close ( ntvfs - > next , req , io ) ;
}
/* operations on open files */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_ioctl ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_ioctl * io )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > ioctl ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > ioctl ( ntvfs - > next , req , io ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_read ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_read * io )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > read ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > read ( ntvfs - > next , req , io ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_write ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_write * io )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > write ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > write ( ntvfs - > next , req , io ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_seek ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_seek * io )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > seek ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > seek ( ntvfs - > next , req , io ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_flush ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-03-10 23:49:20 +03:00
union smb_flush * flush )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > flush ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > flush ( ntvfs - > next , req , flush ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_lock ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_lock * lck )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > lock ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > lock ( ntvfs - > next , req , lck ) ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_qfileinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_fileinfo * info )
2004-09-29 17:17:09 +04:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > qfileinfo ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > qfileinfo ( ntvfs - > next , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_setfileinfo ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_setfileinfo * info )
2004-09-29 17:17:09 +04:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > setfileinfo ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > setfileinfo ( ntvfs - > next , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_close ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_close * io )
2004-09-29 17:17:09 +04:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > close ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > close ( ntvfs - > next , req , io ) ;
2004-09-29 17:17:09 +04:00
}
2006-03-10 17:31:17 +03:00
/* trans interface - used by IPC backend for pipes and RAP calls */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_trans ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
struct smb_trans2 * trans )
2004-09-29 17:17:09 +04:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > trans ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > trans ( ntvfs - > next , req , trans ) ;
2004-09-29 17:17:09 +04:00
}
/* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_trans2 ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
struct smb_trans2 * trans2 )
2004-09-29 17:17:09 +04:00
{
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > trans2 ) {
return NT_STATUS_NOT_IMPLEMENTED ;
}
return ntvfs - > next - > ops - > trans2 ( ntvfs - > next , req , trans2 ) ;
}
2006-03-10 17:31:17 +03:00
/*
change notify request
*/
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_notify ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
2006-07-12 18:25:50 +04:00
union smb_notify * info )
2004-09-29 17:17:09 +04:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > notify ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-21 14:38:57 +03:00
return ntvfs - > next - > ops - > notify ( ntvfs - > next , req , info ) ;
2004-09-29 17:17:09 +04:00
}
2006-03-10 17:31:17 +03:00
/* cancel - called to cancel an outstanding async request */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_cancel ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req )
2004-09-29 17:17:09 +04:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > cancel ) {
2004-09-29 17:17:09 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > cancel ( ntvfs - > next , req ) ;
2004-09-29 17:17:09 +04:00
}
2004-10-18 17:27:22 +04:00
2006-03-10 17:31:17 +03:00
/* printing specific operations */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_lpq ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req ,
union smb_lpq * lpq )
2004-10-18 17:27:22 +04:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > lpq ) {
2004-10-18 17:27:22 +04:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > lpq ( ntvfs - > next , req , lpq ) ;
2004-10-18 17:27:22 +04:00
}
2004-11-04 14:28:38 +03:00
2006-03-10 17:31:17 +03:00
/* logoff - called when a vuid is closed */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_logoff ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req )
2004-11-04 14:28:38 +03:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > logoff ) {
2004-11-04 14:28:38 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > logoff ( ntvfs - > next , req ) ;
2004-11-04 14:28:38 +03:00
}
2006-03-08 14:13:13 +03:00
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_next_exit ( struct ntvfs_module_context * ntvfs ,
2006-03-10 17:31:17 +03:00
struct ntvfs_request * req )
2006-03-08 14:13:13 +03:00
{
2006-03-10 17:31:17 +03:00
if ( ! ntvfs - > next | | ! ntvfs - > next - > ops - > exit ) {
2006-03-08 14:13:13 +03:00
return NT_STATUS_NOT_IMPLEMENTED ;
}
2006-03-10 17:31:17 +03:00
return ntvfs - > next - > ops - > exit ( ntvfs - > next , req ) ;
2006-03-08 14:13:13 +03:00
}
2006-03-15 20:28:46 +03:00
2010-04-26 15:40:15 +04:00
/* client connection callback */
NTSTATUS ntvfs_set_addresses ( struct ntvfs_context * ntvfs ,
const struct tsocket_address * local_address ,
const struct tsocket_address * remote_address )
{
ntvfs - > client . local_address = tsocket_address_copy ( local_address , ntvfs ) ;
NT_STATUS_HAVE_NO_MEMORY ( ntvfs - > client . local_address ) ;
ntvfs - > client . remote_address = tsocket_address_copy ( remote_address , ntvfs ) ;
NT_STATUS_HAVE_NO_MEMORY ( ntvfs - > client . remote_address ) ;
return NT_STATUS_OK ;
}
const struct tsocket_address * ntvfs_get_local_address ( struct ntvfs_module_context * ntvfs )
{
return ntvfs - > ctx - > client . local_address ;
}
const struct tsocket_address * ntvfs_get_remote_address ( struct ntvfs_module_context * ntvfs )
{
return ntvfs - > ctx - > client . remote_address ;
}
2006-03-16 21:54:19 +03:00
/* oplock helpers */
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_set_oplock_handler ( struct ntvfs_context * ntvfs ,
2006-05-20 12:15:22 +04:00
NTSTATUS ( * handler ) ( void * private_data , struct ntvfs_handle * handle , uint8_t level ) ,
2006-03-15 20:28:46 +03:00
void * private_data )
{
ntvfs - > oplock . handler = handler ;
ntvfs - > oplock . private_data = private_data ;
return NT_STATUS_OK ;
}
2008-04-02 06:53:27 +04:00
NTSTATUS ntvfs_send_oplock_break ( struct ntvfs_module_context * ntvfs ,
2006-05-20 12:15:22 +04:00
struct ntvfs_handle * handle , uint8_t level )
2006-03-15 20:28:46 +03:00
{
if ( ! ntvfs - > ctx - > oplock . handler ) {
return NT_STATUS_OK ;
}
2006-05-20 12:15:22 +04:00
return ntvfs - > ctx - > oplock . handler ( ntvfs - > ctx - > oplock . private_data , handle , level ) ;
2006-03-15 20:28:46 +03:00
}
2006-03-16 21:54:19 +03:00