The Samba-Bugzilla – Attachment 5907 Details for
Bug 7563
smbclient - symlink command
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git am fix for 3.5.x.
0001-Fix-bug-7563-Creation-of-symlink-using-smbclient-is-.patch (text/plain), 2.04 KB, created by
Jeremy Allison
on 2010-08-16 18:34:33 UTC
(
hide
)
Description:
git am fix for 3.5.x.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2010-08-16 18:34:33 UTC
Size:
2.04 KB
patch
obsolete
>From 4c4f106c3aca9764a7f66ba7fc082c577c1b4790 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 16 Aug 2010 16:31:33 -0700 >Subject: [PATCH] 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. >--- > source3/client/client.c | 22 +++++++++------------- > 1 files changed, 9 insertions(+), 13 deletions(-) > >diff --git a/source3/client/client.c b/source3/client/client.c >index e11e3bf..ce5b4e6 100644 >--- a/source3/client/client.c >+++ b/source3/client/client.c >@@ -2869,21 +2869,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(), >@@ -2892,19 +2887,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; > } > >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 7563
: 5907