Interestingly it seems to have come down to how UINT4 was defined.
Changing in the radius.h UINT4 from being a unsigned long to a unit32_t seemed to have sorted the problem:
-------Begin Patch
--- radius.h.orig Fri Sep 24 15:17:05 2010
+++ radius.h Wed Sep 29 10:56:36 2010
@@ -36,7 +36,7 @@
#define AUTH_STRING_LEN 128 /* maximum of 254 */
#ifndef UINT4
-typedef unsigned long UINT4;
+typedef uint32_t UINT4;
#endif
typedef struct pw_auth_hdr {
-------End Patch
That has seemed to sort the problem.
Peter Lambrechtsen wrote:Ah... "0.0.0.1" is "::1" in IPv6.
> It seems around like 734 in pam_radius_auth.c:
>
> if ((hp = gethostbyname(hostname)) == (struct hostent *) NULL) {
> ipaddr = 0x00000000; /* no client IP address */
> } else {
> ipaddr = ntohl(*(UINT4 *) hp->h_addr); /* use the first one
> available */
> }
>
> That gethostbyname returns an h_addr IP address of "0.0.0.1" on our
> solaris box when running in 64Bit, but not in 32Bit. The box has IPV6
> fully disabled so we are not sure why it's doing that.
OK, the module *should* check the "h_addrtype" field. It's not doing
that right now.
OK, thanks.
> Otherwise we many to using gethostbyname_r rather than gethostbyname and
> get it working that way I'll submit a patch. And use the get_ipaddr
> function at line 242 only once rather than having two seprate places
> where gethostbyname is called to return an IP Address