nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man3c / putspent.3c
blob04f23304fa1fe3852b4322ae3f9b69bd34bea633
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH PUTSPENT 3C "Jan 23, 2008"
8 .SH NAME
9 putspent \- write shadow password file entry
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <shadow.h>
15 \fBint\fR \fBputspent\fR(\fBconst struct spwd *\fR\fIp\fR, \fBFILE *\fR\fIfp\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The  \fBputspent()\fR function is the inverse of \fBgetspent()\fR. See
22 \fBgetspnam\fR(3C). Given a pointer to a \fBspwd\fR structure created by
23 \fBgetspent()\fR or \fBgetspnam()\fR, \fBputspent()\fR writes a line on the
24 stream \fIfp\fR that matches the format of \fB/etc/shadow\fR.
25 .sp
26 .LP
27 The \fBspwd\fR structure contains the following members:
28 .sp
29 .in +2
30 .nf
31 \fBchar           *sp_namp;
32 char           *sp_pwdp;
33 int            sp_lstchg;
34 int            sp_min;
35 int            sp_max;
36 int            sp_warn;
37 int            sp_inact;
38 int            sp_expire;
39 unsigned int   sp_flag;\fR
40 .fi
41 .in -2
43 .sp
44 .LP
45 If the \fBsp_min\fR, \fBsp_max\fR, \fBsp_lstchg\fR, \fBsp_warn\fR,
46 \fBsp_inact\fR, or \fBsp_expire\fR member of the  \fBspwd\fR structure is
47 \(mi1, or if \fBsp_flag\fR is 0, the corresponding  \fB/etc/shadow\fR field is
48 cleared.
49 .SH RETURN VALUES
50 .sp
51 .LP
52 The  \fBputspent()\fR function returns a non-zero value if an error was
53 detected during its operation. Otherwise, it returns \fB0\fR.
54 .SH USAGE
55 .sp
56 .LP
57 Since this function is for internal use only, compatibility is not guaranteed.
58 For this reason, its use is discouraged. If used at all, if should be used with
59 \fBputpwent\fR(3C) to update the password file.
60 .SH ATTRIBUTES
61 .sp
62 .LP
63 See \fBattributes\fR(5) for descriptions of the following attributes:
64 .sp
66 .sp
67 .TS
68 box;
69 c | c
70 l | l .
71 ATTRIBUTE TYPE  ATTRIBUTE VALUE
73 MT-Level        Unsafe
74 .TE
76 .SH SEE ALSO
77 .sp
78 .LP
79 \fBgetpwnam\fR(3C), \fBgetspnam\fR(3C), \fBputpwent\fR(3C), \fBattributes\fR(5)