Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!ucsd!ames!uhccux!munnari.oz.au!labtam!sp From: sp@labtam.oz (Stephen Prince) Newsgroups: comp.unix.questions Subject: Re: Using "getpwent" in SYSV/386 Message-ID: <1937@labtam.oz> Date: 23 Nov 89 06:25:31 GMT References: <785@ctdi.UUCP> <11633@smoke.BRL.MIL> <2941@levels.sait.edu.au> Sender: news@labtam.oz Organization: Labtam Information Systems Pty. Ltd. Melbourne Lines: 25 In article <2941@levels.sait.edu.au> CCDN@levels.sait.edu.au (david newall) writes: >In article <11633@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >> In article <785@ctdi.UUCP> mikei@ctdi.UUCP (Mike Israel) writes: >> -Is there an existing function >> -to access the encrypted password? >> >> NO, that's the whole point of having /etc/shadow. > Alternatively, I would have thought "getshadowent" routines would >have been provided (for the exclusive use of root processes). There is, or at least should be if your system is a complete V.3.2. The relevent routines can be found in /usr/lib/libsec.a and only work if your uid == 0. I don't have a manual handy, but the functions are something like: #include void setspent(); void endspent(); struct spwd * getspent(); struct spwd * fgetspent(FILE *f); struct spwd * getspname(char *name); int putspent(struct spwd *p, FILE *f); /sp