[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Tue Jan 16 15:45:02 UTC 2024


The branch, master has been updated
       via  c09d1a3ac1c tests: add a test for "fake directory create times"
       via  56c3dbc2ff8 system.c: fix fake directory create times
       via  85f7d9d5b94 tests: add test for vfs_worm
       via  abe1e959bf5 vfs_worm: add FILE_WRITE_EA to write access mask
       via  24227f7ecc1 vfs_worm: add my copyright
       via  30fea0e9592 vfs_worm: add some more vfs functions that worm needs to take care of
       via  0022acac9a5 vfs_worm: move write_access_flags to global
       via  58847271e10 vfs_worm: factor out readonly check
       via  d27180bd0d9 vfs_recycle: add connect function to cache parameters
       via  f02b0b984b7 tests: add a test for vfs_recycle
       via  2df2e34c3c1 time.c: fix ctime which was feeded with the mtime seconds
       via  1a89b5237b6 test_smbget.sh: reduce sleep time
      from  f30a79d7f23 python: Generate HRESULT definitions automatically

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c09d1a3ac1c8790a4162b22698616baa2ba484d5
Author: Björn Jacke <bjacke at samba.org>
Date:   Tue Jan 9 01:14:39 2024 +0100

    tests: add a test for "fake directory create times"
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Tue Jan 16 15:44:10 UTC 2024 on atb-devel-224

commit 56c3dbc2ff8531772bf79eb9da3497767a20ce6f
Author: Bjoern Jacke <bj at sernet.de>
Date:   Mon Jan 8 15:04:12 2024 +0000

    system.c: fix fake directory create times
    
    This was broken by c9c3d4312d7281904fc back in 2009 already.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12421
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 85f7d9d5b943c237966e6b466beca0cbe8076b04
Author: Björn Jacke <bjacke at samba.org>
Date:   Sat Dec 30 19:46:53 2023 +0100

    tests: add test for vfs_worm
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit abe1e959bf5a05a91a66b2bfaac97d000e4768ff
Author: Björn Jacke <bjacke at samba.org>
Date:   Sun Jan 7 14:42:20 2024 +0100

    vfs_worm: add FILE_WRITE_EA to write access mask
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 24227f7ecc16d3fc17430ac9039d7ad1ae1ee553
Author: Björn Jacke <bjacke at samba.org>
Date:   Mon Jan 8 14:25:45 2024 +0100

    vfs_worm: add my copyright
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 30fea0e959229ee583bc76490aff5e54bc7f5be8
Author: Björn Jacke <bjacke at samba.org>
Date:   Thu Jan 4 12:48:59 2024 +0100

    vfs_worm: add some more vfs functions that worm needs to take care of
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10430
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 0022acac9a56efaca3235a10a4b1fc2b669b11a6
Author: Björn Jacke <bjacke at samba.org>
Date:   Sat Dec 30 21:01:04 2023 +0100

    vfs_worm: move write_access_flags to global
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 58847271e109e9ebe8d053611bd8b25620d5ecbe
Author: Björn Jacke <bjacke at samba.org>
Date:   Sat Dec 30 20:45:31 2023 +0100

    vfs_worm: factor out readonly check
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit d27180bd0d93a3d15f7e877f1f82210b29334dc1
Author: Björn Jacke <bjacke at samba.org>
Date:   Sat Jan 6 17:35:55 2024 +0100

    vfs_recycle: add connect function to cache parameters
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit f02b0b984b7128319613315819599ef7acb54776
Author: Björn Jacke <bjacke at samba.org>
Date:   Sat Jan 6 17:32:57 2024 +0100

    tests: add a test for vfs_recycle
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 2df2e34c3c1ccf76bbcc78586cbbb6433b6d30d5
Author: Björn Jacke <bjacke at samba.org>
Date:   Sun Jan 7 05:09:58 2024 +0100

    time.c: fix ctime which was feeded with the mtime seconds
    
    This bug was introduced with 53a1d034f3e47ed3c in 2020.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15550
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 1a89b5237b61ae9ed5b23ec42d7c56533d0cce90
Author: Björn Jacke <bjacke at samba.org>
Date:   Mon Jan 8 00:27:48 2024 +0100

    test_smbget.sh: reduce sleep time
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/util/time.c                                 |   2 +-
 selftest/target/Samba3.pm                       |  29 +++
 source3/lib/system.c                            |   1 +
 source3/modules/vfs_recycle.c                   | 294 +++++++++++-------------
 source3/modules/vfs_worm.c                      | 252 ++++++++++++++++++--
 source3/script/tests/test_fakedircreatetimes.sh |  65 ++++++
 source3/script/tests/test_recycle.sh            | 102 ++++++++
 source3/script/tests/test_smbget.sh             |   2 +-
 source3/script/tests/test_worm.sh               | 121 ++++++++++
 source3/selftest/tests.py                       |   4 +
 10 files changed, 692 insertions(+), 180 deletions(-)
 create mode 100755 source3/script/tests/test_fakedircreatetimes.sh
 create mode 100755 source3/script/tests/test_recycle.sh
 create mode 100755 source3/script/tests/test_worm.sh


Changeset truncated at 500 lines:

diff --git a/lib/util/time.c b/lib/util/time.c
index 31bb0a7aad9..47ae32017d0 100644
--- a/lib/util/time.c
+++ b/lib/util/time.c
@@ -1446,7 +1446,7 @@ struct timespec get_ctimespec(const struct stat *pst)
 {
 	struct timespec ret;
 
-	ret.tv_sec = pst->st_mtime;
+	ret.tv_sec = pst->st_ctime;
 	ret.tv_nsec = get_ctimensec(pst);
 	return ret;
 }
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index bfa9fad5ffe..5b3d31ea535 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -2681,12 +2681,21 @@ sub provision($$)
 	my $local_symlinks_shrdir="$shrdir/local_symlinks";
 	push(@dirs,$local_symlinks_shrdir);
 
+	my $worm_shrdir="$shrdir/worm";
+	push(@dirs,$worm_shrdir);
+
 	my $fruit_resource_stream_shrdir="$shrdir/fruit_resource_stream";
 	push(@dirs,$fruit_resource_stream_shrdir);
 
 	my $smbget_sharedir="$shrdir/smbget";
 	push(@dirs, $smbget_sharedir);
 
+	my $recycle_shrdir="$shrdir/recycle";
+	push(@dirs,$recycle_shrdir);
+
+	my $fakedircreatetimes_shrdir="$shrdir/fakedircreatetimes";
+	push(@dirs,$fakedircreatetimes_shrdir);
+
 	# this gets autocreated by winbindd
 	my $wbsockdir="$prefix_abs/wbsock";
 
@@ -3503,6 +3512,13 @@ sub provision($$)
 	path = $local_symlinks_shrdir
 	follow symlinks = yes
 
+[worm]
+	copy = tmp
+	path = $worm_shrdir
+	vfs objects = worm
+	worm:grace_period = 1
+	comment = vfs_worm with 1s grace_period
+
 [kernel_oplocks]
 	copy = tmp
 	kernel oplocks = yes
@@ -3596,6 +3612,19 @@ sub provision($$)
 	path = $smbget_sharedir
 	comment = smb username is [%U]
 
+[recycle]
+	copy = tmp
+	path = $recycle_shrdir
+	vfs objects = recycle
+	recycle : repository = .trash
+	recycle : exclude = *.tmp
+	recycle : directory_mode = 755
+
+[fakedircreatetimes]
+	copy = tmp
+	path = $fakedircreatetimes_shrdir
+	fake directory create times = yes
+
 [smbget_guest]
 	path = $smbget_sharedir
 	comment = smb username is [%U]
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 721ffd17f88..18dc6989372 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -186,6 +186,7 @@ static void make_create_timespec(const struct stat *pst, struct stat_ex *dst,
 	if (S_ISDIR(pst->st_mode) && fake_dir_create_times) {
 		dst->st_ex_btime.tv_sec = 315493200L;          /* 1/1/1980 */
 		dst->st_ex_btime.tv_nsec = 0;
+		return;
 	}
 
 	dst->st_ex_iflags &= ~ST_EX_IFLAG_CALCULATED_BTIME;
diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c
index b03db6a3b7f..a9d60f6adbb 100644
--- a/source3/modules/vfs_recycle.c
+++ b/source3/modules/vfs_recycle.c
@@ -35,151 +35,108 @@ static int vfs_recycle_debug_level = DBGC_VFS;
 
 #undef DBGC_CLASS
 #define DBGC_CLASS vfs_recycle_debug_level
- 
-static const char *recycle_repository(vfs_handle_struct *handle)
-{
-	const char *tmp_str = NULL;
-
-	tmp_str = lp_parm_const_string(SNUM(handle->conn), "recycle", "repository",".recycle");
-
-	DEBUG(10, ("recycle: repository = %s\n", tmp_str));
-
-	return tmp_str;
-}
-
-static bool recycle_keep_dir_tree(vfs_handle_struct *handle)
-{
-	bool ret;
-
-	ret = lp_parm_bool(SNUM(handle->conn), "recycle", "keeptree", False);
-
-	DEBUG(10, ("recycle_bin: keeptree = %s\n", ret?"True":"False"));
-
-	return ret;
-}
-
-static bool recycle_versions(vfs_handle_struct *handle)
-{
-	bool ret;
-
-	ret = lp_parm_bool(SNUM(handle->conn), "recycle", "versions", False);
-
-	DEBUG(10, ("recycle: versions = %s\n", ret?"True":"False"));
-
-	return ret;
-}
-
-static bool recycle_touch(vfs_handle_struct *handle)
-{
-	bool ret;
-
-	ret = lp_parm_bool(SNUM(handle->conn), "recycle", "touch", False);
-
-	DEBUG(10, ("recycle: touch = %s\n", ret?"True":"False"));
-
-	return ret;
-}
-
-static bool recycle_touch_mtime(vfs_handle_struct *handle)
-{
-	bool ret;
-
-	ret = lp_parm_bool(SNUM(handle->conn), "recycle", "touch_mtime", False);
-
-	DEBUG(10, ("recycle: touch_mtime = %s\n", ret?"True":"False"));
-
-	return ret;
-}
-
-static const char **recycle_exclude(vfs_handle_struct *handle)
-{
-	const char **tmp_lp;
-
-	tmp_lp = lp_parm_string_list(SNUM(handle->conn), "recycle", "exclude", NULL);
-
-	DEBUG(10, ("recycle: exclude = %s ...\n", tmp_lp?*tmp_lp:""));
-
-	return tmp_lp;
-}
-
-static const char **recycle_exclude_dir(vfs_handle_struct *handle)
-{
-	const char **tmp_lp;
 
-	tmp_lp = lp_parm_string_list(SNUM(handle->conn), "recycle", "exclude_dir", NULL);
-
-	DEBUG(10, ("recycle: exclude_dir = %s ...\n", tmp_lp?*tmp_lp:""));
-
-	return tmp_lp;
-}
-
-static const char **recycle_noversions(vfs_handle_struct *handle)
-{
-	const char **tmp_lp;
-
-	tmp_lp = lp_parm_string_list(SNUM(handle->conn), "recycle", "noversions", NULL);
-
-	DEBUG(10, ("recycle: noversions = %s\n", tmp_lp?*tmp_lp:""));
-
-	return tmp_lp;
-}
-
-static off_t recycle_maxsize(vfs_handle_struct *handle)
-{
-	off_t maxsize;
-
-	maxsize = conv_str_size(lp_parm_const_string(SNUM(handle->conn),
-					    "recycle", "maxsize", NULL));
-
-	DEBUG(10, ("recycle: maxsize = %lu\n", (long unsigned int)maxsize));
-
-	return maxsize;
-}
-
-static off_t recycle_minsize(vfs_handle_struct *handle)
-{
+struct recycle_config_data {
+	const char *repository;
+	bool keeptree;
+	bool versions;
+	bool touch;
+	bool touch_mtime;
+	const char **exclude;
+	const char **exclude_dir;
+	const char **noversions;
+	mode_t directory_mode;
+	mode_t subdir_mode;
 	off_t minsize;
+	off_t maxsize;
+};
 
-	minsize = conv_str_size(lp_parm_const_string(SNUM(handle->conn),
-					    "recycle", "minsize", NULL));
-
-	DEBUG(10, ("recycle: minsize = %lu\n", (long unsigned int)minsize));
-
-	return minsize;
-}
-
-static mode_t recycle_directory_mode(vfs_handle_struct *handle)
+static int vfs_recycle_connect(struct vfs_handle_struct *handle,
+			       const char *service,
+			       const char *user)
 {
-	int dirmode;
+	struct recycle_config_data *config = NULL;
+	int ret;
+	int t;
 	const char *buff;
 
-	buff = lp_parm_const_string(SNUM(handle->conn), "recycle", "directory_mode", NULL);
+	ret = SMB_VFS_NEXT_CONNECT(handle, service, user);
+	if (ret < 0) {
+		return ret;
+	}
 
+	if (IS_IPC(handle->conn) || IS_PRINT(handle->conn)) {
+		return 0;
+	}
+
+	config = talloc_zero(handle->conn, struct recycle_config_data);
+	if (config == NULL) {
+		DBG_ERR("talloc_zero() failed\n");
+		errno = ENOMEM;
+		return -1;
+	}
+	config->repository = lp_parm_const_string(SNUM(handle->conn),
+						  "recycle",
+						  "repository",
+						  ".recycle");
+	config->keeptree = lp_parm_bool(SNUM(handle->conn),
+					"recycle",
+					"keeptree",
+					False);
+	config->versions = lp_parm_bool(SNUM(handle->conn),
+					"recycle",
+					"versions",
+					False);
+	config->touch = lp_parm_bool(SNUM(handle->conn),
+				     "recycle",
+				     "touch",
+				     False);
+	config->touch_mtime = lp_parm_bool(SNUM(handle->conn),
+					   "recycle",
+					   "touch_mtime",
+					   False);
+	config->exclude = lp_parm_string_list(SNUM(handle->conn),
+					      "recycle",
+					      "exclude",
+					      NULL);
+	config->exclude_dir = lp_parm_string_list(SNUM(handle->conn),
+						  "recycle",
+						  "exclude_dir",
+						  NULL);
+	config->noversions = lp_parm_string_list(SNUM(handle->conn),
+						 "recycle",
+						 "noversions",
+						 NULL);
+	config->minsize = conv_str_size(lp_parm_const_string(
+		SNUM(handle->conn), "recycle", "minsize", NULL));
+	config->maxsize = conv_str_size(lp_parm_const_string(
+		SNUM(handle->conn), "recycle", "maxsize", NULL));
+
+	buff = lp_parm_const_string(SNUM(handle->conn),
+				    "recycle",
+				    "directory_mode",
+				    NULL);
 	if (buff != NULL ) {
-		sscanf(buff, "%o", &dirmode);
+		sscanf(buff, "%o", &t);
 	} else {
-		dirmode=S_IRUSR | S_IWUSR | S_IXUSR;
+		t = S_IRUSR | S_IWUSR | S_IXUSR;
 	}
+	config->directory_mode = (mode_t)t;
 
-	DEBUG(10, ("recycle: directory_mode = %o\n", dirmode));
-	return (mode_t)dirmode;
-}
-
-static mode_t recycle_subdir_mode(vfs_handle_struct *handle)
-{
-	int dirmode;
-	const char *buff;
-
-	buff = lp_parm_const_string(SNUM(handle->conn), "recycle", "subdir_mode", NULL);
-
+	buff = lp_parm_const_string(SNUM(handle->conn),
+				    "recycle",
+				    "subdir_mode",
+				    NULL);
 	if (buff != NULL ) {
-		sscanf(buff, "%o", &dirmode);
+		sscanf(buff, "%o", &t);
 	} else {
-		dirmode=recycle_directory_mode(handle);
+		t = config->directory_mode;
 	}
+	config->subdir_mode = (mode_t)t;
 
-	DEBUG(10, ("recycle: subdir_mode = %o\n", dirmode));
-	return (mode_t)dirmode;
+	SMB_VFS_HANDLE_SET_DATA(
+		handle, config, NULL, struct recycle_config_data, return -1);
+	return 0;
 }
 
 static bool recycle_directory_exist(vfs_handle_struct *handle, const char *dname)
@@ -253,12 +210,17 @@ static off_t recycle_get_file_size(vfs_handle_struct *handle,
  * Create directory tree
  * @param conn connection
  * @param dname Directory tree to be created
+ * @param directory mode
+ * @param subdirectory mode
  * @return Returns True for success
  **/
-static bool recycle_create_dir(vfs_handle_struct *handle, const char *dname)
+static bool recycle_create_dir(vfs_handle_struct *handle,
+			       const char *dname,
+			       mode_t dir_mode,
+			       mode_t subdir_mode)
 {
 	size_t len;
-	mode_t mode;
+	mode_t mode = dir_mode;
 	char *new_dir = NULL;
 	char *tmp_str = NULL;
 	char *token;
@@ -266,8 +228,6 @@ static bool recycle_create_dir(vfs_handle_struct *handle, const char *dname)
 	bool ret = False;
 	char *saveptr;
 
-	mode = recycle_directory_mode(handle);
-
 	tmp_str = SMB_STRDUP(dname);
 	ALLOC_CHECK(tmp_str, done);
 	tok_str = tmp_str;
@@ -325,7 +285,7 @@ static bool recycle_create_dir(vfs_handle_struct *handle, const char *dname)
 		if (strlcat(new_dir, "/", len+1) >= len+1) {
 			goto done;
 		}
-		mode = recycle_subdir_mode(handle);
+		mode = subdir_mode;
 	}
 
 	ret = True;
@@ -472,18 +432,25 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 	const char *base;
 	char *repository = NULL;
 	int i = 1;
-	off_t maxsize, minsize;
 	off_t file_size; /* space_avail;	*/
 	bool exist;
 	int rc = -1;
-
-	repository = talloc_sub_full(NULL, lp_servicename(talloc_tos(), lp_sub, SNUM(conn)),
-					conn->session_info->unix_info->unix_name,
-					conn->connectpath,
-					conn->session_info->unix_token->gid,
-					conn->session_info->unix_info->sanitized_username,
-					conn->session_info->info->domain_name,
-					recycle_repository(handle));
+	struct recycle_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle,
+				config,
+				struct recycle_config_data,
+				return true);
+
+	repository = talloc_sub_full(
+		NULL,
+		lp_servicename(talloc_tos(), lp_sub, SNUM(conn)),
+		conn->session_info->unix_info->unix_name,
+		conn->connectpath,
+		conn->session_info->unix_token->gid,
+		conn->session_info->unix_info->sanitized_username,
+		conn->session_info->info->domain_name,
+		config->repository);
 	ALLOC_CHECK(repository, done);
 	/* shouldn't we allow absolute path names here? --metze */
 	/* Yes :-). JRA. */
@@ -535,20 +502,20 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 	 * not greater then maxsize, not the size of the single file, also it is better
 	 * to remove older files
 	 */
-	maxsize = recycle_maxsize(handle);
-	if(maxsize > 0 && file_size > maxsize) {
-		DEBUG(3, ("recycle: File %s exceeds maximum recycle size, "
-			  "purging... \n", smb_fname_str_dbg(full_fname)));
+	if (config->maxsize > 0 && file_size > config->maxsize) {
+		DBG_NOTICE("File %s exceeds maximum recycle size, "
+			   "purging... \n",
+			   smb_fname_str_dbg(full_fname));
 		rc = SMB_VFS_NEXT_UNLINKAT(handle,
 					dirfsp,
 					smb_fname,
 					flags);
 		goto done;
 	}
-	minsize = recycle_minsize(handle);
-	if(minsize > 0 && file_size < minsize) {
-		DEBUG(3, ("recycle: File %s lowers minimum recycle size, "
-			  "purging... \n", smb_fname_str_dbg(full_fname)));
+	if (config->minsize > 0 && file_size < config->minsize) {
+		DBG_NOTICE("File %s lowers minimum recycle size, "
+			   "purging... \n",
+			   smb_fname_str_dbg(full_fname));
 		rc = SMB_VFS_NEXT_UNLINKAT(handle,
 					dirfsp,
 					smb_fname,
@@ -585,7 +552,7 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 	/* filename without path */
 	DEBUG(10, ("recycle: base = %s\n", base));
 
-	if (matchparam(recycle_exclude(handle), base)) {
+	if (matchparam(config->exclude, base)) {
 		DEBUG(3, ("recycle: file %s is excluded \n", base));
 		rc = SMB_VFS_NEXT_UNLINKAT(handle,
 					dirfsp,
@@ -594,7 +561,7 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 		goto done;
 	}
 
-	if (matchdirparam(recycle_exclude_dir(handle), path_name)) {
+	if (matchdirparam(config->exclude_dir, path_name)) {
 		DEBUG(3, ("recycle: directory %s is excluded \n", path_name));
 		rc = SMB_VFS_NEXT_UNLINKAT(handle,
 					dirfsp,
@@ -603,7 +570,7 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 		goto done;
 	}
 
-	if (recycle_keep_dir_tree(handle) == True) {
+	if (config->keeptree) {
 		if (asprintf(&temp_name, "%s/%s", repository, path_name) == -1) {
 			ALLOC_CHECK(temp_name, done);
 		}
@@ -617,7 +584,11 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 		DEBUG(10, ("recycle: Directory already exists\n"));
 	} else {
 		DEBUG(10, ("recycle: Creating directory %s\n", temp_name));
-		if (recycle_create_dir(handle, temp_name) == False) {
+		if (recycle_create_dir(handle,
+				       temp_name,
+				       config->directory_mode,
+				       config->subdir_mode) == False)
+		{
 			DEBUG(3, ("recycle: Could not create directory, "
 				  "purging %s...\n",
 				  smb_fname_str_dbg(full_fname)));
@@ -654,7 +625,8 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 
 	/* check if we should delete file from recycle bin */
 	if (recycle_file_exist(handle, smb_fname_final)) {
-		if (recycle_versions(handle) == False || matchparam(recycle_noversions(handle), base) == True) {
+		if (config->versions == False ||
+		    matchparam(config->noversions, base) == True) {
 			DEBUG(3, ("recycle: Removing old file %s from recycle "
 				  "bin\n", smb_fname_str_dbg(smb_fname_final)));
 			if (SMB_VFS_NEXT_UNLINKAT(handle,
@@ -705,9 +677,8 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 	}
 
 	/* touch access date of moved file */
-	if (recycle_touch(handle) == True || recycle_touch_mtime(handle))
-		recycle_do_touch(handle, smb_fname_final,
-				 recycle_touch_mtime(handle));
+	if (config->touch || config->touch_mtime)
+		recycle_do_touch(handle, smb_fname_final, config->touch_mtime);
 
 done:
 	TALLOC_FREE(path_name);
@@ -741,7 +712,8 @@ static int recycle_unlinkat(vfs_handle_struct *handle,
 }
 
 static struct vfs_fn_pointers vfs_recycle_fns = {
-	.unlinkat_fn = recycle_unlinkat
+	.connect_fn = vfs_recycle_connect,
+	.unlinkat_fn = recycle_unlinkat,
 };


-- 
Samba Shared Repository



More information about the samba-cvs mailing list