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