Relevant BUGIDs: 1822779
authorThorsten Kukuk <kukuk@thkukuk.de>
Tue, 20 Nov 2007 10:58:10 +0000 (10:58 +0000)
committerThorsten Kukuk <kukuk@thkukuk.de>
Tue, 20 Nov 2007 10:58:10 +0000 (10:58 +0000)
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).

ChangeLog
modules/pam_tally/Makefile.am
modules/pam_tally/pam_tally.c

index 1209c9ea82b208d0d78b877cd5666179a7120bf4..ace526d57a3aedfb3fe0dbb711cbed881c9033bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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).
+
 2007-11-06  Thorsten Kukuk  <kukuk@thkukuk.de>
 
        * xtests/tst-pam_group1.c: Include stdlib.h
index 4fad738f011c7e35987bbd43f4ac2f32fd203587..c4c181a9c537c225ccedd0b5ca6297d9ef569790 100644 (file)
@@ -28,11 +28,9 @@ securelib_LTLIBRARIES = pam_tally.la
 sbin_PROGRAMS = pam_tally
 
 pam_tally_SOURCES = pam_tally_app.c
-pam_tally_LDADD = -L$(top_builddir)/libpam -lpam
 
 if ENABLE_REGENERATE_MAN
 noinst_DATA = README
 README: pam_tally.8.xml
 -include $(top_srcdir)/Make.xml.rules
 endif
-
index fc818ffef3025797aae2cf1c4128407de01a4fb5..8814659a5f17a72cb99378ee1c480fb1c7574306 100644 (file)
  * 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;