summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-10-13 15:51:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:04:58 -0500
commit057060feaf7395f475a32f9dad9e149ab0fa6a1c (patch)
tree9bbf95fc4dfdbda7b083dc39f095d6b020ce4cff
parent1bd3cbd3125e03117aed4288f1addcdfd9f1f109 (diff)
downloadsamba-057060feaf7395f475a32f9dad9e149ab0fa6a1c.tar.gz
samba-057060feaf7395f475a32f9dad9e149ab0fa6a1c.tar.bz2
samba-057060feaf7395f475a32f9dad9e149ab0fa6a1c.zip
r10964: BUG 1051: store the directory path so we can send the full name in the unlink call (del tmp\foo)
(This used to be commit 49b8d7d7f5ed93a2b9b21404194452f35bcf7b26)
-rw-r--r--source3/client/client.c11
-rw-r--r--source3/include/client.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 61c4c8e4be..e2b3486990 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -514,6 +514,14 @@ static int do_list_queue_empty(void)
static void do_list_helper(const char *mntpoint, file_info *f, const char *mask, void *state)
{
+ char *dir_end;
+
+ /* save the directory */
+ pstrcpy( f->dir, mask );
+ if ( (dir_end = strrchr( f->dir, '\\' )) != NULL ) {
+ *dir_end = '\0';
+ }
+
if (f->mode & aDIR) {
if (do_list_dirs && do_this_one(f)) {
do_list_fn(f);
@@ -1613,8 +1621,7 @@ static void do_del(file_info *finfo)
{
pstring mask;
- pstrcpy(mask,cur_dir);
- pstrcat(mask,finfo->name);
+ pstr_sprintf( mask, "%s\\%s", finfo->dir, finfo->name );
if (finfo->mode & aDIR)
return;
diff --git a/source3/include/client.h b/source3/include/client.h
index df52e227f0..30e0fae874 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -44,6 +44,7 @@ typedef struct file_info
time_t atime;
time_t ctime;
pstring name;
+ pstring dir;
char short_name[13*3]; /* the *3 is to cope with multi-byte */
} file_info;