]> arthur.barton.de Git - netatalk.git/blobdiff - etc/uams/uams_guest.c
Merge remote-tracking branch 'origin/branch-netatalk-3-1'
[netatalk.git] / etc / uams / uams_guest.c
index 963c34ee9d1979776e26024d8971289212d140af..baaf9eb2e611560d4360dc713905acb767fc73fd 100644 (file)
@@ -1,5 +1,4 @@
 /*
- * $Id: uams_guest.c,v 1.16 2009-10-14 01:38:28 didg Exp $
  *
  * (c) 2001 (see COPYING)
  */
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
-
-/* STDC check */
-#if STDC_HEADERS
 #include <string.h>
-#else /* STDC_HEADERS */
-#ifndef HAVE_STRCHR
-#define strchr index
-#define strrchr index
-#endif /* HAVE_STRCHR */
-char *strchr (), *strrchr ();
-#ifndef HAVE_MEMCPY
-#define memcpy(d,s,n) bcopy ((s), (d), (n))
-#define memmove(d,s,n) bcopy ((s), (d), (n))
-#endif /* ! HAVE_MEMCPY */
-#endif /* STDC_HEADERS */
-
 #include <pwd.h>
-#include <atalk/logger.h>
 
+#include <atalk/logger.h>
 #include <atalk/afp.h>
 #include <atalk/uam.h>
 #include <atalk/util.h>
+#include <atalk/compat.h>
 
 #ifndef MIN
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -40,12 +25,12 @@ char *strchr (), *strrchr ();
 
 /*XXX in etc/papd/file.h */
 struct papfile;
-extern void append(struct papfile *, const char *, int);
+extern UAM_MODULE_EXPORT void append(struct papfile *, const char *, int);
 
 /* login and login_ext are almost the same */
 static int noauth_login(void *obj, struct passwd **uam_pwd,
-                       char *ibuf _U_, int ibuflen _U_, 
-                       char *rbuf _U_, int *rbuflen)
+                       char *ibuf _U_, size_t ibuflen _U_, 
+                       char *rbuf _U_, size_t *rbuflen)
 {
     struct passwd *pwent;
     char *guest, *username;
@@ -80,8 +65,8 @@ static int noauth_login(void *obj, struct passwd **uam_pwd,
 }
 
 static int noauth_login_ext(void *obj, char *uname _U_, struct passwd **uam_pwd,
-                     char *ibuf, int ibuflen,
-                     char *rbuf, int *rbuflen)
+                     char *ibuf, size_t ibuflen,
+                     char *rbuf, size_t *rbuflen)
 {
         return ( noauth_login (obj, uam_pwd, ibuf, ibuflen, rbuf, rbuflen));
 }
@@ -136,7 +121,7 @@ static int noauth_printer(char *start, char *stop, char *username, struct papfil
 }
 
 
-static int uam_setup(const char *path)
+static int uam_setup(void *handle, const char *path)
 {
   if (uam_register(UAM_SERVER_LOGIN_EXT, path, "No User Authent",
                    noauth_login, NULL, NULL, noauth_login_ext) < 0)