Using "getpwent" in SYSV/386

Stephen Prince sp at labtam.oz
Thu Nov 23 17:25:31 AEST 1989


In article <2941 at levels.sait.edu.au> CCDN at levels.sait.edu.au (david newall) writes:
>In article <11633 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
>> In article <785 at ctdi.UUCP> mikei at 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 <shadow.h>

	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



More information about the Comp.unix.questions mailing list