1834077 Members
2183 Online
110063 Solutions
New Discussion

make w/gcc--need help

 
Richard Mertz
Regular Advisor

make w/gcc--need help

 
What anybody thinks of me is none of my business.
11 REPLIES 11
James A. Donovan
Honored Contributor

Re: make w/gcc--need help

It looks like you are not picking up the type definitions from the /usr/include/security/pam_appl.h file.

Remember, wherever you go, there you are...
Richard Mertz
Regular Advisor

Re: make w/gcc--need help

What do you mean--I am not a "C" guy.

It looks like everytime there is an * in a declaration, gcc doesn't like it--the following is an excerpt from pam_modules.h

extern int
pam_sm_authenticate(
pam_handle_t *pamh,
int flags,
int argc,
const char **argv);
What anybody thinks of me is none of my business.
James A. Donovan
Honored Contributor

Re: make w/gcc--need help

gcc is not complaining about the "*". It's complaining that it doesn't know what a "pam_handle_t" is. This structure is defined in the /usr/include/security/pam_appl.h file.

If you are using a Makefile, then try and find a line in it that contains the string "-I /usr/include" and append "-I /usr/include/security" to it.

If you're running gcc from the command line, then try,

# gcc -I /usr/include/security -Wall -fPIC -c pam_radius_auth.c -o pam_radius_auth.o
Remember, wherever you go, there you are...
Sam Nicholls
Trusted Contributor

Re: make w/gcc--need help

Richard,

Can you point out which line is #19 in the pam_modules.h snippet that you included?

I believe that Jim is suggesting that the pam_handle_t typedef isn't being defined prior to it use in pam_modules.h.

So you'll have to find which header file defines pam_handle_t and make sure that it gets included before pam_modules.h.

I wish I could be more help, but I haven't built this package myself.

-sam
Richard Mertz
Regular Advisor

Re: make w/gcc--need help

Line 19 is:

pam_handle_t *pamh,


from the above snippet.

Richard

What anybody thinks of me is none of my business.
Richard Mertz
Regular Advisor

Re: make w/gcc--need help

Jim,

I added the -I/usr/include/security and got the same results.

Richard
What anybody thinks of me is none of my business.
James A. Donovan
Honored Contributor

Re: make w/gcc--need help

Ok, try this then:

Modify /usr/include/security/pam_modules.h
by adding on line 5 the following,

#include

*** Caveat, this modification is unlikely to be supported by HP, but I think it should work to get the needed type definitions.
Remember, wherever you go, there you are...
Richard Mertz
Regular Advisor

Re: make w/gcc--need help

Jim--we have progress. Now, I get:

pam_radius_auth.c: In function `ipstr2long':
pam_radius_auth.c:145: warning: subscript has type `char'
pam_radius_auth.c: In function `good_ipaddr':
pam_radius_auth.c:181: warning: subscript has type `char'
pam_radius_auth.c: In function `host2server':
pam_radius_auth.c:235: warning: subscript has type `char'
pam_radius_auth.c: In function `rad_converse':
pam_radius_auth.c:921: warning: passing arg 3 of `pam_get_item' from incompatibl
e pointer type
pam_radius_auth.c:924: warning: passing arg 2 of pointer to function from incomp
atible pointer type
pam_radius_auth.c: At top level:
pam_radius_auth.c:957: syntax error before `int'
pam_radius_auth.c: In function `pam_sm_authenticate':
pam_radius_auth.c:980: warning: passing arg 2 of `pam_get_user' from incompatibl
e pointer type
pam_radius_auth.c:1008: warning: passing arg 3 of `pam_get_item' from incompatib
le pointer type
pam_radius_auth.c:1022: warning: passing arg 3 of `pam_get_item' from incompatib
le pointer type
pam_radius_auth.c:1064: warning: passing arg 3 of `pam_get_item' from incompatib
le pointer type
pam_radius_auth.c:1067: warning: passing arg 3 of `add_attribute' discards quali
fiers from pointer target type
pam_radius_auth.c: At top level:
pam_radius_auth.c:1161: syntax error before `int'
pam_radius_auth.c: In function `pam_sm_setcred':
pam_radius_auth.c:1168: warning: passing arg 3 of `pam_get_data' from incompatib
le pointer type
pam_radius_auth.c: In function `pam_private_session':
pam_radius_auth.c:1193: warning: passing arg 2 of `pam_get_user' from incompatib
le pointer type
pam_radius_auth.c:1214: warning: passing arg 3 of `pam_get_item' from incompatib
le pointer type
pam_radius_auth.c: At top level:
pam_radius_auth.c:1261: syntax error before `int'
pam_radius_auth.c:1268: syntax error before `int'
pam_radius_auth.c:1279: syntax error before `int'
pam_radius_auth.c: In function `pam_sm_chauthtok':
pam_radius_auth.c:1299: warning: passing arg 2 of `pam_get_user' from incompatib
le pointer type
pam_radius_auth.c:1320: warning: passing arg 3 of `pam_get_item' from incompatib
le pointer type
pam_radius_auth.c:1329: warning: passing arg 3 of `pam_get_item' from incompatib
le pointer type
pam_radius_auth.c:1334: warning: passing arg 3 of `pam_get_item' from incompatib
le pointer type
*** Error exit code 1

What anybody thinks of me is none of my business.
James A. Donovan
Honored Contributor

Re: make w/gcc--need help

Unfortunately, you may need to go back to wherever you got this source code in order to "fix" your remaining problems. I don't have any experience with programming the PAM stuff, and the remaining errors appear to be syntax related.

I would imagine that the source code you're trying to compile came with several different README's and maybe an INSTALL file. I would look through these carefully to see if they have any pointers on compiling your source under HP-UX.
Remember, wherever you go, there you are...
Richard Mertz
Regular Advisor

Re: make w/gcc--need help

Jim:

Thanks for trying. Unfortunately, I got the source from freradius.org and they said that the only thing it had been used on was Red Hat and Solaris. No one was interested in HP-UX.

Richard
What anybody thinks of me is none of my business.
Thomas Kollig
Trusted Contributor

Re: make w/gcc--need help

Hi!

I don't know if it will work, but you can try this.
Change following part in pam_radius_auth.h:
#ifdef sun
#define PAM_EXTERN extern
#define CONST
#else
#define CONST const
#endif
---->
#define PAM_EXTERN
#define CONST

Hope this helps a little bit,

Thomas