man-page-updates-20070726
[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. It is optional. If it
19 exists, it must reside in the same AFS directory as the binaries for the
20 B<kpasswd> and B<kas> command suites (create a symbolic link from the
21 client machine's local disk to this directory). The directory's ACL must
22 extend the C<a> (administer) and C<w> (write) permissions to the
23 system:administrators group only. These requirements prevent unauthorized
24 users from substituting a spurious B<kpwvalid> binary.
25
26 The AFS distribution includes an example B<kpwvalid> program that checks
27 that the password is at least eight characters long; the code for it
28 appears in L<EXAMPLES> below.
29
30 The script or program must accept a sequence of password strings, one per
31 line, on the standard input stream. The first is the current password and
32 is ignored. Each subsequent string is a candidate password to be
33 checked. The program must write the following to the standard output
34 stream for each one:
35
36 =over 4
37
38 =item *
39
40 C<0> (zero) and a newline character to indicate that the password is
41 acceptable.
42
43 =item *
44
45 A non-zero decimal number and a newline character to indicate that the
46 password is not acceptable.
47
48 =back
49
50 Further, it must write any error messages only to the standard error
51 stream, not to the standard output stream.
52
53 =head1 EXAMPLES
54
55 The following example program, included in the AFS distribution, verifies
56 that the requested password includes eight or more characters.
57
58    #include <stdio.h>
59    /* prints 0 if the password is long enough, otherwise non-zero */
60    main()
61    {
62    char oldpassword[512];
63    char password[512];
64
65    if (fgets(oldpassword, 512, stdin))
66       while (fgets(password, 512, stdin)) {
67          if (strlen(password) > 8) { /* password includes a newline */
68             fputs("0\n",stdout);
69             fflush(stdout);
70          }
71          else {
72             fputs("Passwords must contain at least 8 characters.\n",
73                   stderr);
74             fputs("1\n",stdout);
75             fflush(stdout);
76          }
77    return 0;
78    }
79
80
81 =head1 SEE ALSO
82
83 L<kas_setpassword(8)>,
84 L<kpasswd(1)>
85
86 =head1 COPYRIGHT
87
88 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
89
90 This documentation is covered by the IBM Public License Version 1.0.  It was
91 converted from HTML to POD by software written by Chas Williams and Russ
92 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.