]> arthur.barton.de Git - netatalk.git/blobdiff - etc/uams/uams_pam.c
Fix several warnings, remove const
[netatalk.git] / etc / uams / uams_pam.c
index 25ee5814b3ae440231bea067e65025fba1fe1f4e..c3762c94a8e98ac021a368c3b719eb5c06acfd98 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_pam.c,v 1.22 2009-11-05 14:38:07 franklahm Exp $
+ * $Id: uams_pam.c,v 1.24 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) 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif /* HAVE_UNISTD_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 <atalk/logger.h>
-
 #ifdef HAVE_SECURITY_PAM_APPL_H
 #include <security/pam_appl.h>
 #endif
 #ifdef HAVE_PAM_PAM_APPL_H
 #include <pam/pam_appl.h>
 #endif
+#include <arpa/inet.h>
 
 #include <atalk/afp.h>
 #include <atalk/uam.h>
 #include <atalk/util.h>
+#include <atalk/logger.h>
+#include <atalk/compat.h>
 
 #define PASSWDLEN 8
 
@@ -61,14 +47,14 @@ static char *PAM_password;
 
 /*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);
 
 /* PAM conversation function
  * Here we assume (for now, at least) that echo on means login name, and
  * echo off means password.
  */
 static int PAM_conv (int num_msg,
-                     const struct pam_message **msg,
+                     struct pam_message **msg,
                      struct pam_response **resp,
                      void *appdata_ptr _U_) 
 {
@@ -156,7 +142,7 @@ static int login(void *obj, char *username, int ulen,  struct passwd **uam_pwd,
     ibuf[ PASSWDLEN ] = '\0';
 
     if (( pwd = uam_getname(obj, username, ulen)) == NULL ) {
-       return AFPERR_PARAM;
+       return AFPERR_NOTAUTH;
     }
 
     LOG(log_info, logtype_uams, "cleartext login: %s", username);
@@ -253,7 +239,7 @@ static int pam_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;