diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-07-15 10:35:28 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-07-15 10:35:28 +0000 |
commit | e90b65284812aaa5ff9e9935ce9bbad7791cbbcd (patch) | |
tree | 9e744d1dc2f93934a4b49166a37383d3cb2b2139 /examples/VFS | |
parent | ec167dc9cc0ec2ee461837c25a371d2981744208 (diff) | |
download | samba-e90b65284812aaa5ff9e9935ce9bbad7791cbbcd.tar.gz samba-e90b65284812aaa5ff9e9935ce9bbad7791cbbcd.tar.bz2 samba-e90b65284812aaa5ff9e9935ce9bbad7791cbbcd.zip |
updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
Diffstat (limited to 'examples/VFS')
-rw-r--r-- | examples/VFS/Makefile | 3 | ||||
-rw-r--r-- | examples/VFS/block/Makefile | 2 | ||||
-rw-r--r-- | examples/VFS/recycle.c | 20 |
3 files changed, 16 insertions, 9 deletions
diff --git a/examples/VFS/Makefile b/examples/VFS/Makefile index 716e48da88..f93cd0cb2d 100644 --- a/examples/VFS/Makefile +++ b/examples/VFS/Makefile @@ -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 diff --git a/examples/VFS/block/Makefile b/examples/VFS/block/Makefile index dcc7c07793..44b08681d6 100644 --- a/examples/VFS/block/Makefile +++ b/examples/VFS/block/Makefile @@ -8,7 +8,7 @@ CC = gcc LIBTOOL = libtool -SAMBA_SRC = /usr/local/src/samba/samba-2.2.0-ron/source +SAMBA_SRC = ../../../source SAMBA_INCL = ${SAMBA_SRC}/include UBIQX_SRC = ${SAMBA_SRC}/ubiqx SMBWR_SRC = ${SAMBA_SRC}/smbwrapper diff --git a/examples/VFS/recycle.c b/examples/VFS/recycle.c index 74d3657895..6a1c98ce54 100644 --- a/examples/VFS/recycle.c +++ b/examples/VFS/recycle.c @@ -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++); |