Ticket #41: zephyr-com-err.patch

File zephyr-com-err.patch, 2.7 KB (added by broder@…, 4 years ago)
  • zephyr/aclocal.m4

    diff --git a/zephyr/aclocal.m4 b/zephyr/aclocal.m4
    index fadf7b4..6106ecf 100644
    a b fi]) 
    194194dnl ----- Kerberos 4 ----- 
    195195 
    196196AC_DEFUN([ATHENA_KRB4_CHECK], 
    197 [AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname)) 
     197[AC_REQUIRE([AC_CANONICAL_TARGET]) 
     198AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname)) 
    198199AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket)) 
    199200AC_CHECK_LIB(gen, compile) 
    200201if test "$krb4" != yes; then 
    AC_CHECK_LIB(krb4, krb_rd_req, 
    210211                           [KRB4_LIBS="-lkrb -ldes"], 
    211212                           [AC_MSG_ERROR(Kerberos 4 libraries not found)], 
    212213                           -ldes)], 
    213              -ldes425 -lkrb5 -lk5crypto -lcom_err)]) 
     214             -ldes425 -lkrb5 -lk5crypto -lcom_err) 
     215if test "$KRB4_LIBS" != "" ; then 
     216        case "$target_os" in 
     217        darwin*) KRB4_LIBS="$KRB4_LIBS -framework Kerberos" 
     218        esac 
     219fi]) 
    214220 
    215221AC_DEFUN([ATHENA_KRB4], 
    216222[AC_ARG_WITH(krb4, 
  • zephyr/configure.in

    diff --git a/zephyr/configure.in b/zephyr/configure.in
    index 3c50b6f..485b6f3 100644
    a b AC_SUBST(lbindir) 
    1010AC_SUBST(lsbindir) 
    1111 
    1212AC_CANONICAL_SYSTEM 
     13AC_CANONICAL_TARGET 
    1314AC_DEFINE_UNQUOTED(MACHINE_TYPE, "$host") 
    1415 
    1516dnl Checks for programs. 
    if test "$krb5" != no; then 
    112113      KRB5_LIBS="-lkrb5 -l5crypto -lcom_err" 
    113114   fi 
    114115   AC_DEFINE(HAVE_KRB5) 
     116 
     117   case "$target_os" in 
     118   darwin*) KRB5_LIBS="$KRB5_LIBS -framework Kerberos" 
     119   esac 
    115120fi 
    116121AC_SUBST(KRB5_LIBS) 
    117122 
  • zephyr/lib/ZInit.c

    diff --git a/zephyr/lib/ZInit.c b/zephyr/lib/ZInit.c
    index 6a9149a..e2efbd7 100644
    a b ZInitialize(void) 
    5959#endif 
    6060#endif 
    6161 
    62 #ifdef HAVE_KRB4 
     62#if defined(__APPLE__) && defined(__MACH__) 
     63    /* On OS X you don't need to initialize the Kerberos error tables 
     64       as long as you link with -framework Kerberos */ 
     65    add_error_table(&et_zeph_error_table); 
     66#else 
     67# ifdef HAVE_KRB4 
    6368    initialize_krb_error_table(); 
    64 #endif 
    65 #ifdef HAVE_KRB5 
     69# endif 
     70# ifdef HAVE_KRB5 
    6671    initialize_krb5_error_table(); 
    67 #endif 
     72# endif 
    6873 
    6974    initialize_zeph_error_table(); 
     75#endif 
    7076     
    7177    (void) memset((char *)&__HM_addr, 0, sizeof(__HM_addr)); 
    7278 
  • zephyr/server/main.c

    diff --git a/zephyr/server/main.c b/zephyr/server/main.c
    index 5188200..7c34217 100644
    a b initialize(void) 
    417417    if (*my_realm)  
    418418      strcpy(__Zephyr_realm, my_realm); 
    419419#endif 
    420     init_zsrv_err_tbl();        /* set up err table */ 
     420 
     421    /* set up err table */ 
     422#if defined(__APPLE__) && defined(__MACH__) 
     423    add_error_table(&et_zsrv_error_table); 
     424#else 
     425    init_zsrv_err_tbl(); 
     426#endif 
    421427 
    422428    ZSetFD(srv_socket);         /* set up the socket as the input fildes */ 
    423429