afsmonitor-update-stat-descriptions-20040729
[openafs.git] / doc / html / AdminReference / auarf203.htm
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 4//EN">
2 <HTML><HEAD>
3 <TITLE>Administration Reference</TITLE>
4 <!-- Begin Header Records  ========================================== -->
5 <!-- /tmp/idwt3672/auarf000.scr converted by idb2h R4.2 (359) ID      -->
6 <!-- Workbench Version (AIX) on 3 Oct 2000 at 16:18:30                -->
7 <META HTTP-EQUIV="updated" CONTENT="Tue, 03 Oct 2000 16:18:29">
8 <META HTTP-EQUIV="review" CONTENT="Wed, 03 Oct 2001 16:18:29">
9 <META HTTP-EQUIV="expires" CONTENT="Thu, 03 Oct 2002 16:18:29">
10 </HEAD><BODY>
11 <!-- (C) IBM Corporation 2000. All Rights Reserved    --> 
12 <BODY bgcolor="ffffff"> 
13 <!-- End Header Records  ============================================ -->
14 <A NAME="Top_Of_Page"></A>
15 <H1>Administration Reference</H1>
16 <HR><P ALIGN="center"> <A HREF="../index.htm"><IMG SRC="../books.gif" BORDER="0" ALT="[Return to Library]"></A> <A HREF="auarf002.htm#ToC"><IMG SRC="../toc.gif" BORDER="0" ALT="[Contents]"></A> <A HREF="auarf202.htm"><IMG SRC="../prev.gif" BORDER="0" ALT="[Previous Topic]"></A> <A HREF="#Bot_Of_Page"><IMG SRC="../bot.gif" BORDER="0" ALT="[Bottom of Topic]"></A> <A HREF="auarf204.htm"><IMG SRC="../next.gif" BORDER="0" ALT="[Next Topic]"></A> <A HREF="auarf284.htm#HDRINDEX"><IMG SRC="../index.gif" BORDER="0" ALT="[Index]"></A> <P> 
17 <P>
18 <H2><A NAME="HDRKPWVALID" HREF="auarf002.htm#ToC_217">kpwvalid</A></H2>
19 <A NAME="IDX5194"></A>
20 <A NAME="IDX5195"></A>
21 <A NAME="IDX5196"></A>
22 <P><STRONG>Purpose</STRONG>
23 <P>Checks quality of new password
24 <P><STRONG>Description</STRONG>
25 <P>The <B>kpwvalid</B> command checks the quality of a new password passed
26 to it from the <B>kpasswd</B> or <B>kas setpassword</B>
27 command. It is optional. If it exists, it must reside in the
28 same AFS directory as the binaries for the <B>kpasswd</B> and
29 <B>kas</B> command suites (create a symbolic link from the client
30 machine's local disk to this directory). The directory's ACL
31 must extend the <B>a</B> (<B>administer</B>) and <B>w</B>
32 (<B>write</B>) permissions to the <B>system:administrators</B>
33 group only. These requirements prevent unauthorized users from
34 substituting a spurious <B>kpwvalid</B> binary.
35 <P>The AFS distribution includes an example <B>kpwvalid</B> program that
36 checks that the password is at least eight characters long; the code for
37 it appears in the following <B>Examples</B> section.
38 <P>The script or program must accept a sequence of password strings, one per
39 line, on the standard input stream. The first is the current password
40 and is ignored. Each subsequent string is a candidate password to be
41 checked. The program must write the following to the standard output
42 stream for each one:
43 <UL>
44 <P><LI><TT>0</TT> (zero) and a newline character to indicate that the password
45 is acceptable
46 <P><LI>A non-zero decimal number and a newline character to indicate that the
47 password is not acceptable
48 </UL>
49 <P>Further, it must write any error messages only to the standard error
50 stream, not to the standard output stream.
51 <P><STRONG>Examples</STRONG>
52 <P>The following example program, included in the AFS distribution, verifies
53 that the requested password includes eight or more characters.
54 <PRE>   #include &lt;stdio.h>
55    /* prints 0 if the password is long enough, otherwise non-zero */
56    main()
57    {
58    char oldpassword[512];
59    char password[512];
60    
61    if (fgets(oldpassword, 512, stdin))
62       while (fgets(password, 512, stdin)) {
63          if (strlen(password) > 8) { /* password includes a newline */
64             fputs("0\n",stdout);
65             fflush(stdout);
66          }
67          else {
68             fputs("Passwords must contain at least 8 characters.\n",
69                   stderr);
70             fputs("1\n",stdout);
71             fflush(stdout);
72          }
73    return 0;
74    }
75    
76 </PRE>
77 <P><STRONG>Related Information</STRONG>
78 <P><A HREF="auarf194.htm#HDRKAS_SETPASSWORD">kas setpassword</A>
79 <P><A HREF="auarf202.htm#HDRKPASSWD">kpasswd</A>
80 <P>
81 <HR><P ALIGN="center"> <A HREF="../index.htm"><IMG SRC="../books.gif" BORDER="0" ALT="[Return to Library]"></A> <A HREF="auarf002.htm#ToC"><IMG SRC="../toc.gif" BORDER="0" ALT="[Contents]"></A> <A HREF="auarf202.htm"><IMG SRC="../prev.gif" BORDER="0" ALT="[Previous Topic]"></A> <A HREF="#Top_Of_Page"><IMG SRC="../top.gif" BORDER="0" ALT="[Top of Topic]"></A> <A HREF="auarf204.htm"><IMG SRC="../next.gif" BORDER="0" ALT="[Next Topic]"></A> <A HREF="auarf284.htm#HDRINDEX"><IMG SRC="../index.gif" BORDER="0" ALT="[Index]"></A> <P> 
82 <!-- Begin Footer Records  ========================================== -->
83 <P><HR><B> 
84 <br>&#169; <A HREF="http://www.ibm.com/">IBM Corporation 2000.</A>  All Rights Reserved 
85 </B> 
86 <!-- End Footer Records  ============================================ -->
87 <A NAME="Bot_Of_Page"></A>
88 </BODY></HTML>