]> git.pld-linux.org Git - packages/busybox.git/commitdiff
- stupid me according to RFC 959 STOR uses full path, CWD is not needed
authortommat <tommat@pld-linux.org>
Mon, 7 Nov 2005 20:03:47 +0000 (20:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  only error was wrong variable

Changed files:
    busybox-ftpput.patch -> 1.2

busybox-ftpput.patch

index 946e09ce38d47881a39a7789963e050b94440393..b4897d177093850a7de505cb0a3918334c1df89d 100644 (file)
@@ -1,66 +1,22 @@
 --- busybox-1.00/networking/ftpgetput.c.orig   2005-02-15 13:30:36.000000000 +0100
 +++ busybox-1.00/networking/ftpgetput.c        2005-02-15 14:00:35.315575696 +0100
-@@ -227,15 +227,51 @@
-       int fd_local;
-       int response;
-+      int server_sl = -1;
-+      int local_sl = -1;
-+      char local_fname[512];
-+      char server_fname[512];
-+      char server_fpath[1024];
-+      char *temp;
-+      int i;
-+      
-+      strcpy (server_fpath, server_path);
-+      
-+      for (i = 0; server_fpath[i] != '\0'; i++)
-+              if (server_fpath[i] == '/') server_sl = i;
-+      
-+      if (server_sl == -1) {
-+              strcpy(server_fname, server_fpath);
-+              server_fpath[0] = '\0';
-+      } else {
-+              temp = server_fpath + server_sl;
-+              strcpy(server_fname, temp);
-+              server_fpath[server_sl+1] = '\0';
-+      }
-+      
-+      for (i = 0; local_path[i] != '\0'; i++)
-+              if (local_path[i] == '/') local_sl = i;
-+      
-+      if (local_sl == -1) {
-+              strcpy(local_fname, local_path);
-+      } else {
-+              temp = local_path + local_sl;
-+              strcpy(local_fname, temp);
-+      }
-+
-+      if (server_fname[0] == '\0')
-+              strcpy (server_fname, local_fname);
-+              
-       /*  Connect to the data socket */
-       if (ftpcmd("PASV", NULL, control_stream, buf) != 227) {
-               bb_error_msg_and_die("PASV error: %s", buf + 4);
+@@ -237,10 +237,6 @@
        }
        fd_data = xconnect_ftpdata(server, buf);
  
 -      if (ftpcmd("CWD ", server_path, control_stream, buf) != 250) {
 -              bb_error_msg_and_die("CWD error: %s", buf + 4);
 -      }
-+      if (server_sl != -1)
-+              if (ftpcmd("CWD ", server_fpath, control_stream, buf) != 250) {
-+                      bb_error_msg_and_die("CWD error: %s", buf + 4);
-+              }
+-
        /* get the local file */
        if ((local_path[0] == '-') && (local_path[1] == '\0')) {
-@@ -260,7 +296,7 @@
+               fd_local = STDIN_FILENO;
+@@ -264,7 +260,7 @@
                        break;
                }
        }
 -      response = ftpcmd("STOR ", local_path, control_stream, buf);
-+      response = ftpcmd("STOR ", server_fname, control_stream, buf);
++      response = ftpcmd("STOR ", server_path, control_stream, buf);
        switch (response) {
        case 125:
        case 150:
This page took 0.035208 seconds and 4 git commands to generate.