2 * TEST implementation of an Shadow Copy module
4 * Copyright (C) Stefan Metzmacher 2003
5 * Copyright (C) Jeremy Allison 2009.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #include "../source3/include/includes.h"
25 #define DBGC_CLASS DBGC_VFS
27 /* USE THIS MODULE ONLY FOR TESTING!!!! */
33 the ShadowCopies are in these directories
35 Z:\@GMT-2003.08.05-12.00.00\
36 Z:\@GMT-2003.08.05-12.01.00\
37 Z:\@GMT-2003.08.05-12.02.00\
42 Z:\@GMT-2003.08.05-12.02.00\testfile.txt
46 Z:\testdir\testfile.txt
47 Z:\@GMT-2003.08.05-12.02.00\testdir\testfile.txt
50 Note: Files must differ to be displayed via Windows Explorer!
51 Directories are always displayed...
54 static int test_get_shadow_copy_data(vfs_handle_struct
*handle
,
56 struct shadow_copy_data
*shadow_copy_data
,
62 shadow_copy_data
->num_volumes
= num
;
66 shadow_copy_data
->labels
= talloc_zero_array(shadow_copy_data
,SHADOW_COPY_LABEL
,num
);
68 shadow_copy_data
->labels
= NULL
;
71 snprintf(shadow_copy_data
->labels
[i
], sizeof(SHADOW_COPY_LABEL
), "@GMT-2003.08.05-12.%02u.00",i
);
74 shadow_copy_data
->labels
= NULL
;
80 /* VFS operations structure */
82 static struct vfs_fn_pointers vfs_test_shadow_copy_fns
= {
83 .get_shadow_copy_data_fn
= test_get_shadow_copy_data
87 NTSTATUS
vfs_shadow_copy_test_init(TALLOC_CTX
*ctx
)
89 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION
,
91 &vfs_test_shadow_copy_fns
);