DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

putspent(S-osr5)


putspent -- write shadow password file entry

Syntax

cc . . . -lc

#include <shadow.h>

int putspent (p, fp) struct spwd *p; FILE *fp;

Description

The putspent routine is the inverse of getspent(S-osr5). Given a pointer to a spwd structure created by the getspent routine (or the getspnam routine), the putspent routine writes a line on the stream fp, which matches the format of /etc/shadow.

If the ``sp_min'', ``sp_max'' or ``sp_lstchg'' field of the spwd structure is -1, the corresponding /etc/shadow field is cleared.

Diagnostics

The putspent routine returns non-zero if an error was detected during its operation, otherwise zero.

Notes

If a program not otherwise using standard I/O uses this routine, the size of the program increases more than might be expected.

This routine is provided for compatibility purposes only, and may not function correctly on all systems. We recommend that the putprpwnam(S-osr5) routine be used as an alternative.

See also

getspent(S-osr5), getpwent(S-osr5), putpwent(S-osr5), getprpwent(S-osr5)

Standards conformance

The putspent routine is conformant with AT&T SVID Issue 3.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005