HBSD: fix tnftp fetch redirection bug

before the fix:

op@pandora-d ftp> ftp http://hunger.hu/nice.php
Requesting http://hunger.hu/nice.php
Redirected to
http://hunger.hu/|id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;reboot
Requesting
http://hunger.hu/|id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;reboot
     0        0.00 KiB/s
     uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	uid=1001(op) gid=1001(op) groups=1001(op),68(dialer)
	reboot: Operation not permitted

after the fix:

op@pandora-d ftp> ./ftp http://hunger.hu/nice.php
Requesting http://hunger.hu/nice.php
Redirected to
http://hunger.hu/|id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;reboot
Requesting
http://hunger.hu/|id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;id;reboot
already done

URL: http://seclists.org/oss-sec/2014/q4/459
Noted-by: Hunger <hunger@hunger.hu>
Fix-from: NetBSD
Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>