]> arthur.barton.de Git - netatalk.git/blobdiff - etc/uams/uams_guest.c
Try using Tracker 0.15 from OpenCSW
[netatalk.git] / etc / uams / uams_guest.c
index 42a2bc371ccc49807ce2ac87b44ad3ba89a36037..82ee43ef5d552dc3fe7fc78441942c125a368bd0 100644 (file)
@@ -1,5 +1,4 @@
 /*
- * $Id: uams_guest.c,v 1.13 2005-04-28 20:49:50 bfernhomberg Exp $
  *
  * (c) 2001 (see COPYING)
  */
@@ -8,43 +7,30 @@
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
-#ifndef ATACC
 #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))
 #endif /* MIN */
 
-extern void append(void *, const char *, int);
+/*XXX in etc/papd/file.h */
+struct papfile;
+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;
@@ -79,17 +65,15 @@ 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));
 }
 
 
 /* Printer NoAuthUAM Login */
-int noauth_printer(start, stop, username, out)
-       char    *start, *stop, *username;
-       struct papfile  *out;
+static int noauth_printer(char *start, char *stop, char *username, struct papfile *out)
 {
     char       *data, *p, *q;
     static const char *loginok = "0\r";
@@ -150,7 +134,7 @@ static int uam_setup(const char *path)
   return 0;
 }
 
-static void uam_cleanup()
+static void uam_cleanup(void)
 {
   uam_unregister(UAM_SERVER_LOGIN, "No User Authent");
   uam_unregister(UAM_SERVER_PRINTAUTH, "NoAuthUAM");
@@ -161,4 +145,3 @@ UAM_MODULE_EXPORT struct uam_export uams_guest = {
   UAM_MODULE_VERSION,
   uam_setup, uam_cleanup
 };
-#endif