Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getpwnam(3C)

getspnam(3C)

putpwent(3C)

putspent(3C)

NAME

putspent − write shadow password file entry

SYNOPSIS

#include <shadow.h>

int putspent(const struct spwd ∗p, FILE ∗fp);

MT-LEVEL

Unsafe

DESCRIPTION

The putspent() routine is the inverse of getspent().  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.  The spwd structure contains the following members:

char∗sp_namp;
char∗sp_pwdp;
longsp_lstchg;
longsp_min;
longsp_max;
longsp_warn;
longsp_inact;
longsp_expire;
unsigned longsp_flag;

If the sp_min, sp_max, sp_lstchg, sp_warn, sp_inact, or sp_expire field of the spwd structure is −1, or if sp_flag is 0, the corresponding /etc/shadow field is cleared.

RETURN VALUES

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

SEE ALSO

getpwnam(3C), getspnam(3C), putpwent(3C)

NOTES

This routine is for internal use only, compatibility is not guaranteed. 

Do not use without also using putpwent() to update the password file. 

The use of this function is discouraged. 

SunOS 5.5/SPARC  —  Last change: 22 Jan 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026