On Thu, Apr 16, 2015 at 10:42:37PM +0200, Jakub Wilk wrote:
I don't think this is correct. At least on FreeBSD 9.0, sysconf(_SC_HOST_NAME_MAX) returns always -1 (which means that there is no limit), so the size of hostbuf is 0.
Ahh, that's unfortunate. I tested on FreeBSD 10.0 which was a poor choice. The comments in the FreeBSD syslimits.h implied that sysconf() was the way to go. Portability is complicated!
How about falling back to _POSIX_HOST_NAME_MAX (which is 255, which should hopefully be enough for everybody) if HOST_NAME_MAX is not defined?
That's a sensible alternative. In fact, I discovered upstream have applied that exact solution for the upcoming version to allow building on MacOS X which is BSDish. I have modified the patch and tested building and using the related SSH functionality on Debian GNU/kFreeBSD stable, where it now works fine.
Thanks for the sanity checking. The updated package is on mentors. -- James McDonald
signature.asc
Description: Digital signature