Bug 2196 - [patch] System wide recycle bin
Summary: [patch] System wide recycle bin
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.10
Hardware: x86 Linux
: P3 enhancement
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-29 02:25 UTC by Denis Sbragion
Modified: 2005-08-24 10:21 UTC (History)
0 users

See Also:


Attachments
System wide recycle bin (773 bytes, patch)
2004-12-29 02:27 UTC, Denis Sbragion
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Sbragion 2004-12-29 02:25:53 UTC
Little change to vfs_recycle.c to use absolute paths when recycle:repository 
starts with a '/'. This allow for the use of a system wide recycle bin using 
something like:

recycle:repository = /disks/ide1/samba/TrashBin/%S

On some systems a system wide recycle bin is much more manageable than a 
separate recycle bin for each share.

Unified diff patch:

--- vfs_recycle.c	2004-12-27 16:27:49.000000000 +0100
+++ vfs_recycle.c.org	2004-12-15 15:33:13.000000000 +0100
@@ -223,8 +223,6 @@
 	new_dir = (char *)SMB_MALLOC(len + 1);
 	ALLOC_CHECK(new_dir, done);
 	*new_dir = '\0';
-	if (dname[0] == '/')
-		safe_strcat(new_dir,"/",len);
 
 	/* Create directory tree if neccessary */
 	for(token = strtok(tok_str, "/"); token; token = strtok(NULL, "/")) {
@@ -338,7 +336,7 @@
 	repository = alloc_sub_conn(conn, recycle_repository(handle));
 	ALLOC_CHECK(repository, done);
 	/* shouldn't we allow absolute path names here? --metze */
-	trim_char(repository, '\0', '/');
+	trim_char(repository, '/', '/');
 	
 	if(!repository || *(repository) == '\0') {
 		DEBUG(3, ("recycle: repository path not set, purging %s...\n", 
file_name));
Comment 1 Denis Sbragion 2004-12-29 02:27:03 UTC
Created attachment 872 [details]
System wide recycle bin
Comment 2 Jeremy Allison 2005-06-13 11:42:44 UTC
Applied (even though patch was reversed !).
Thanks,
Jeremy.
Comment 3 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:21:27 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.