[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-5042-ga9e6c91

Jeremy Allison jra at samba.org
Fri Mar 6 01:18:40 GMT 2009


The branch, v3-3-test has been updated
       via  a9e6c91cd18b8b7b805f4b69f3867ea4bd6bc3ba (commit)
      from  ddaa1bae7567c81fb8e478c439bb970edab2f9c3 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit a9e6c91cd18b8b7b805f4b69f3867ea4bd6bc3ba
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Mar 5 17:17:52 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:
 source/client/clitar.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/client/clitar.c b/source/client/clitar.c
index 5a97446..d6c02df 100644
--- a/source/client/clitar.c
+++ b/source/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


More information about the samba-cvs mailing list