]> arthur.barton.de Git - netatalk.git/blobdiff - bin/afppasswd/afppasswd.c
Move function cnid_for_path to CNID utility libatalk file
[netatalk.git] / bin / afppasswd / afppasswd.c
index 4c56875d1d59e07566bb69e5829ba7869bb99c35..f5778a53d03ba6b398ece79cb0d163ba44a7eb8e 100644 (file)
@@ -1,6 +1,4 @@
 /* 
- * $Id: afppasswd.c,v 1.19 2005-04-28 20:49:19 bfernhomberg Exp $
- *
  * Copyright 1999 (c) Adrian Sun (asun@u.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
  *
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif /* HAVE_UNISTD_H */
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>
-#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
 #include <pwd.h>
-
-#include <netatalk/endian.h>
+#include <arpa/inet.h>
 
 #include <des.h>
 
@@ -71,7 +64,7 @@ static char buf[MAXPATHLEN + 1];
 #define unhex(x)  (isdigit(x) ? (x) - '0' : toupper(x) + 10 - 'A')
 static void convert_passwd(char *buf, char *newpwd, const int keyfd)
 {
-  u_int8_t key[HEXPASSWDLEN];
+  uint8_t key[HEXPASSWDLEN];
   Key_schedule schedule;
   unsigned int i, j;
 
@@ -270,6 +263,7 @@ int main(int argc, char **argv)
   flags = ((uid = getuid()) == 0) ? OPT_ISROOT : 0;
 
   if (((flags & OPT_ISROOT) == 0) && (argc > 1)) {
+    fprintf(stderr, "afppasswd (Netatalk %s)\n", VERSION);
     fprintf(stderr, "Usage: afppasswd [-acfn] [-u minuid] [-p path] [username]\n");
     fprintf(stderr, "  -a        add a new user\n");
     fprintf(stderr, "  -c        create and initialize password file or specific user\n");