]> git.saurik.com Git - apple/system_cmds.git/blobdiff - chkpasswd.tproj/passwd.c
system_cmds-880.40.5.tar.gz
[apple/system_cmds.git] / chkpasswd.tproj / passwd.c
index 408fe0326c882633a4eac90f92e7543f5e311baa..bff82809172ed282d614a8eee491efeeb2a42fd3 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1999-2016 Apple Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
- * 
+ *
  * "Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
  * Reserved.  This file contains Original Code and/or Modifications of
  * Original Code as defined in and that are subject to the Apple Public
@@ -10,7 +10,7 @@
  * except in compliance with the License.  Please obtain a copy of the
  * License at http://www.apple.com/publicsource and read it before using
  * this file.
- * 
+ *
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
@@ -18,7 +18,7 @@
  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
  * License for the specific language governing rights and limitations
  * under the License."
- * 
+ *
  * @APPLE_LICENSE_HEADER_END@
  */
 #define INFO_FILE 1
 #define _PASSWORD_LEN 8
 #endif
 
+#include "passwd.h"
+
 const char* progname = "chkpasswd";
 
 static int literal = 0;
 
-extern int file_check_passwd(char *, char *);
-extern int nis_check_passwd(char *, char *);
-extern int od_check_passwd(char *, char *);
-extern int pam_check_passwd(char *);
-
 void
 checkpasswd(char *name, char *old_pw)
 {
@@ -80,8 +77,8 @@ checkpasswd(char *name, char *old_pw)
        return;
 }
 
-void
-usage()
+static void
+usage(void)
 {
        fprintf(stderr, "usage: chkpasswd [-i infosystem] [-l location] [-c] [name]\n");
        fprintf(stderr, "  infosystem:\n");
@@ -139,7 +136,7 @@ main(int argc, char *argv[])
        }
        argc -= optind;
        argv += optind;
-               
+
        if (argc > 1) {
                usage();
        } else if (argc == 1) {
@@ -156,7 +153,7 @@ main(int argc, char *argv[])
                        exit(1);
                }
        }
-       
+
        switch (infosystem)
        {
                case INFO_FILE:
@@ -175,4 +172,3 @@ main(int argc, char *argv[])
 
        exit(0);
 }
-