0003-build-ignore-pam_lastlog-when-logwtmp-is-not-availab.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From bac1ee3033cf22e31730fe3e77ca82bd5ebba692 Mon Sep 17 00:00:00 2001
  2. From: Yousong Zhou <yszhou4tech@gmail.com>
  3. Date: Wed, 17 Jun 2015 21:18:05 +0800
  4. Subject: [PATCH 3/7] build: ignore pam_lastlog when logwtmp is not available.
  5. * configure.ac: check logwtmp and set COND_BUILD_PAM_LASTLOG
  6. * modules/pam_lastlog/Makefile.am: check COND_BUILD_PAM_LASTLOG
  7. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  8. ---
  9. configure.ac | 2 ++
  10. modules/Makefile.am | 8 ++++++--
  11. 2 files changed, 8 insertions(+), 2 deletions(-)
  12. diff --git a/configure.ac b/configure.ac
  13. index 084071a..ca4bf5b 100644
  14. --- a/configure.ac
  15. +++ b/configure.ac
  16. @@ -536,8 +536,10 @@ AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r
  17. AC_CHECK_FUNCS(getgrouplist getline getdelim)
  18. AC_CHECK_FUNCS(inet_ntop inet_pton innetgr)
  19. AC_CHECK_FUNCS([ruserok_af ruserok], [break])
  20. +AC_CHECK_FUNCS([logwtmp])
  21. AM_CONDITIONAL([COND_BUILD_PAM_RHOSTS], [test "$ac_cv_func_ruserok_af" = yes -o "$ac_cv_func_ruserok" = yes])
  22. +AM_CONDITIONAL([COND_BUILD_PAM_LASTLOG], [test "$ac_cv_func_logwtmp" = yes])
  23. AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
  24. AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
  25. diff --git a/modules/Makefile.am b/modules/Makefile.am
  26. index 9ad26a9..b98dc5c 100644
  27. --- a/modules/Makefile.am
  28. +++ b/modules/Makefile.am
  29. @@ -6,9 +6,13 @@ if COND_BUILD_PAM_RHOSTS
  30. MAYBE_PAM_RHOSTS = pam_rhosts
  31. endif
  32. +if COND_BUILD_PAM_LASTLOG
  33. + MAYBE_PAM_LASTLOG = pam_lastlog
  34. +endif
  35. +
  36. SUBDIRS := pam_access pam_cracklib pam_debug pam_deny pam_echo \
  37. pam_env pam_exec pam_faildelay pam_filter pam_ftp \
  38. - pam_group pam_issue pam_keyinit pam_lastlog pam_limits \
  39. + pam_group pam_issue pam_keyinit pam_limits \
  40. pam_listfile pam_localuser pam_loginuid pam_mail \
  41. pam_mkhomedir pam_motd pam_namespace pam_nologin \
  42. pam_permit pam_pwhistory pam_rootok pam_securetty \
  43. @@ -16,7 +20,7 @@ SUBDIRS := pam_access pam_cracklib pam_debug pam_deny pam_echo \
  44. pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \
  45. pam_tty_audit pam_umask \
  46. pam_unix pam_userdb pam_warn pam_wheel pam_xauth \
  47. - $(MAYBE_PAM_RHOSTS)
  48. + $(MAYBE_PAM_RHOSTS) $(MAYBE_PAM_LASTLOG)
  49. CLEANFILES = *~
  50. --
  51. 1.7.10.4