X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fuams%2Fuams_pam.c;h=b490c2ee20aaf81cd5d5f61888a49a03680e4cc2;hb=9f957894d9a60f32adc56edddf72fa767ded8219;hp=37597f75bea20cbdea532e6df40f90b3c978d6d6;hpb=d0f90628ecad684ef1b417471ea3f76292964b11;p=netatalk.git diff --git a/etc/uams/uams_pam.c b/etc/uams/uams_pam.c index 37597f75..b490c2ee 100644 --- a/etc/uams/uams_pam.c +++ b/etc/uams/uams_pam.c @@ -1,5 +1,4 @@ /* - * $Id: uams_pam.c,v 1.21 2009-10-15 11:39:48 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) @@ -15,34 +14,20 @@ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ - -/* STDC check */ -#if STDC_HEADERS #include -#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 - #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #ifdef HAVE_PAM_PAM_APPL_H #include #endif +#include #include #include #include +#include +#include #define PASSWDLEN 8 @@ -55,20 +40,24 @@ char *strchr (), *strrchr (); * and the server_login function */ static pam_handle_t *pamh = NULL; -static char *hostname; +static const char *hostname; static char *PAM_username; 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, +#ifdef LINUX const struct pam_message **msg, +#else + struct pam_message **msg, +#endif struct pam_response **resp, void *appdata_ptr _U_) { @@ -156,7 +145,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 +242,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;