First of all I hope this is the correct newsgroup to ask this type of
questions, if not let me know.
A call getpwnam("johan") fails if the program is owned by johan and has
the setuid bit set and the program is executed by root. Executed by any
other user it works OK. This happens on HP-UX 11 with NIS+ installed.
The user root is defined in the local /etc/passwd file, johan is defined
in some remote NIS+ table. The errno returned is 'Permission denied'. If
I remove the setuid bit it works correctly under all circumstances.
If I execute it using tusc (the HP variant of truss) it also works
correctly, but I think that's because the setuid is handled in a
peculiar way, I noticed that under different circumstances
Does anybody have any idea what the cause of this problem could be.
Johan