xref: /openbsd-src/lib/libutil/check_expire.3 (revision bf198cc6eba0ca1f6d79f71e8e2243d386241fa8)
1.\"	$OpenBSD: check_expire.3,v 1.11 2019/01/25 00:19:26 millert Exp $
2.\"
3.\" Copyright (c) 2000 Todd C. Miller <millert@openbsd.org>
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 $Mdocdate: January 25 2019 $
18.Dt LOGIN_CHECK_EXPIRE 3
19.Os
20.Sh NAME
21.Nm login_check_expire
22.Nd check for password expiration
23.Sh SYNOPSIS
24.In stdio.h
25.In 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
32.Bx
33Authentication login script to
34check whether the user's password entry, as described by
35.Fa pwd ,
36has expired.
37.Pp
38If a
39.Fa class
40is specified, it is used instead of the class specified in the user's
41password database entry.
42If the
43.Fa lastchance
44argument is non-zero, the user's password has expired, and it has not been
45expired longer than
46.Dq password-dead
47seconds (see
48.Xr login.conf 5 ) ,
49the user will be able to log in one last time to change the password.
50.Sh RETURN VALUES
51The
52.Fn login_check_expire
53function returns 0 if the user's password has not expired, and 1 if it has
54expired or if an error occurred.
55.br
56Status and error messages are passed
57back to the login script caller via the back channel,
58.Fa back .
59.Sh SEE ALSO
60.Xr auth_subr 3 ,
61.Xr authenticate 3 ,
62.Xr login.conf 5
63