ftpd reset restart position (REST) at any command

Slawa Olhovchenkov slw at zxy.spb.ru
Wed Aug 15 18:48:14 UTC 2012

I try using mirror 2.9 (old, very old perl script) to mirror ftp site
in passive mode and see don't working restart transfer: server ignored
'REST pos' command.

This because in ftpcmd.y cleared restart_point:

        : /* empty */
        | cmd_list cmd
                        if (fromname)
                        fromname = NULL;
                        restart_point = 0;
        | cmd_list rcmd

(cmd is any command execept RNFR and REST) and mirror in passive mode
used next command sequence:

REST pos
RETR file

RFC 3659 allow this, but not recomeded:

"The server-PI may react to a badly positioned REST command by ....
save the restart value and apply it to the next data transfer command

Why this case (save the restart value) is bad choice?

More information about the freebsd-stable mailing list