2003-08-08 04:53:46 +04:00
/*
* TEST implementation of an Shadow Copy module
*
* Copyright ( C ) Stefan Metzmacher 2003
2009-09-26 07:51:50 +04:00
* Copyright ( C ) Jeremy Allison 2009.
2003-08-08 04:53:46 +04:00
*
* 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-09 23:25:36 +04:00
* the Free Software Foundation ; either version 3 of the License , or
2003-08-08 04:53:46 +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 09:23:25 +04:00
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
2003-08-08 04:53:46 +04:00
*/
2011-12-14 00:26:21 +04:00
# include "../source3/include/includes.h"
2011-06-29 18:53:57 +04:00
# include "ntioctl.h"
2003-08-08 04:53:46 +04:00
# undef DBGC_CLASS
# define DBGC_CLASS DBGC_VFS
/* USE THIS MODULE ONLY FOR TESTING!!!! */
/*
For this share
Z : \
the ShadowCopies are in this directories
Z : \ @ GMT - 2003.08 .05 - 12.00 .00 \
Z : \ @ GMT - 2003.08 .05 - 12.01 .00 \
Z : \ @ GMT - 2003.08 .05 - 12.02 .00 \
e . g .
Z : \ testfile . txt
Z : \ @ GMT - 2003.08 .05 - 12.02 .00 \ testfile . txt
or :
Z : \ testdir \ testfile . txt
Z : \ @ GMT - 2003.08 .05 - 12.02 .00 \ testdir \ testfile . txt
Note : Files must differ to be displayed via Windows Explorer !
Directories are always displayed . . .
*/
2011-06-29 18:53:57 +04:00
static int test_get_shadow_copy_data ( vfs_handle_struct * handle ,
files_struct * fsp ,
struct shadow_copy_data * shadow_copy_data ,
bool labels )
2003-08-08 04:53:46 +04:00
{
2015-05-14 03:26:01 +03:00
uint32_t num = 3 ;
uint32_t i ;
2003-08-08 04:53:46 +04:00
shadow_copy_data - > num_volumes = num ;
if ( labels ) {
2007-04-30 07:38:19 +04:00
if ( num ) {
2011-06-29 18:53:57 +04:00
shadow_copy_data - > labels = talloc_zero_array ( shadow_copy_data , SHADOW_COPY_LABEL , num ) ;
2007-04-30 07:38:19 +04:00
} else {
shadow_copy_data - > labels = NULL ;
}
2003-08-08 04:53:46 +04:00
for ( i = 0 ; i < num ; i + + ) {
snprintf ( shadow_copy_data - > labels [ i ] , sizeof ( SHADOW_COPY_LABEL ) , " @GMT-2003.08.05-12.%02u.00 " , i ) ;
}
} else {
shadow_copy_data - > labels = NULL ;
}
return 0 ;
}
/* VFS operations structure */
2009-09-26 07:51:50 +04:00
static struct vfs_fn_pointers vfs_test_shadow_copy_fns = {
2011-12-04 08:45:04 +04:00
. get_shadow_copy_data_fn = test_get_shadow_copy_data
2003-08-08 04:53:46 +04:00
} ;
2015-08-13 19:16:20 +03:00
static_decl_vfs ;
2017-04-20 22:24:43 +03:00
NTSTATUS vfs_shadow_copy_test_init ( TALLOC_CTX * ctx )
2003-08-08 04:53:46 +04:00
{
2011-06-29 18:53:57 +04:00
return smb_register_vfs ( SMB_VFS_INTERFACE_VERSION ,
" shadow_copy_test " ,
& vfs_test_shadow_copy_fns ) ;
2003-08-08 04:53:46 +04:00
}