Fix bug #6021 - smbclient du command does not recuse properly
authorJeremy Allison <jra@samba.org>
Thu, 8 Jan 2009 23:41:49 +0000 (15:41 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 8 Jan 2009 23:41:49 +0000 (15:41 -0800)
Jeremy.

source3/client/client.c
source3/libsmb/clidfs.c

index c40c04e9c676b35051186cb727f5d08acc0d8e99..adcbffe6fac30f9fbff4aaaac5778b704da4a8e1 100644 (file)
@@ -747,11 +747,11 @@ static void do_list_helper(const char *mntpoint, file_info *f, const char *mask,
                                return;
                        }
                        p = strrchr_m(mask2,CLI_DIRSEP_CHAR);
-                       if (!p) {
-                               TALLOC_FREE(dir);
-                               return;
+                       if (p) {
+                               p[1] = 0;
+                       } else {
+                               mask2[0] = '\0';
                        }
-                       p[1] = 0;
                        mask2 = talloc_asprintf_append(mask2,
                                        "%s%s*",
                                        f->name,
index ac68700fd087f1e11d22bf5f4f5d5a083c3d8fa1..211aca2bd8f9980765f48efb40590dce848b56e5 100644 (file)
@@ -308,10 +308,11 @@ static void cli_cm_set_mntpoint(struct cli_state *c, const char *mnt)
        }
 
        if (p) {
-               char *name = clean_name(NULL, p->mount);
+               char *name = clean_name(NULL, mnt);
                if (!name) {
                        return;
                }
+               TALLOC_FREE(p->mount);
                p->mount = talloc_strdup(p, name);
                TALLOC_FREE(name);
        }