If the user specifies a trailing slash on the destination, make sure
authorWayne Davison <wayned@samba.org>
Thu, 24 Apr 2003 16:14:33 +0000 (16:14 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 24 Apr 2003 16:14:33 +0000 (16:14 +0000)
that we treat it as a directory reference.

main.c

diff --git a/main.c b/main.c
index a33f7a7..29ee6ad 100644 (file)
--- a/main.c
+++ b/main.c
@@ -285,6 +285,7 @@ oom:
 static char *get_local_name(struct file_list *flist,char *name)
 {
        STRUCT_STAT st;
+       int len;
        extern int orig_umask;
 
        if (verbose > 2)
@@ -310,7 +311,8 @@ static char *get_local_name(struct file_list *flist,char *name)
                return name;
        }
 
-       if (flist->count <= 1)
+       len = strlen(name);
+       if ((len <= 1 || name[len-1] != '/') && flist->count <= 1)
                return name;
 
        if (do_mkdir(name,0777 & ~orig_umask) != 0) {