lists.arthurdejong.org
RSS feed

Re: [Patch] Diagnostics for failing start-tls and HOST_NAME_MAX

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: [Patch] Diagnostics for failing start-tls and HOST_NAME_MAX



On 3/5/2012 23:08, Arthur de Jong wrote:
> On Sat, 2012-03-03 at 14:55 +0100, Mel Flynn wrote:

>> The second one fixes compilation on systems where HOST_NAME_MAX is not
>> defined, but which implement at least POSIX 200112 (which includes all
>> supported FreeBSD versions).
> 
> Thanks for spotting this. However, the patch doesn't currently work
> because nslcd/common.h ensures that HOST_NAME_MAX is always defined.
> Secondly, since the value is allocated on the stack it shouldn't be
> calculated on the fly. Lastly, also nslcd/pam.c and nslcd/common.c also
> use HOST_NAME_MAX.

Argh, must have spotted this when working with 0.8.1.
However, _POSIX_HOST_NAME_MAX is defined in limits.h, which I don't see
included in nslcd/common.h, so you may still end up with the wrong value.
I verified this by using 2555 as fallback value and running the
preprocessor on cfg.c. So that leaves only a minor fix:

--- nslcd/common.h.orig 2011-09-09 07:58:35.000000000 -0800
+++ nslcd/common.h      2012-03-05 13:59:26.000000000 -0900
@@ -127,6 +127,7 @@

 /* fallback definition of HOST_NAME_MAX */
 #ifndef HOST_NAME_MAX
+#include <limits.h>
 #ifdef _POSIX_HOST_NAME_MAX
 #define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
 #else
-- 
Mel
-- 
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users/