[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    putpwent(3C) manual page Table of Contents

Name

putpwent - write password file entry

Synopsis

#include <pwd.h>

int putpwent(const struct passwd *p, FILE *f);

MT-Level

Unsafe

Description

putpwent() is the inverse of getpwent(), (see getpwnam(3C) ). Given a pointer to a passwd structure created by getpwent() (or getpwuid() or getpwnam()), putpwent() writes a line on the stream f, which matches the format of /etc/passwd.

Return Values

putpwent() returns non-zero if an error was detected during its operation, otherwise zero.

See Also

getpwnam(3C) , putspent(3C)

Notes

Do not use without also using putspent() to update the shadow file.

The use of this function is discouraged.

Bugs

This routine is of limited utility, since most password files are maintained as Network Information Service (NIS ) files, and cannot be updated with this routine.


Table of Contents