summaryrefslogtreecommitdiffstats
path: root/ftp/cftp/files/patch-ftp.c
blob: 886f4bdd519dafc9b25cc0df69f5cac104c9781d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- ftp.c.orig	Tue Sep 17 16:58:18 2002
+++ ftp.c	Sat Sep 28 15:49:05 2002
@@ -311,7 +311,7 @@
 rftp_list(char *path)
 {
     directory *dir;
-    int fd;
+    int fd, resp;
     FILE *f;
     
     if (ftp_mode('a') == -1 || ftp_cwd(path) == -1)
@@ -321,7 +321,7 @@
 	return NULL;
     
     ftp_put("list");
-    if (ftp_resp() != 150) {
+    if ((resp=ftp_resp()) != 150 && resp != 125) {
 	close(fd);
 	dir = (directory *)malloc(sizeof(directory));
 	dir->line = (direntry *)malloc(sizeof(direntry));
@@ -379,7 +379,7 @@
 void *
 rftp_retr(char *file, int mode, long *startp, long *sizep)
 {
-    int fd;
+    int fd, resp;
     char *dir, *name, *can, *p;
     FILE *fin;
     
@@ -400,7 +400,7 @@
     }
     
     ftp_put("retr %s", name);
-    if (ftp_resp() != 150) {
+    if ((resp=ftp_resp()) != 150 && resp != 125) {
 	close(fd);
 	return NULL;
     }
OpenPOWER on IntegriCloud