Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / kauth / kpwvalid.c
blob89957051edecbb5cad4983946dcdd1e883203e09
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
10 #include <afsconfig.h>
11 #include <afs/param.h>
14 #include <stdio.h>
15 #include <string.h>
16 #ifdef AFS_NT40_ENV
17 #include <WINNT/afsevent.h>
18 #endif
19 #include <afs/afsutil.h>
21 #include "AFS_component_version_number.c"
23 /* returns 0 if the password is long enough, otherwise non-zero */
24 int
25 main(int argc, char *argv[])
27 char oldpassword[512];
28 char password[512];
29 int rc = 1;
31 if (fgets(oldpassword, 512, stdin))
32 while (fgets(password, 512, stdin)) {
33 if (strlen(password) > 8) { /* password includes a newline */
34 rc = 0;
35 fputs("0\n", stdout);
36 fflush(stdout);
37 } else {
38 rc = 1;
39 fputs("Passwords must contain at least 8 characters.\n",
40 stderr);
41 fputs("1\n", stdout);
42 fflush(stdout);
45 return rc;