xref: /openbsd/lib/libutil/check_expire.3 (revision db3296cf)
1.\"	$OpenBSD: check_expire.3,v 1.6 2003/06/17 21:56:24 millert Exp $
2.\"
3.\" Copyright (c) 2000 Todd C. Miller <Todd.Miller@courtesan.com>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd November 26, 2000
18.Dt CHECK_EXPIRE 3
19.Os
20.Sh NAME
21.Nm check_expire
22.Nd check for password expiration
23.Sh SYNOPSIS
24.Fd #include <stdio.h>
25.Fd #include <util.h>
26.Ft int
27.Fn login_check_expire "FILE *back" "struct passwd *pwd" "char *class" "int lastchance"
28.Sh DESCRIPTION
29The
30.Fn login_check_expire
31function is called by a BSD authentication login script to
32check whether the user's password entry, as described by
33.Fa pwd ,
34has expired.
35.Pp
36If a
37.Fa class
38is specified, it is used instead of the class specified in the user's
39password database entry.
40If the
41.Fa lastchance
42argument is non-zero, the user's password has expired, and it has not been
43expired longer than
44.Dq password-dead
45seconds (see
46.Xr login.conf 5 ) ,
47the user will be able to log in one last time to change the password.
48.Sh RETURN VALUES
49The
50.Fn login_check_expire
51function returns 0 if the user's password has not expired, and 1 if it has
52expired or if an error occurred.
53.br
54Status and error messages are passed
55back to the login script caller via the back channel,
56.Fa back .
57.Sh SEE ALSO
58.Xr auth_subr 3 ,
59.Xr authenticate 3 ,
60.Xr login.conf 5
61