patch-modules_pam_succeed_if_pam_succeed_if_c 755 B

1234567891011121314151617181920212223
  1. --- Linux-PAM-1.1.8.orig/modules/pam_succeed_if/pam_succeed_if.c 2013-06-18 16:11:21.000000000 +0200
  2. +++ Linux-PAM-1.1.8/modules/pam_succeed_if/pam_succeed_if.c 2013-12-21 18:30:19.000000000 +0100
  3. @@ -233,16 +233,20 @@ evaluate_notingroup(pam_handle_t *pamh,
  4. static int
  5. evaluate_innetgr(const char *host, const char *user, const char *group)
  6. {
  7. +#ifdef HAVE_INNETGR
  8. if (innetgr(group, host, user, NULL) == 1)
  9. return PAM_SUCCESS;
  10. +#endif
  11. return PAM_AUTH_ERR;
  12. }
  13. /* Return PAM_SUCCESS if the (host,user) is NOT in the netgroup. */
  14. static int
  15. evaluate_notinnetgr(const char *host, const char *user, const char *group)
  16. {
  17. +#ifdef HAVE_INNETGR
  18. if (innetgr(group, host, user, NULL) == 0)
  19. return PAM_SUCCESS;
  20. +#endif
  21. return PAM_AUTH_ERR;
  22. }