summaryrefslogtreecommitdiff
path: root/modules/pam_tally/pam_tally.c
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2007-11-20 10:58:10 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2007-11-20 10:58:10 +0000
commit16b369e3ffcac0a88065b0393067bb28d166904d (patch)
tree2f9cab426cb7eba2502732c4c8c156face315f91 /modules/pam_tally/pam_tally.c
parentdee497d659371fdb793c8ec8e220d72ccaa02332 (diff)
Relevant BUGIDs: 1822779
Purpose of commit: bugfix Commit summary: --------------- Don't link pam_tally application against libpam, if linked static, libpam is not yet available. 2007-11-20 Thorsten Kukuk <kukuk@thkukuk.de> * modules/pam_tally/pam_tally.c (tally_log): Map pam_modutil_getpwnam to getpwnam if we don't compile as module. * modules/pam_tally/Makefile.am: Don't link pam_tally_app against libpam (#1822779).
Diffstat (limited to 'modules/pam_tally/pam_tally.c')
-rw-r--r--modules/pam_tally/pam_tally.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/pam_tally/pam_tally.c b/modules/pam_tally/pam_tally.c
index fc818ffe..8814659a 100644
--- a/modules/pam_tally/pam_tally.c
+++ b/modules/pam_tally/pam_tally.c
@@ -37,14 +37,16 @@
* modules include file to define the function prototypes.
*/
+#ifndef MAIN
#define PAM_SM_AUTH
#define PAM_SM_ACCOUNT
/* #define PAM_SM_SESSION */
/* #define PAM_SM_PASSWORD */
-#include <security/pam_modules.h>
#include <security/pam_modutil.h>
#include <security/pam_ext.h>
+#endif
+#include <security/pam_modules.h>
#ifndef TRUE
#define TRUE 1L
@@ -115,6 +117,9 @@ tally_log (const pam_handle_t *pamh UNUSED, int priority UNUSED,
fprintf(stderr,"\n");
va_end(args);
}
+
+#define pam_modutil_getpwnam(pamh,user) getpwnam(user)
+
#endif
/*---------------------------------------------------------------------*/
@@ -353,7 +358,7 @@ get_tally(pam_handle_t *pamh, tally_t *tally, uid_t uid,
return PAM_AUTH_ERR;
}
- if ( fileinfo.st_size <= uid * sizeof(struct faillog) ) {
+ if ( (size_t)fileinfo.st_size <= uid * sizeof(struct faillog) ) {
memset(fsp, 0, sizeof(struct faillog));
*tally=0;