This patch works around several bugs in gcc-2.95.2. To apply this patch: shell% cd sftpd-1.40/.. (sftpd's parent dir) shell% patch < 1.40-to-1.40b.txt *** sftpd-1.40/Makefile Sun Nov 14 01:48:04 1999 --- sftpd-g++-2.95.2/Makefile Fri Mar 24 00:29:31 2000 *************** *** 137,144 **** # ---------- main executables ------------- # displays user's keys (DSA public key is one of primary interest) ! viewkey: libextras.a libsmcrypto.a libsftp.a viewkey.cpp ! ${link} -o viewkey viewkey.cpp ${linkend} # makes user's keys makekeys-objs = \ --- 137,148 ---- # ---------- main executables ------------- # displays user's keys (DSA public key is one of primary interest) ! # (Bug workaround: even though viewkey does not use any of the ! # functions in addent.o or weakkey.o, if I don't link with them, ! # gcc-2.95.{1,2} will die with a cryptic linker error due to very ! # stupid template instantiation mechanism) ! viewkey: libextras.a libsmcrypto.a libsftp.a viewkey.cpp addent.o weakkey.o ! ${link} -o viewkey viewkey.cpp addent.o weakkey.o ${linkend} # makes user's keys makekeys-objs = \ *************** *** 171,179 **** tsint: libextras.a libsmcrypto.a tsint.cpp ${link} -o tsint tsint.cpp -L. -lsmcrypto -lextras -lgmp ${platform_libraries} ! # test DSA ! sdsa: libextras.a libsmcrypto.a sdsa.cpp ! ${link} -o sdsa sdsa.cpp -DTEST_SDSA ${linkend} # test ElGamal selgamal: libextras.a libsmcrypto.a selgamal.cpp --- 175,184 ---- tsint: libextras.a libsmcrypto.a tsint.cpp ${link} -o tsint tsint.cpp -L. -lsmcrypto -lextras -lgmp ${platform_libraries} ! # test DSA ! # (Bug workaround: usercfg.o required under gcc-2.95.{1,2}) ! sdsa: libextras.a libsmcrypto.a sdsa.cpp usercfg.o ! ${link} -o sdsa sdsa.cpp -DTEST_SDSA usercfg.o ${linkend} # test ElGamal selgamal: libextras.a libsmcrypto.a selgamal.cpp *** sftpd-1.40/crypto/iterhash.cpp Thu Sep 30 04:30:23 1999 --- sftpd-g++-2.95.2/crypto/iterhash.cpp Thu Mar 23 17:39:14 2000 *************** *** 94,100 **** } // provide empty definitions to avoid instantiation warnings ! template void IteratedHash::Init() {} ! template void IteratedHash::HashBlock(const T * /*input*/) {} --- 94,100 ---- } // provide empty definitions to avoid instantiation warnings ! //template void IteratedHash::Init() {} ! //template void IteratedHash::HashBlock(const T * /*input*/) {} *** sftpd-1.40/crypto/misc.cpp Thu Sep 30 04:30:23 1999 --- sftpd-g++-2.95.2/crypto/misc.cpp Thu Mar 23 17:39:49 2000 *************** *** 79,85 **** void *allocCheckOverrun(int bytes) { ! char *ret = new byte[bytes+8]; // extra 4 bytes on each side memcpy(ret, startPost, 4); memcpy(ret+4+bytes, endPost, 4); return ret+4; --- 79,85 ---- void *allocCheckOverrun(int bytes) { ! char *ret = new char[bytes+8]; // extra 4 bytes on each side memcpy(ret, startPost, 4); memcpy(ret+4+bytes, endPost, 4); return ret+4; *** sftpd-1.40/crypto/misc.h Thu Sep 30 04:30:24 1999 --- sftpd-g++-2.95.2/crypto/misc.h Fri Mar 24 00:33:04 2000 *************** *** 151,164 **** {SecFree(ptr, size);} #if defined(__GNUC__) || defined(__BCPLUSPLUS__) ! operator const void *() const ! {return ptr;} operator void *() {return ptr;} #endif ! operator const T *() const ! {return ptr;} operator T *() {return ptr;} --- 151,166 ---- {SecFree(ptr, size);} #if defined(__GNUC__) || defined(__BCPLUSPLUS__) ! // sm: more gcc-2.95.2 concessions ! //operator const void *() const ! // {return ptr;} operator void *() {return ptr;} #endif ! // sm: gcc-2.95.{1,2} doesn't like this (because it is a prissy little biatch) ! //operator const T *() const ! // {return ptr;} operator T *() {return ptr;}