[Fwd: Common recycle bin (PATCH#1083)]

Andrew Bartlett abartlet at samba.org
Sat Oct 19 10:17:00 GMT 2002


Does sombody who has worked with the recycle bin want to comment on this
patch?

Andrew Bartlett

-------- Original Message --------
Subject: Common recycle bin (PATCH#1083)
Date: Fri, 18 Oct 2002 09:56:20 -0400 (EDT)
From: d.sbragion at infotecna.it
To: jeremy at samba.org, tridge at samba.org, abartlet at samba.org
CC: samba-patches at samba.org

Hello,

this patch allow for a recycle bin in common to all the shares of a
samba 
server. Whenever the recycle directory (name parameter of recycle.conf) 
starts with a '/' the absolute pathname is used to move the deleted file 
instead of building the destination directory starting from the share
root 
directory. Using a %S at the end of the directory name helps keeping
file 
separated for each share. This ease the automatic deletion of old
recycled 
files, because you don't have to follow directories all over the file 
system to find alla the recycle bins created. Relevant versions: samba 
2.2.6, redhat 7.3, kernel 2.4.18. The patch its really simple so it
should 
work with any architecture. Unidiff follows:
-----------------------------------------

--- recycle.c.orig      Fri Oct 18 15:49:29 2002
+++ recycle.c   Fri Oct 18 15:53:27 2002
@@ -256,7 +256,7 @@
                 DEBUG(10, ("pm_process returned %d\n", rc));
         }
         standard_sub_conn( conn ,
current->recycle_bin,sizeof(pstring));
-       trim_string(current->recycle_bin,"/","/");
+       trim_string(current->recycle_bin,NULL,"/");
         conn->vfs_private= (void *)current;
         return 0;
  }
@@ -323,6 +323,8 @@
         pstring newdir;

         *newdir='\0';
+       if (dname[0] == '/')
+               pstrcat(newdir,"/");
         mode=S_IREAD|S_IWRITE|S_IEXEC;
         pstrcpy(tempstr,dname);
         y=tempstr;

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

Bye!
--
	Denis Sbragion
	InfoTecna
	Tel: +39 0362 805396, Fax: +39 0362 805404
	URL: http://www.infotecna.it



More information about the samba-technical mailing list