s4:client
authorSam Liddicott <sam@liddicott.com>
Fri, 21 Aug 2009 14:54:49 +0000 (16:54 +0200)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Fri, 21 Aug 2009 14:54:49 +0000 (16:54 +0200)
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>
source4/client/client.c

index 82aeef3290045d4b5601a9011014c2b9aa0059a4..3fa819c8e7f1f17669bad6969dac1bc350a0649a 100644 (file)
@@ -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);