Operating System - HP-UX
1833704 Members
3197 Online
110062 Solutions
New Discussion

Calling getpwent & getprent from a perl script

 

Calling getpwent & getprent from a perl script

One of my contemporaries is writing a perl script that is gathering system audit information. This script, however, keeps causing a core dump when it runs. We've isolated the core dump to a for loop that calls the getpwent system call. We've tuned the kernel, increasing the maxdsize and maxtsize, but nothing has resolved the issue. Could there be problem with the trusted database. The system that core dumps did have trust set up and then the entire /tcb/files directory was copied from another system. Could this have soemthing to do with the problems we are encountering?
2 REPLIES 2
harry d brown jr
Honored Contributor

Re: Calling getpwent & getprent from a perl script

From the man pages:

On trusted systems, if it is not necessary to obtain information from the regular password file, /etc/passwd, users should use getprpwent() to access the protected password database. See getprpwent(3) and getspwent(3X).
Live Free or Die
Larry Hyde
Occasional Advisor

Re: Calling getpwent & getprent from a perl script

I had a very similar problem, which occurred after a patch bundle update. Don't know which specific patch affected it, but I suspect it was the libc cumulative patch. After having read a comment somewhere, I thought I would experiment. It was fixed by adding a "passwd: files" record to my /etc/nsswitch.conf file.