The branch, master has been updated
       via  66c0f3690a6c9248adfe5da7c1abd15a8704fd6c (commit)
      from  0d9f4a2886087692642dd3eba68f0b95657232bc (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 66c0f3690a6c9248adfe5da7c1abd15a8704fd6c
Author: Jeremy Allison <[email protected]>
Date:   Thu Mar 5 17:19:18 2009 -0800

    Fix bug #6161 - smbclient corrupts source path in tar mode
    This was my fault. I broke the smbclient tar argument processing
    in creating the string for chdir when removing pstrings.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/client/clitar.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 18edf03..c9f3e87 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -1513,6 +1513,7 @@ int process_tar(void)
 
                                        if (strrchr_m(cliplist[i], '\\')) {
                                                char *p;
+                                               char saved_char;
                                                char *saved_dir = 
talloc_strdup(ctx,
                                                                        
client_get_cur_dir());
                                                if (!saved_dir) {
@@ -1531,13 +1532,28 @@ int process_tar(void)
                                                if (!tarmac) {
                                                        return 1;
                                                }
+                                               /*
+                                                * Strip off the last \\xxx
+                                                * xxx element of tarmac to set
+                                                * it as current directory.
+                                                */
                                                p = strrchr_m(tarmac, '\\');
                                                if (!p) {
                                                        return 1;
                                                }
+                                               saved_char = p[1];
                                                p[1] = '\0';
+
                                                client_set_cur_dir(tarmac);
 
+                                               /*
+                                                * Restore the character we
+                                                * just replaced to
+                                                * put the pathname
+                                                * back as it was.
+                                                */
+                                               p[1] = saved_char;
+
                                                DEBUG(5, ("process_tar, do_list 
with tarmac: %s\n", tarmac));
                                                
do_list(tarmac,attribute,do_tar, False, True);
 


-- 
Samba Shared Repository

Reply via email to