mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
Fixes for recycle bin VFS for FreeBSD from "Scot W. Hetzel" <hetzels@westbend.net>.
Jeremy
(This used to be commit 68b83335de
)
This commit is contained in:
parent
9fb0a7cbfc
commit
3ca09d432c
@ -10,10 +10,11 @@ LIBTOOL = libtool
|
||||
|
||||
SAMBA_SRC = ../../source
|
||||
SAMBA_INCL = ../../source/include
|
||||
POPT_INCL = ../../source/popt
|
||||
UBIQX_SRC = ../../source/ubiqx
|
||||
SMBWR_SRC = ../../source/smbwrapper
|
||||
KRB5_SRC = /usr/kerberos/include
|
||||
CFLAGS = -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -I$(KRB5_SRC) -Wall -g
|
||||
CFLAGS = -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(POPT_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -I$(KRB5_SRC) -Wall -g
|
||||
VFS_OBJS = audit.so skel.so recycle.so
|
||||
|
||||
# Default target
|
||||
|
@ -238,15 +238,18 @@ static int recycle_unlink(connection_struct *conn, const char *inname)
|
||||
return default_vfs_ops.unlink(conn,fname);
|
||||
}
|
||||
|
||||
base = strrchr(fname, '/') + 1;
|
||||
if(base == (char*)1)
|
||||
ext = strrchr(fname, '.');
|
||||
else
|
||||
ext = strrchr(base, '.');
|
||||
|
||||
base = strrchr(fname, '/');
|
||||
pstrcpy(bin, recycle_bin);
|
||||
pstrcat(bin, "/");
|
||||
pstrcat(bin, base);
|
||||
|
||||
if(base == NULL) {
|
||||
ext = strrchr(fname, '.');
|
||||
pstrcat(bin, fname);
|
||||
} else {
|
||||
ext = strrchr(base, '.');
|
||||
pstrcat(bin, base+1);
|
||||
}
|
||||
DEBUG(3, ("recycle bin: base %s, ext %s, fname %s, bin %s\n", base, ext, fname, bin));
|
||||
|
||||
if(strcmp(fname,bin) == 0) {
|
||||
DEBUG(3, ("recycle bin: file %s exists, purging...\n", fname));
|
||||
@ -254,6 +257,9 @@ static int recycle_unlink(connection_struct *conn, const char *inname)
|
||||
}
|
||||
|
||||
len = strlen(bin);
|
||||
if ( ext != NULL)
|
||||
len = len - strlen(ext);
|
||||
|
||||
addlen = sizeof(pstring)-len-1;
|
||||
while(recycle_file_exist(conn,bin)) {
|
||||
slprintf(bin+len, addlen, " (Copy #%d)", i++);
|
||||
|
Loading…
Reference in New Issue
Block a user