summaryrefslogtreecommitdiff
path: root/source4/client
diff options
context:
space:
mode:
authorSam Liddicott <sam@liddicott.com>2009-08-21 16:54:49 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-21 16:54:49 +0200
commit9d824dc115c7096ea555b135d58091e8620495d9 (patch)
treea1552e28b3bc97492a7e0e579a140480e2831d1a /source4/client
parentd20061abe379253f4b471dc89ddcbc1af32842bd (diff)
downloadsamba-9d824dc115c7096ea555b135d58091e8620495d9.tar.gz
samba-9d824dc115c7096ea555b135d58091e8620495d9.tar.bz2
samba-9d824dc115c7096ea555b135d58091e8620495d9.zip
s4:client
Put was assuming that the remote name was always absolute, and not relative to the current remote directory. Signed-off-by: Sam Liddicott <sam@liddicott.com>
Diffstat (limited to 'source4/client')
-rw-r--r--source4/client/client.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 82aeef3290..3fa819c8e7 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -1221,10 +1221,14 @@ static int cmd_put(struct smbclient_context *ctx, const char **args)
lname = talloc_strdup(ctx, args[1]);
- if (args[2])
- rname = talloc_strdup(ctx, args[2]);
- else
+ if (args[2]) {
+ if (args[2][0]=='\\')
+ rname = talloc_strdup(ctx, args[2]);
+ else
+ rname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, args[2]);
+ } else {
rname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, lname);
+ }
dos_clean_name(rname);