svn commit: samba r7545 - in trunk/source/modules: .
jra at samba.org
jra at samba.org
Mon Jun 13 18:45:21 GMT 2005
Author: jra
Date: 2005-06-13 18:45:19 +0000 (Mon, 13 Jun 2005)
New Revision: 7545
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7545
Log:
Fix for bug #2196 from Denis Sbragion <d.sbragion at infotecna.it>.
Allow absolute path (system wide) recycle bin.
Jeremy.
Modified:
trunk/source/modules/vfs_recycle.c
Changeset:
Modified: trunk/source/modules/vfs_recycle.c
===================================================================
--- trunk/source/modules/vfs_recycle.c 2005-06-13 18:45:17 UTC (rev 7544)
+++ trunk/source/modules/vfs_recycle.c 2005-06-13 18:45:19 UTC (rev 7545)
@@ -222,7 +222,7 @@
**/
static BOOL recycle_create_dir(vfs_handle_struct *handle, const char *dname)
{
- int len;
+ size_t len;
mode_t mode;
char *new_dir = NULL;
char *tmp_str = NULL;
@@ -240,6 +240,10 @@
new_dir = (char *)SMB_MALLOC(len + 1);
ALLOC_CHECK(new_dir, done);
*new_dir = '\0';
+ if (dname[0] == '/') {
+ /* Absolute path. */
+ safe_strcat(new_dir,"/",len);
+ }
/* Create directory tree if neccessary */
for(token = strtok(tok_str, "/"); token; token = strtok(NULL, "/")) {
@@ -353,7 +357,8 @@
repository = alloc_sub_conn(conn, recycle_repository(handle));
ALLOC_CHECK(repository, done);
/* shouldn't we allow absolute path names here? --metze */
- trim_char(repository, '/', '/');
+ /* Yes :-). JRA. */
+ trim_char(repository, '\0', '/');
if(!repository || *(repository) == '\0') {
DEBUG(3, ("recycle: repository path not set, purging %s...\n", file_name));
@@ -379,7 +384,7 @@
}
*/
- /* FIXME: this is wrong, we should check the hole size of the recycle bin is
+ /* FIXME: this is wrong, we should check the whole size of the recycle bin is
* not greater then maxsize, not the size of the single file, also it is better
* to remove older files
*/
More information about the samba-cvs
mailing list