1putspent(3C)             Standard C Library Functions             putspent(3C)
2
3
4

NAME

6       putspent - write shadow password file entry
7

SYNOPSIS

9       #include <shadow.h>
10
11       int putspent(const struct spwd *p, FILE *fp);
12
13

DESCRIPTION

15       The   putspent()  function  is  the  inverse  of getspent(). See getsp‐
16       nam(3C). Given a pointer to a spwd structure created by  getspent()  or
17       getspnam(),  putspent() writes a line on the stream fp that matches the
18       format of /etc/shadow.
19
20
21       The spwd structure contains the following members:
22
23         char           *sp_namp;
24         char           *sp_pwdp;
25         int            sp_lstchg;
26         int            sp_min;
27         int            sp_max;
28         int            sp_warn;
29         int            sp_inact;
30         int            sp_expire;
31         unsigned int   sp_flag;
32
33
34
35       If the sp_min, sp_max, sp_lstchg, sp_warn, sp_inact, or sp_expire  mem‐
36       ber of the  spwd structure is −1, or if sp_flag is 0, the corresponding
37       /etc/shadow field is cleared.
38

RETURN VALUES

40       The  putspent() function returns a  non-zero  value  if  an  error  was
41       detected during its operation. Otherwise, it returns 0.
42

USAGE

44       Since  this  function  is  for  internal use only, compatibility is not
45       guaranteed. For this reason, its use is discouraged. If used at all, if
46       should be used with putpwent(3C) to update the password file.
47

ATTRIBUTES

49       See attributes(5) for descriptions of the following attributes:
50
51
52
53
54       ┌─────────────────────────────┬─────────────────────────────┐
55       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
56       ├─────────────────────────────┼─────────────────────────────┤
57       │MT-Level                     │Unsafe                       │
58       └─────────────────────────────┴─────────────────────────────┘
59

SEE ALSO

61       getpwnam(3C), getspnam(3C), putpwent(3C), attributes(5)
62
63
64
65SunOS 5.11                        23 Jan 2008                     putspent(3C)
Impressum