You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.8 KiB

  1. From 1a2e6c979118dce5e79604e88c008c7879d1e4e6 Mon Sep 17 00:00:00 2001
  2. From: Yousong Zhou <yszhou4tech@gmail.com>
  3. Date: Wed, 17 Jun 2015 18:19:23 +0800
  4. Subject: [PATCH 2/7] build: ignore pam_rhosts if neither ruserok nor
  5. ruserok_af is available.
  6. * configure.ac: check for ruserok and ruserok_af
  7. * modules/Makefile.am: ignore pam_rhosts/ if it's disabled
  8. * modules/pam_rhosts/pam_rhosts.c: include stdlib.h for malloc and free
  9. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  10. ---
  11. configure.ac | 5 ++++-
  12. modules/Makefile.am | 11 ++++++++---
  13. modules/pam_rhosts/pam_rhosts.c | 1 +
  14. 3 files changed, 13 insertions(+), 4 deletions(-)
  15. diff --git a/configure.ac b/configure.ac
  16. index 306b6e2..084071a 100644
  17. --- a/configure.ac
  18. +++ b/configure.ac
  19. @@ -524,7 +524,10 @@ AC_CHECK_FUNCS(fseeko getdomainname gethostname gettimeofday lckpwdf mkdir selec
  20. AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
  21. AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
  22. AC_CHECK_FUNCS(getgrouplist getline getdelim)
  23. -AC_CHECK_FUNCS(inet_ntop inet_pton innetgr ruserok_af)
  24. +AC_CHECK_FUNCS(inet_ntop inet_pton innetgr)
  25. +AC_CHECK_FUNCS([ruserok_af ruserok], [break])
  26. +
  27. +AM_CONDITIONAL([COND_BUILD_PAM_RHOSTS], [test "$ac_cv_func_ruserok_af" = yes -o "$ac_cv_func_ruserok" = yes])
  28. AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
  29. AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
  30. diff --git a/modules/Makefile.am b/modules/Makefile.am
  31. index 0c80cea..9ad26a9 100644
  32. --- a/modules/Makefile.am
  33. +++ b/modules/Makefile.am
  34. @@ -2,16 +2,21 @@
  35. # Copyright (c) 2005, 2006, 2008 Thorsten Kukuk <kukuk@thkukuk.de>
  36. #
  37. -SUBDIRS = pam_access pam_cracklib pam_debug pam_deny pam_echo \
  38. +if COND_BUILD_PAM_RHOSTS
  39. + MAYBE_PAM_RHOSTS = pam_rhosts
  40. +endif
  41. +
  42. +SUBDIRS := pam_access pam_cracklib pam_debug pam_deny pam_echo \
  43. pam_env pam_exec pam_faildelay pam_filter pam_ftp \
  44. pam_group pam_issue pam_keyinit pam_lastlog pam_limits \
  45. pam_listfile pam_localuser pam_loginuid pam_mail \
  46. pam_mkhomedir pam_motd pam_namespace pam_nologin \
  47. - pam_permit pam_pwhistory pam_rhosts pam_rootok pam_securetty \
  48. + pam_permit pam_pwhistory pam_rootok pam_securetty \
  49. pam_selinux pam_sepermit pam_shells pam_stress \
  50. pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \
  51. pam_tty_audit pam_umask \
  52. - pam_unix pam_userdb pam_warn pam_wheel pam_xauth
  53. + pam_unix pam_userdb pam_warn pam_wheel pam_xauth \
  54. + $(MAYBE_PAM_RHOSTS)
  55. CLEANFILES = *~
  56. diff --git a/modules/pam_rhosts/pam_rhosts.c b/modules/pam_rhosts/pam_rhosts.c
  57. index bc9e76f..51ef13e 100644
  58. --- a/modules/pam_rhosts/pam_rhosts.c
  59. +++ b/modules/pam_rhosts/pam_rhosts.c
  60. @@ -35,6 +35,7 @@
  61. #include <pwd.h>
  62. #include <netdb.h>
  63. #include <string.h>
  64. +#include <stdlib.h>
  65. #include <syslog.h>
  66. #define PAM_SM_AUTH /* only defines this management group */
  67. --
  68. 1.7.10.4