Core with 64Bit pam_radius_auth on Solaris 9

Peter Lambrechtsen plambrechtsen at gmail.com
Wed Sep 29 00:29:02 CEST 2010


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.

On Tue, Sep 28, 2010 at 8:31 PM, Alan DeKok <aland at deployingradius.com>wrote:

> Peter Lambrechtsen wrote:
> > 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.
>
>   Ah... "0.0.0.1" is "::1" in IPv6.
>
>  OK, the module *should* check the "h_addrtype" field.  It's not doing
> that right now.
>
> > 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
>
>   OK, thanks.
>
>  Alan DeKok.
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20100929/e9b44179/attachment.html>


More information about the Freeradius-Users mailing list