Blame netkit-ftp-0.17-vsftp165083.patch
|
praszyk |
9ceeb4 |
--- netkit-ftp-0.17/ftp/ftp.c.vsftp 2005-08-29 16:07:35.000000000 +0200
|
|
praszyk |
9ceeb4 |
+++ netkit-ftp-0.17/ftp/ftp.c 2005-08-30 10:58:10.000000000 +0200
|
|
praszyk |
71a717 |
@@ -582,6 +582,7 @@
|
|
praszyk |
71a717 |
volatile long long bytes = 0, hashbytes = HASHBYTES;
|
|
praszyk |
71a717 |
char buf[BUFSIZ], *bufp;
|
|
praszyk |
71a717 |
const char *volatile lmode;
|
|
praszyk |
71a717 |
+ int old_code_l;
|
|
praszyk |
71a717 |
|
|
praszyk |
71a717 |
if (verbose && printnames) {
|
|
praszyk |
71a717 |
if (local && *local != '-')
|
|
praszyk |
71a717 |
@@ -799,7 +800,35 @@
|
|
praszyk |
71a717 |
(void) fclose(dout);
|
|
praszyk |
71a717 |
/* closes data as well, so discard it */
|
|
praszyk |
71a717 |
data = -1;
|
|
praszyk |
71a717 |
- (void) getreply(0);
|
|
praszyk |
71a717 |
+ old_code_l = code;
|
|
praszyk |
4c3f2a |
+ (void) getreply(0);
|
|
praszyk |
71a717 |
+
|
|
praszyk |
71a717 |
+ /* Following "if" will avoid a bug #165083 in ftp-server */
|
|
praszyk |
71a717 |
+ /* It can be later removed. */
|
|
praszyk |
71a717 |
+ if (old_code_l == 150 && code == 150 && cpend == 1
|
|
praszyk |
71a717 |
+ && sunique == 1 && cin != NULL && fileno (cin) >= 0 ) {
|
|
praszyk |
71a717 |
+ #include <sys/poll.h>
|
|
praszyk |
71a717 |
+ struct pollfd fds_events_l [2] ;
|
|
praszyk |
71a717 |
+ int rc;
|
|
praszyk |
71a717 |
+
|
|
praszyk |
71a717 |
+ fds_events_l [0] .fd = fileno (cin);
|
|
praszyk |
71a717 |
+ fds_events_l [0] .events = POLLIN | POLLERR | POLLHUP;
|
|
praszyk |
71a717 |
+
|
|
praszyk |
71a717 |
+ rc = poll (fds_events_l, 1, 5000);
|
|
praszyk |
71a717 |
+ switch (rc) {
|
|
praszyk |
71a717 |
+ case 1:
|
|
praszyk |
71a717 |
+ (void) getreply (0);
|
|
praszyk |
71a717 |
+ break;
|
|
praszyk |
71a717 |
+ case 0:
|
|
praszyk |
71a717 |
+ fprintf (stderr, "ftp: no answer from ftp-server "
|
|
praszyk |
71a717 |
+ "(more than 5 sec).\n");
|
|
praszyk |
71a717 |
+ break;
|
|
praszyk |
71a717 |
+ case -1:
|
|
praszyk |
71a717 |
+ perror("ftp: poll");
|
|
praszyk |
71a717 |
+ break;
|
|
praszyk |
71a717 |
+ }
|
|
praszyk |
71a717 |
+ }
|
|
praszyk |
71a717 |
+
|
|
praszyk |
71a717 |
(void) signal(SIGINT, oldintr);
|
|
praszyk |
71a717 |
if (oldintp)
|
|
praszyk |
71a717 |
(void) signal(SIGPIPE, oldintp);
|