]> arthur.barton.de Git - netatalk.git/blobdiff - etc/uams/uams_randnum.c
Removing ressource fork AppleDouble fails, bug #542
[netatalk.git] / etc / uams / uams_randnum.c
index c9a275ba792d2394befb2760b2bd095794c8ff8b..50ce6ce5fadc05c594be6f541ba2827ce415b363 100644 (file)
@@ -1,5 +1,4 @@
 /* 
- * $Id: uams_randnum.c,v 1.21 2010-03-30 10:25:49 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
 #include <ctype.h>
 #include <pwd.h>
 #include <sys/stat.h>
 #include <sys/param.h>
+#include <arpa/inet.h>
 
 #include <atalk/logger.h>
-
-#include <netatalk/endian.h>
-
 #include <atalk/afp.h>
 #include <atalk/uam.h>
 
@@ -43,7 +36,7 @@
 static C_Block         seskey;
 static Key_schedule    seskeysched;
 static struct passwd   *randpwd;
-static u_int8_t         randbuf[8];
+static uint8_t         randbuf[8];
 
 /* hash to a 16-bit number. this will generate completely harmless 
  * warnings on 64-bit machines. */
@@ -129,7 +122,7 @@ static int afppasswd(const struct passwd *pwd,
                     unsigned char *passwd, int len, 
                     const int set)
 {
-  u_int8_t key[DES_KEY_SZ*2];
+  uint8_t key[DES_KEY_SZ*2];
   char buf[MAXPATHLEN + 1], *p;
   Key_schedule schedule;
   FILE *fp;
@@ -290,7 +283,7 @@ static int rand_login(void *obj, char *username, int ulen, struct passwd **uam_p
 {
 
   char *passwdfile;
-  u_int16_t sessid;
+  uint16_t sessid;
   size_t len;
   int err;
  
@@ -335,7 +328,7 @@ static int randnum_logincont(void *obj, struct passwd **uam_pwd,
                             char *ibuf, size_t ibuflen _U_, 
                             char *rbuf _U_, size_t *rbuflen)
 {
-  u_int16_t sessid;
+  uint16_t sessid;
 
   *rbuflen = 0;
 
@@ -374,7 +367,7 @@ static int rand2num_logincont(void *obj, struct passwd **uam_pwd,
                              char *ibuf, size_t ibuflen _U_, 
                              char *rbuf, size_t *rbuflen)
 {
-  u_int16_t sessid;
+  uint16_t sessid;
   unsigned int i;
 
   *rbuflen = 0;
@@ -517,7 +510,7 @@ static int randnum_login_ext(void *obj, char *uname, struct passwd **uam_pwd,
 {
     char       *username;
     size_t     len, ulen;
-    u_int16_t  temp16;
+    uint16_t  temp16;
 
     *rbuflen = 0;
 
@@ -538,7 +531,7 @@ static int randnum_login_ext(void *obj, char *uname, struct passwd **uam_pwd,
     return (rand_login(obj, username, ulen, uam_pwd, ibuf, ibuflen, rbuf, rbuflen));
 }
 
-static int uam_setup(const char *path)
+static int uam_setup(void *obj, const char *path)
 {
   if (uam_register(UAM_SERVER_LOGIN_EXT, path, "Randnum exchange", 
                   randnum_login, randnum_logincont, NULL, randnum_login_ext) < 0)