SOURCES: busybox-ftpput.patch - stupid me according to RFC 959 STO...

tommat tommat at pld-linux.org
Mon Nov 7 21:03:53 CET 2005


Author: tommat                       Date: Mon Nov  7 20:03:52 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- stupid me according to RFC 959 STOR uses full path, CWD is not needed
  only error was wrong variable

---- Files affected:
SOURCES:
   busybox-ftpput.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/busybox-ftpput.patch
diff -u SOURCES/busybox-ftpput.patch:1.1 SOURCES/busybox-ftpput.patch:1.2
--- SOURCES/busybox-ftpput.patch:1.1	Tue Feb 15 14:57:59 2005
+++ SOURCES/busybox-ftpput.patch	Mon Nov  7 21:03:47 2005
@@ -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:
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/busybox-ftpput.patch?r1=1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list