From 9d824dc115c7096ea555b135d58091e8620495d9 Mon Sep 17 00:00:00 2001 From: Sam Liddicott Date: Fri, 21 Aug 2009 16:54:49 +0200 Subject: 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 --- source4/client/client.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source4/client') 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); -- cgit