From 11bf0c0b2310e0c6ef7f0c99eec5647001a63c54 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 Aug 2003 00:53:46 +0000 Subject: Added by request of "Stefan (metze) Metzmacher" . Jeremy. (This used to be commit 80e14b176526a3038ea03214fc3dd0fd00fef922) --- examples/VFS/shadow_copy_test.c | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 examples/VFS/shadow_copy_test.c (limited to 'examples/VFS/shadow_copy_test.c') diff --git a/examples/VFS/shadow_copy_test.c b/examples/VFS/shadow_copy_test.c new file mode 100644 index 0000000000..d2b7206cd3 --- /dev/null +++ b/examples/VFS/shadow_copy_test.c @@ -0,0 +1,83 @@ +/* + * TEST implementation of an Shadow Copy module + * + * Copyright (C) Stefan Metzmacher 2003 + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (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 + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "includes.h" + +#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... +*/ + +static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels) +{ + uint32 num = 3; + uint32 i; + + shadow_copy_data->num_volumes = num; + + if (labels) { + shadow_copy_data->labels = (SHADOW_COPY_LABEL *)talloc_zero(shadow_copy_data->mem_ctx,(num)*sizeof(SHADOW_COPY_LABEL)); + for (i=0;ilabels[i], sizeof(SHADOW_COPY_LABEL), "@GMT-2003.08.05-12.%02u.00",i); + } + } else { + shadow_copy_data->labels = NULL; + } + + return 0; +} + +/* VFS operations structure */ + +static vfs_op_tuple shadow_copy_test_ops[] = { + {SMB_VFS_OP(test_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA,SMB_VFS_LAYER_OPAQUE}, + + {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP} +}; + +NTSTATUS init_module(void) +{ + return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "shadow_copy_test", shadow_copy_test_ops); +} -- cgit From c5dcd2d57234c8474ea2d95553f5a84ff682df90 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 8 Dec 2004 01:52:23 +0000 Subject: r4092: Bring into line with new *alloc rules. Jeremy. (This used to be commit 2ed86ac5844ce5893beb2bca351fee66cc3b4049) --- examples/VFS/shadow_copy_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/VFS/shadow_copy_test.c') diff --git a/examples/VFS/shadow_copy_test.c b/examples/VFS/shadow_copy_test.c index d2b7206cd3..155181229b 100644 --- a/examples/VFS/shadow_copy_test.c +++ b/examples/VFS/shadow_copy_test.c @@ -58,7 +58,7 @@ static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs shadow_copy_data->num_volumes = num; if (labels) { - shadow_copy_data->labels = (SHADOW_COPY_LABEL *)talloc_zero(shadow_copy_data->mem_ctx,(num)*sizeof(SHADOW_COPY_LABEL)); + shadow_copy_data->labels = TALLOC_ZERO_ARRAY(shadow_copy_data->mem_ctx,SHADOW_COPY_LABEL,num); for (i=0;ilabels[i], sizeof(SHADOW_COPY_LABEL), "@GMT-2003.08.05-12.%02u.00",i); } -- cgit From 5b3d90e48b8f599cb0f4458839c26d33a9cbd7b3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 30 Apr 2007 03:38:19 +0000 Subject: r22591: Fix up the examples also. Jeremy. (This used to be commit aa5a1591c626e2828244a78f237af8a59af57784) --- examples/VFS/shadow_copy_test.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/VFS/shadow_copy_test.c') diff --git a/examples/VFS/shadow_copy_test.c b/examples/VFS/shadow_copy_test.c index 155181229b..98ac304ee2 100644 --- a/examples/VFS/shadow_copy_test.c +++ b/examples/VFS/shadow_copy_test.c @@ -58,7 +58,11 @@ static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs shadow_copy_data->num_volumes = num; if (labels) { - shadow_copy_data->labels = TALLOC_ZERO_ARRAY(shadow_copy_data->mem_ctx,SHADOW_COPY_LABEL,num); + if (num) { + shadow_copy_data->labels = TALLOC_ZERO_ARRAY(shadow_copy_data->mem_ctx,SHADOW_COPY_LABEL,num); + } else { + shadow_copy_data->labels = NULL; + } for (i=0;ilabels[i], sizeof(SHADOW_COPY_LABEL), "@GMT-2003.08.05-12.%02u.00",i); } -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- examples/VFS/shadow_copy_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/VFS/shadow_copy_test.c') diff --git a/examples/VFS/shadow_copy_test.c b/examples/VFS/shadow_copy_test.c index 98ac304ee2..3e0f6a7f79 100644 --- a/examples/VFS/shadow_copy_test.c +++ b/examples/VFS/shadow_copy_test.c @@ -5,7 +5,7 @@ * * 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 - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, -- cgit From 153cfb9c83534b09f15cc16205d7adb19b394928 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 05:23:25 +0000 Subject: r23801: The FSF has moved around a lot. This fixes their Mass Ave address. (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227) --- examples/VFS/shadow_copy_test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/VFS/shadow_copy_test.c') diff --git a/examples/VFS/shadow_copy_test.c b/examples/VFS/shadow_copy_test.c index 3e0f6a7f79..86b61dc00e 100644 --- a/examples/VFS/shadow_copy_test.c +++ b/examples/VFS/shadow_copy_test.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see . */ #include "includes.h" -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- examples/VFS/shadow_copy_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/VFS/shadow_copy_test.c') diff --git a/examples/VFS/shadow_copy_test.c b/examples/VFS/shadow_copy_test.c index 86b61dc00e..1ba46b7176 100644 --- a/examples/VFS/shadow_copy_test.c +++ b/examples/VFS/shadow_copy_test.c @@ -49,7 +49,7 @@ Directories are always displayed... */ -static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels) +static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels) { uint32 num = 3; uint32 i; -- cgit