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