source: npl/system/netkit-ftp/patches/09-netkit-ftp-0.17-vsftp165083.patch @ 26ffad7

Last change on this file since 26ffad7 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.3 KB
  • netkit-ftp-0.17/ftp/ftp.c

    old new  
    582582        volatile long long bytes = 0, hashbytes = HASHBYTES;
    583583        char buf[BUFSIZ], *bufp;
    584584        const char *volatile lmode;
     585        int old_code_l;
    585586
    586587        if (verbose && printnames) {
    587588                if (local && *local != '-')
     
    799800        (void) fclose(dout);
    800801        /* closes data as well, so discard it */
    801802        data = -1;
    802         (void) getreply(0);
     803        old_code_l = code;
     804        (void) getreply(0);
     805
     806        /* Following "if" will avoid a bug #165083 in ftp-server */
     807        /* It can be later removed.                              */
     808        if (old_code_l == 150 && code == 150 && cpend == 1
     809            && sunique == 1 && cin !=  NULL && fileno (cin) >=  0 ) {
     810                #include <sys/poll.h>
     811                struct pollfd  fds_events_l [2] ;
     812                int rc;
     813
     814                fds_events_l [0] .fd = fileno (cin);
     815                fds_events_l [0] .events = POLLIN | POLLERR | POLLHUP;
     816           
     817                rc = poll (fds_events_l, 1, 5000);
     818                switch (rc) {
     819                case  1:
     820                        (void) getreply (0);
     821                        break;
     822                case  0:
     823                        fprintf (stderr, "ftp: no answer from ftp-server "
     824                                         "(more than 5 sec).\n");
     825                        break;
     826                case -1:
     827                        perror("ftp: poll");
     828                        break;
     829                }
     830        }
     831
    803832        (void) signal(SIGINT, oldintr);
    804833        if (oldintp)
    805834                (void) signal(SIGPIPE, oldintp);
Note: See TracBrowser for help on using the repository browser.