[SCM] Samba Shared Repository - branch v3-6-test updated

Jeremy Allison jra at samba.org
Wed Aug 18 16:52:32 MDT 2010


The branch, v3-6-test has been updated
       via  2e7c697... Fix bug 7563 - Creation of symlink using smbclient is buggy.
      from  ec78096... From master: b9353c65c0662895c8e87f3d1c66574444ccfa12.

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


- Log -----------------------------------------------------------------
commit 2e7c697f1c4f81c30029b47949dd8b1013a0aa97
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Aug 16 16:31:33 2010 -0700

    Fix bug 7563 - Creation of symlink using smbclient is buggy.
    
    Fix semantics of symlink. "oldpath" should be an untouched blob,
    "newpath" should fit the share path semantics.
    
    Jeremy.

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

Summary of changes:
 source3/client/client.c |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index 81e3cd4..b0c931c 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2845,21 +2845,16 @@ static int cmd_symlink(void)
 	char *newname = NULL;
 	char *buf = NULL;
 	char *buf2 = NULL;
-	char *targetname = NULL;
-	struct cli_state *targetcli;
+	struct cli_state *newcli;
 
 	if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
 	    !next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
 		d_printf("symlink <oldname> <newname>\n");
 		return 1;
 	}
-	oldname = talloc_asprintf(ctx,
-			"%s%s",
-			client_get_cur_dir(),
-			buf);
-	if (!oldname) {
-		return 1;
-	}
+	/* Oldname (link target) must be an untouched blob. */
+	oldname = buf;
+
 	newname = talloc_asprintf(ctx,
 			"%s%s",
 			client_get_cur_dir(),
@@ -2868,19 +2863,20 @@ static int cmd_symlink(void)
 		return 1;
 	}
 
-	if (!cli_resolve_path(ctx, "", auth_info, cli, oldname, &targetcli, &targetname)) {
+	/* New name must be present in share namespace. */
+	if (!cli_resolve_path(ctx, "", auth_info, cli, newname, &newcli, &newname)) {
 		d_printf("link %s: %s\n", oldname, cli_errstr(cli));
 		return 1;
 	}
 
-	if (!SERVER_HAS_UNIX_CIFS(targetcli)) {
+	if (!SERVER_HAS_UNIX_CIFS(newcli)) {
 		d_printf("Server doesn't support UNIX CIFS calls.\n");
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_symlink(targetcli, targetname, newname))) {
+	if (!NT_STATUS_IS_OK(cli_posix_symlink(newcli, oldname, newname))) {
 		d_printf("%s symlinking files (%s -> %s)\n",
-			cli_errstr(targetcli), newname, targetname);
+			cli_errstr(newcli), newname, newname);
 		return 1;
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list