Chris Adams
2001-Feb-25 22:04 UTC
Problem with sftp-server on Tru64 (long long type and %ll)
The ls_file function in sftp-server.c calls snprintf with "%8llu" as part of the format string and a "unsigned long long" type argument. The "%ll" format is not a valid format on Tru64 (at least 4.0F). Apparently it can confuse snprintf as well - sftp-server will segfault and core dump if the user types "ls". This isn't really a needed format string on Tru64 anyway, since "long long" is just the same as "long" - both are 8 bytes. Switching to "%8lu" instead works fine. I'm not sure of the "best" way to fix this; as far as I can find, there is only one place in OpenSSH (except for some debugging code in sftp-client.c and sftp-server.c) that the "%llu" format is used. -- Chris Adams <cmadams at hiwaay.net> Systems and Network Administrator - HiWAAY Internet Services I don't speak for anybody but myself - that's enough trouble.
mouring at etoh.eviladmin.org
2001-Feb-25 23:05 UTC
Problem with sftp-server on Tru64 (long long type and %ll)
A solution that you can test is to go into your config.h and set this: /* Define if your snprintf is busted */ /* #undef BROKEN_SNPRINTF */ Then recompile and see if sftp-server and sftp work correctly. If that solves it then it may be better to use the internal snprintf() then Tru64's. - Ben On Sun, 25 Feb 2001, Chris Adams wrote:> The ls_file function in sftp-server.c calls snprintf with "%8llu" as > part of the format string and a "unsigned long long" type argument. > > The "%ll" format is not a valid format on Tru64 (at least 4.0F). > Apparently it can confuse snprintf as well - sftp-server will segfault > and core dump if the user types "ls". > > This isn't really a needed format string on Tru64 anyway, since "long > long" is just the same as "long" - both are 8 bytes. Switching to > "%8lu" instead works fine. > > I'm not sure of the "best" way to fix this; as far as I can find, there > is only one place in OpenSSH (except for some debugging code in > sftp-client.c and sftp-server.c) that the "%llu" format is used. >