fetch compiled with stack protector makes fetch unusable for most ftp sites - remote size being always -1

Tomaž Borštnar tomaz.borstnar at over.net
Thu Jan 20 14:10:16 PST 2005


Having "CFLAGS=-g -O -pipe -fstack-protector" for all compilations I see 
one serious thing - fetch compiled with stack protector makes fetch 
unusable for most ftp sites - remote size being always -1 and most of 
the time file is actually transferred yet recognized as size -1.

See example of installing ncftp3 from ports:

masina# cd ncftp3/
masina# make install clean
Use INSTALL_AS_NCFTP3=yes to install ncftp v3 as /usr/local/bin/ncftp3

=> ncftp-3.1.8-src.tar.bz2 doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://ftp.ncftp.com/ncftp/.
Receiving ncftp-3.1.8-src.tar.bz2 (401522 bytes): 0%
0 bytes transferred in 0.0 seconds (0.00 Bps)
fetch: ncftp-3.1.8-src.tar.bz2 appears to be truncated: -1/401522 bytes
=> Attempting to fetch from 
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/.
fetch: ncftp-3.1.8-src.tar.bz2: local modification time does not match 
remote
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

Stop in /usr/ports/ftp/ncftp3.

Few moments later after rebuilding /usr/bin/fetch WITHOUT -fstack-protector:
masina# make
Warning: Object directory not changed from original /usr/src/usr.bin/fetch
cc -g -O -pipe    -W -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wpointer-arith -Wno-uninitialized -Wall  -c fetch.c
cc -g -O -pipe    -W -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wpointer-arith -Wno-uninitialized -Wall   -o fetch fetch.o -lfetch 
-lcrypto -lssl
gzip -cn fetch.1 > fetch.1.gz
masina# make install
install -s -o root -g wheel -m 555   fetch /usr/bin
install -o root -g wheel -m 444 fetch.1.gz  /usr/share/man/man1

. ..
. ..
masina# make install clean

Use INSTALL_AS_NCFTP3=yes to install ncftp v3 as /usr/local/bin/ncftp3

=> ncftp-3181-v6-20040728.diff.gz doesn't seem to exist in 
/usr/ports/distfiles/.
=> Attempting to fetch from ftp://ftp.kame.net/pub/kame/misc/.
Receiving ncftp-3181-v6-20040728.diff.gz (35409 bytes): 100%
35409 bytes transferred in 6.1 seconds (5.66 kBps)
===>  Extracting for ncftp-3.1.8
=> Checksum mismatch for ncftp-3.1.8-src.tar.bz2.
=> Checksum OK for ncftp-3181-v6-20040728.diff.gz.
===>  Refetch for 1 more times files: ncftp-3.1.8-src.tar.bz2

Use INSTALL_AS_NCFTP3=yes to install ncftp v3 as /usr/local/bin/ncftp3

=> ncftp-3.1.8-src.tar.bz2 doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from ftp://ftp.ncftp.com/ncftp/.
Receiving ncftp-3.1.8-src.tar.bz2 (401522 bytes): 100%
401522 bytes transferred in 2.0 seconds (200.60 kBps)





More information about the Bugs mailing list