HP-UX and AIX pam_radius problem

Arthur Caetano a.cassiano at gmail.com
Fri Oct 27 16:32:05 CEST 2006


hi everybody, i have a problem with radius module for PAM. When i compile
the source of pam_radius-1.3.16.tar, i got a lot of erros. I applied patch's
available in the list, but the problems persists.

In the HP-UX enviroments the messages are:

begin --------------------
[root] patch_pam_radius> make
        gcc -z -fPIC -c pam_radius_auth.c -o pam_radius_auth.o
pam_radius_auth.c: In function 'talk_radius':
pam_radius_auth.c:885: warning: passing argument 6 of 'recvfrom' from
incompatible pointer type
pam_radius_auth.c: In function 'rad_converse':
pam_radius_auth.c:1021: warning: passing argument 3 of 'pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1024: warning: passing argument 2 of 'conv->conv' from
incompatible pointer type
pam_radius_auth.c: In function 'pam_sm_authenticate':
pam_radius_auth.c:1076: warning: passing argument 2 of 'pam_get_user' from
incompatible pointer type
pam_radius_auth.c:1104: warning: passing argument 3 of 'pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1118: warning: passing argument 3 of 'pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1151: warning: passing argument 3 of 'pam_get_item' from
incompatible pointer type
pam_radius_auth.c: In function 'pam_sm_setcred':
pam_radius_auth.c:1247: warning: passing argument 3 of 'pam_get_data' from
incompatible pointer type
pam_radius_auth.c: In function 'pam_private_session':
pam_radius_auth.c:1272: warning: passing argument 2 of 'pam_get_user' from
incompatible pointer type
pam_radius_auth.c:1293: warning: passing argument 3 of 'pam_get_item' from
incompatible pointer type
pam_radius_auth.c: In function 'pam_sm_chauthtok':
pam_radius_auth.c:1379: warning: passing argument 2 of 'pam_get_user' from
incompatible pointer type
pam_radius_auth.c:1400: warning: passing argument 3 of 'pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1409: warning: passing argument 3 of 'pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1414: warning: passing argument 3 of 'pam_get_item' from
incompatible pointer type
        gcc -z -fPIC -c md5.c
        ld -b pam_radius_auth.o md5.o -lpam -o pam_radius_auth.so
patch_pam_radius>
end ------------------------

Apparently it compels but the pam_radius_auth.so not work, it causes a
problem in sshd, follow the error:

sshd[20783]: reverse mapping checking getaddrinfo for xxxxx.xxxxx.xxx -
POSSIBLE BREAKIN ATTEMPT!

I Apply this patch for HP-UX:

=======================================================================

Begin output listing from diff -u
=======================================================================

diff -u clean/pam_radius-1.3.16/Makefile pam_radius-1.3.16/Makefile
--- clean/pam_radius-1.3.16/Makefile    2003-09-19 10:41:
45.000000000 -0400
+++ pam_radius-1.3.16/Makefile  2003-12-23 11:21:26.000000000 -0500
@@ -15,7 +15,10 @@
 #
 #  If you're not using GCC, then you'll have to change the CFLAGS.
 #
-CFLAGS = -Wall -fPIC

+#CFLAGS = -Wall -fPIC
+# Added by jl 12/09/2003 for HP-UX
+CFLAGS = +DAportable +DSPA7100 +z
+# End Add jl
 #
 # On Irix, use this with MIPSPRo C Compiler, and don't forget to export
CC=cc
 # gcc on Irix does not work yet for pam_radius

@@ -55,7 +58,10 @@
 #      gcc -shared pam_radius_auth.o md5.o -lpam -lc -o pam_radius_auth.so
 #
 pam_radius_auth.so: pam_radius_auth.o md5.o
-       ld -Bshareable pam_radius_auth.o md5.o -lpam -o pam_radius_auth.so

+#      ld -Bshareable pam_radius_auth.o md5.o -lpam -o pam_radius_auth.so
+# Added by jl 12/09/2003 for HP-UX
+       ld -b pam_radius_auth.o md5.o -lpam -o pam_radius_auth.so
+# End add jl

 ######################################################################

 #
diff -u clean/pam_radius-1.3.16/md5.c pam_radius-1.3.16/md5.c
--- clean/pam_radius-1.3.16/md5.c       2002-06-28 02:29:21.000000000 -0400
+++ pam_radius-1.3.16/md5.c     2004-01-12 11:58:22.000000000 -0500

@@ -43,6 +43,12 @@
 #define HIGHFIRST
 #endif

+/* 01/12/2004 jl - Added for HPUX compiles */
+#ifdef _INCLUDE_HPUX_SOURCE
+#define HIGHFIRST
+#endif
+/* END jl */
+
 #ifndef HIGHFIRST

 #define byteReverse(buf, len)  /* Nothing */
 #else
diff -u clean/pam_radius-1.3.16/md5.h pam_radius-1.3.16/md5.h
--- clean/pam_radius-1.3.16/md5.h       2003-04-29 16:19:16.000000000 -0400
+++ pam_radius-1.3.16
/md5.h     2003-12-16 11:33:55.000000000 -0500
@@ -15,7 +15,10 @@
 #define MD5Transform  pra_MD5Transform

 #include <sys/types.h>
-#define uint32 u_int32_t
+/* Added by jl */
+/* #define u_int32_t unsigned int */

+/* #define uint32 u_int32_t */
+#define uint32 uint32_t

 struct MD5Context {
     uint32 buf[4];
Only in pam_radius-1.3.16: md5.o
diff -u clean/pam_radius-1.3.16/pam_radius_auth.c
pam_radius-1.3.16
/pam_radius_auth.c
--- clean/pam_radius-1.3.16/pam_radius_auth.c   2003-02-27
13:01:07.000000000 -0500
+++ pam_radius-1.3.16/pam_radius_auth.c 2004-01-12 12:00:52.000000000 -0500
@@ -58,6 +58,11 @@
 #ifdef sun

 #include <security/pam_appl.h>
 #endif
+/* Added by jl 12/09/2003 */
+#ifdef _INCLUDE_HPUX_SOURCE
+#include <security/pam_appl.h>
+#endif
+/* End add jl */
 #include <security/pam_modules.h>


 #include "pam_radius_auth.h"
diff -u clean/pam_radius-1.3.16/pam_radius_auth.h
pam_radius-1.3.16/pam_radius_auth.h
--- clean/pam_radius-1.3.16/pam_radius_auth.h   2003-09-19
10:41:32.000000000
 -0400
+++ pam_radius-1.3.16/pam_radius_auth.h 2003-12-09 10:20:29.000000000 -0500
@@ -66,6 +66,11 @@
  */
 #define CONST const
 #else
+/* Added by jl 12/09/2003 */
+#ifdef _INCLUDE_HPUX_SOURCE
+#define PAM_EXTERN extern

+#endif
+/* End add jl */
 #define CONST const
 #endif

=======================================================================
End output listing from diff -u



=======================================================================


In AIX i applied this modifications in md5.h, md5.c and pam_radius_auth.h

- change to the md5.h file. Change line 18 from:
           #define uint32 u_int32_t
         to
           #define uint32 uint32_t

       - in md5.c, insert to line 38 (before any #include lines)
           #define __sparc
       - in pam_radius_auth.h, line 60, insert after the comment section
but
         before "#ifdef sun":

            #define sun


the output for the command cc -z -fPIC -c md5.c -o md5.o it's ok. No errors.
the output for the command cc -z -fPIC -c pam_radius_auth.c -o
pam_radius_auth.o. the following ones:


pam_radius_auth.c: In function `talk_radius':
pam_radius_auth.c:880: warning: passing arg 6 of `nrecvfrom' from
incompatible pointer type
pam_radius_auth.c: In function `rad_converse':
pam_radius_auth.c:1016: warning: passing arg 3 of `pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1019: warning: passing arg 2 of pointer to function from
incompatible pointer type
pam_radius_auth.c: In function `pam_sm_authenticate':
pam_radius_auth.c:1071: warning: passing arg 2 of `pam_get_user' from
incompatible pointer type
pam_radius_auth.c:1099: warning: passing arg 3 of `pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1113: warning: passing arg 3 of `pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1146: warning: passing arg 3 of `pam_get_item' from
incompatible pointer type
pam_radius_auth.c: In function `pam_sm_setcred':
pam_radius_auth.c:1242: warning: passing arg 3 of `pam_get_data' from
incompatible pointer type
pam_radius_auth.c: In function `pam_private_session':
pam_radius_auth.c:1267: warning: passing arg 2 of `pam_get_user' from
incompatible pointer type
pam_radius_auth.c:1288: warning: passing arg 3 of `pam_get_item' from
incompatible pointer type
pam_radius_auth.c: In function `pam_sm_chauthtok':
pam_radius_auth.c:1374: warning: passing arg 2 of `pam_get_user' from
incompatible pointer type
pam_radius_auth.c:1395: warning: passing arg 3 of `pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1404: warning: passing arg 3 of `pam_get_item' from
incompatible pointer type
pam_radius_auth.c:1409: warning: passing arg 3 of `pam_get_item' from
incompatible pointer type

When i try the ld:

ld -G md5.o pam_radius_auth.o -o pam_radius_auth.so

the following ones occurs:

ld: 0711-327 WARNING: Entry point not found: __start
ld: 0711-244 ERROR: No csects or exported symbols have been saved.

I'm really need of this solution.
Somebody can help me, with this problems???


-- 
Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20061027/4bce866b/attachment.html>


More information about the Freeradius-Users mailing list