Operating System - HP-UX
1833779 Members
1871 Online
110063 Solutions
New Discussion

Re: getpwnam on hpux 11.0 with NIS

 

getpwnam on hpux 11.0 with NIS

calling getpwnam is returning a null pointer when NIS is used for accounts. According to all documentation it should handle NIS maps.But it is not working. Can someone please help me.
No matter how much you kow today you'll have to know more tomorrow.
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: getpwnam on hpux 11.0 with NIS

Hi:

I use NIS extensively and have no problems. I threw together a 2 minute C program to test this and it works exactly as expected on both 11.0 and 11.11. I suggest that you try it on your box.

I compiled it with both aCC and the ANSI C compiler and it worked perfectly.

Use it like this as a test:
pwtest user1 user2
It should output the user name, uid, and gid unless an invalid user name is supplield in which case getpwnam() returns NULL and the program outputs an error and stops.

Compile it like this:
cc -Ae pwtest.c -o pwtest OR
aCC pwtest.c -o pwtest


If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: getpwnam on hpux 11.0 with NIS

I had one more thought. Are you trying to execute 10.20 compiled code on 11x? If so, we need to do a little configuration on your 11x box. The 10.20 code will not work if you are actually running NIS+.
If it ain't broke, I can fix that.