xref: /openbsd-src/lib/libutil/check_expire.3 (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1.\"	$OpenBSD: check_expire.3,v 1.3 2001/07/13 23:06:23 millert Exp $
2.\"
3.\" Copyright (c) 2000 Todd C. Miller <Todd.Miller@courtesan.com>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. The name of the author may not be used to endorse or promote products
12.\"    derived from this software without specific prior written permission.
13.\"
14.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
15.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
16.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
17.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24.\"
25.Dd November 26, 2000
26.Dt CHECK_EXPIRE 3
27.Os
28.Sh NAME
29.Nm check_expire
30.Nd check for password expiration
31.Sh SYNOPSIS
32.Fd #include <stdio.h>
33.Fd #include <util.h>
34.Ft int
35.Fn login_check_expire "FILE *back" "struct passwd *pwd" "char *class" "int lastchance"
36.Sh DESCRIPTION
37The
38.Fn login_check_expire
39function is called by a BSD authentication login script to
40check whether the user's password entry, as described by
41.Fa pwd ,
42has expired.
43.Pp
44If a
45.Fa class
46is specified, it is used instead of the class specified in the user's
47password database entry.
48If the
49.Fa lastchance
50argument is non-zero, the user's password has expired, and it has not been
51expired longer than
52.Dq password-dead
53seconds (see
54.Xr login.conf 5 ) ,
55the user will be able to log in one last time to change the password.
56.Sh RETURN VALUES
57The
58.Fn login_check_expire
59function returns 0 if the user's password has not expired, and 1 if it has
60expired or if an error occurred.
61.br
62Status and error messages are passed
63back to the login script caller via the back channel,
64.Fa back .
65.Sh SEE ALSO
66.Xr authenticate 3 ,
67.Xr auth_subr 3 ,
68.Xr login.conf 5
69