Linux-6.9: file_lock mbrs moved to file_lock_core
[openafs.git] / doc / man-pages / pod8 / kpwvalid.pod
1 =head1 NAME
2
3 kpwvalid - Checks quality of new password
4
5 =head1 SYNOPSIS
6
7 =for html
8 <div class="synopsis">
9
10 B<kpwvalid>
11
12 =for html
13 </div>
14
15 =head1 DESCRIPTION
16
17 The B<kpwvalid> command checks the quality of a new password passed to it
18 from the B<kpasswd> or B<kas setpassword> command for the obsolete
19 Authentication Server. It is optional. If it exists, it must reside in the
20 same AFS directory as the binaries for the B<kpasswd> and B<kas> command
21 suites (create a symbolic link from the client machine's local disk to
22 this directory). The directory's ACL must extend the C<a> (administer) and
23 C<w> (write) permissions to the system:administrators group only. These
24 requirements prevent unauthorized users from substituting a spurious
25 B<kpwvalid> binary.
26
27 The AFS distribution includes an example B<kpwvalid> program that checks
28 that the password is at least eight characters long; the code for it
29 appears in L</EXAMPLES> below.
30
31 The script or program must accept a sequence of password strings, one per
32 line, on the standard input stream. The first is the current password and
33 is ignored. Each subsequent string is a candidate password to be
34 checked. The program must write the following to the standard output
35 stream for each one:
36
37 =over 4
38
39 =item *
40
41 C<0> (zero) and a newline character to indicate that the password is
42 acceptable.
43
44 =item *
45
46 A non-zero decimal number and a newline character to indicate that the
47 password is not acceptable.
48
49 =back
50
51 Further, it must write any error messages only to the standard error
52 stream, not to the standard output stream.
53
54 =head1 CAUTIONS
55
56 The B<kpwvalid> command is only used by the obsolete Authentication Server
57 It is provided for sites that have not yet migrated to a Kerberos version
58 5 KDC. The Authentication Server and supporting commands, including
59 B<kpwvalid>, will be removed in a future version of OpenAFS.
60
61 =head1 EXAMPLES
62
63 The following example program, included in the AFS distribution, verifies
64 that the requested password includes eight or more characters.
65
66    #include <stdio.h>
67    /* prints 0 if the password is long enough, otherwise non-zero */
68    main()
69    {
70    char oldpassword[512];
71    char password[512];
72
73    if (fgets(oldpassword, 512, stdin))
74       while (fgets(password, 512, stdin)) {
75          if (strlen(password) > 8) { /* password includes a newline */
76             fputs("0\n",stdout);
77             fflush(stdout);
78          }
79          else {
80             fputs("Passwords must contain at least 8 characters.\n",
81                   stderr);
82             fputs("1\n",stdout);
83             fflush(stdout);
84          }
85    return 0;
86    }
87
88
89 =head1 SEE ALSO
90
91 L<kas_setpassword(8)>,
92 L<kpasswd(1)>
93
94 =head1 COPYRIGHT
95
96 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
97
98 This documentation is covered by the IBM Public License Version 1.0.  It was
99 converted from HTML to POD by software written by Chas Williams and Russ
100 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.