Ticket #20424: quagga-patch2.diff

File quagga-patch2.diff, 2.0 KB (added by mike-savory, 10 years ago)
  • configure.ac

     -  sourced from http://marc.info/?l=quagga-dev&m=122470855231006&w=2
     - configure.ac - pam module - we are searching for pam_misc.h also in pam/ - default location in OSX
     - vtysh/vtysh_user.c - Added #ifdef and #include for pam on OSX.
     - configure.ac - bsd linkdetect hack - On OSX we assume that bsdlinkdetect is not supported.
     -  OSX have tested ifm_status value but don't have ifi_link_state value in if_data struct.
    
    case "$host" in 
    530530      AC_CHECK_LIB(nsl, main)
    531531      CURSES=-lcurses
    532532  ;;
     533  *-darwin*)
     534      opsys=darwin
     535  ;;
    533536  *-linux*)
    534537      opsys=gnu-linux
    535538      AC_DEFINE(GNU_LINUX,,GNU Linux)
    if test "$with_libpam" = "yes"; then 
    604604     pam_conv_func="misc_conv"
    605605    ],
    606606    [], QUAGGA_INCLUDES)
     607  AC_CHECK_HEADER([pam/pam_misc.h],
     608    [AC_DEFINE(HAVE_PAM_MISC_H,,Have pam_misc.h)
     609     AC_DEFINE(PAM_CONV_FUNC,misc_conv,Have misc_conv)
     610     pam_conv_func="misc_conv"
     611    ],
     612    [], QUAGGA_INCLUDES)
    607613  AC_CHECK_HEADER([security/openpam.h],
    608614    [AC_DEFINE(HAVE_OPENPAM_H,,Have openpam.h)
    609615     AC_DEFINE(PAM_CONV_FUNC,openpam_ttyconv,Have openpam_ttyconv)
    AC_MSG_RESULT(no)) 
    917917dnl ---------------------------------------------------------------
    918918dnl figure out how to check link-state
    919919dnl ---------------------------------------------------------------
     920if test "$opsys" != "darwin"; then
    920921AC_CHECK_HEADER([net/if.h],
    921922  [AC_CHECK_HEADER( [net/if_media.h],
    922923    [m4_define([LINK_DETECT_INCLUDES],
    AC_CHECK_HEADER([net/if.h], 
    929929    [],
    930930    QUAGGA_INCLUDES)],
    931931  [], QUAGGA_INCLUDES )
     932fi
    932933
    933934dnl ------------------------
    934935dnl TCP_MD5SIG socket option
  • vtysh/vtysh_user.c

     
    2525#include <pwd.h>
    2626
    2727#ifdef USE_PAM
     28#ifdef __APPLE__
     29#include <pam/pam_appl.h>
     30#else
    2831#include <security/pam_appl.h>
     32#endif
    2933#ifdef HAVE_PAM_MISC_H
     34#ifdef __APPLE__
     35#include <pam/pam_misc.h>
     36#else
    3037#include <security/pam_misc.h>
    3138#endif
     39#endif
    3240#ifdef HAVE_OPENPAM_H
    3341#include <security/openpam.h>
    3442#endif