diff options
author | Jeremy Allison <jra@samba.org> | 2003-01-21 06:23:49 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-01-21 06:23:49 +0000 |
commit | b0aadff2020886cbc2a35bf115e6c359ff28d870 (patch) | |
tree | 55563d520ad2dd34f01140c656bf1abc01368f28 | |
parent | 2d12fa42941d708f851283833ee35d9c507ea4d8 (diff) | |
download | samba-b0aadff2020886cbc2a35bf115e6c359ff28d870.tar.gz samba-b0aadff2020886cbc2a35bf115e6c359ff28d870.tar.bz2 samba-b0aadff2020886cbc2a35bf115e6c359ff28d870.zip |
More fixes getting us closer to full Heimdal compile....
Jeremy.
(This used to be commit a7ee6ed64500a0d949849da6996b7dc837518f00)
-rwxr-xr-x | source3/configure | 107 | ||||
-rw-r--r-- | source3/configure.in | 15 | ||||
-rw-r--r-- | source3/include/config.h.in | 6 | ||||
-rw-r--r-- | source3/libads/krb5_setpw.c | 18 | ||||
-rw-r--r-- | source3/libsmb/clikrb5.c | 20 |
5 files changed, 155 insertions, 11 deletions
diff --git a/source3/configure b/source3/configure index b950ed6fd3..7ec6b6ec22 100755 --- a/source3/configure +++ b/source3/configure @@ -21193,6 +21193,113 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for addrtype in krb5_address" >&5 +echo $ECHO_N "checking for addrtype in krb5_address... $ECHO_C" >&6 +if test "${samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <krb5.h> +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +krb5_address kaddr; kaddr.addrtype = ADDRTYPE_INET; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS" >&5 +echo "${ECHO_T}$samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS" >&6 +if test x"$samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ADDRTYPE_IN_KRB5_ADDRESS 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for addr_type in krb5_address" >&5 +echo $ECHO_N "checking for addr_type in krb5_address... $ECHO_C" >&6 +if test "${samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <krb5.h> +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +krb5_address kaddr; kaddr.addr_type = KRB5_ADDRESS_INET; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS" >&5 +echo "${ECHO_T}$samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS" >&6 +if test x"$samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ADDR_TYPE_IN_KRB5_ADDRESS 1 +_ACEOF + +fi ######################################################## # now see if we can find the krb5 libs in standard paths diff --git a/source3/configure.in b/source3/configure.in index 5c2a659fbd..dd145409c5 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -2045,6 +2045,21 @@ fi AC_CHECK_LIB(krb5, krb5_set_default_in_tkt_etypes, [AC_DEFINE(HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES,1,[Whether krb5_set_default_in_tkt_etypes, is available])]) AC_CHECK_LIB(krb5, krb5_set_default_tgs_ktypes, [AC_DEFINE(HAVE_KRB5_SET_DEFAULT_TGS_KTYPES,1,[Whether krb5_set_default_tgs_ktypes is available])]) +AC_CACHE_CHECK([for addrtype in krb5_address],samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS,[ +AC_TRY_COMPILE([#include <krb5.h>], +[krb5_address kaddr; kaddr.addrtype = ADDRTYPE_INET;], +samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=yes,samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=no)]) +if test x"$samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS" = x"yes"; then + AC_DEFINE(HAVE_ADDRTYPE_IN_KRB5_ADDRESS,1,[Whether the krb5_address struct has a addrtype property]) +fi + +AC_CACHE_CHECK([for addr_type in krb5_address],samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS,[ +AC_TRY_COMPILE([#include <krb5.h>], +[krb5_address kaddr; kaddr.addr_type = KRB5_ADDRESS_INET;], +samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=yes,samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=no)]) +if test x"$samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS" = x"yes"; then + AC_DEFINE(HAVE_ADDR_TYPE_IN_KRB5_ADDRESS,1,[Whether the krb5_address struct has a addr_type property]) +fi ######################################################## # now see if we can find the krb5 libs in standard paths diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 0c4b1021a0..36e200eaa0 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -263,6 +263,12 @@ /* Whether acl_get_perm_np() is available */ #undef HAVE_ACL_GET_PERM_NP +/* Whether the krb5_address struct has a addrtype property */ +#undef HAVE_ADDRTYPE_IN_KRB5_ADDRESS + +/* Whether the krb5_address struct has a addr_type property */ +#undef HAVE_ADDR_TYPE_IN_KRB5_ADDRESS + /* Whether AIX ACLs are available */ #undef HAVE_AIX_ACLS diff --git a/source3/libads/krb5_setpw.c b/source3/libads/krb5_setpw.c index 8079c0953f..73d370d75f 100644 --- a/source3/libads/krb5_setpw.c +++ b/source3/libads/krb5_setpw.c @@ -141,7 +141,7 @@ static krb5_error_code build_setpw_request(krb5_context context, packet->data = (char *)malloc(ap_req->length + cipherpw.length + 6); /* see the RFC for details */ - p = packet->data + 2; + p = ((char *)packet->data) + 2; RSSVAL(p, 0, 0xff80); p += 2; RSSVAL(p, 0, ap_req->length); p += 2; memcpy(p, ap_req->data, ap_req->length); p += ap_req->length; @@ -172,10 +172,10 @@ static krb5_error_code parse_setpw_reply(krb5_context context, p = packet->data; - if (packet->data[0] == 0x7e || packet->data[0] == 0x5e) { + if (((char *)packet->data)[0] == 0x7e || ((char *)packet->data)[0] == 0x5e) { /* it's an error packet. We should parse it ... */ DEBUG(1,("Got error packet 0x%x from kpasswd server\n", - packet->data[0])); + ((char *)packet->data)[0])); return KRB5KRB_AP_ERR_MODIFIED; } @@ -196,7 +196,7 @@ static krb5_error_code parse_setpw_reply(krb5_context context, ap_rep.length = RSVAL(p, 0); p += 2; - if (p + ap_rep.length >= packet->data + packet->length) { + if (p + ap_rep.length >= (char *)packet->data + packet->length) { DEBUG(1,("ptr beyond end of packet from kpasswd server\n")); return KRB5KRB_AP_ERR_MODIFIED; } @@ -219,7 +219,7 @@ static krb5_error_code parse_setpw_reply(krb5_context context, krb5_free_ap_rep_enc_part(context, ap_rep_enc); cipherresult.data = p; - cipherresult.length = (packet->data + packet->length) - p; + cipherresult.length = ((char *)packet->data + packet->length) - p; ret = krb5_rd_priv(context, auth_context, &cipherresult, &clearresult, &replay); @@ -353,12 +353,8 @@ ADS_STATUS krb5_set_password(const char *kdc_host, const char *princ, const char addr_len = sizeof(local_addr); getsockname(sock, &local_addr, &addr_len); - remote_kaddr.addrtype = ADDRTYPE_INET; - remote_kaddr.length = sizeof(((struct sockaddr_in *)&remote_addr)->sin_addr); - remote_kaddr.contents = (char *)&(((struct sockaddr_in *)&remote_addr)->sin_addr); - local_kaddr.addrtype = ADDRTYPE_INET; - local_kaddr.length = sizeof(((struct sockaddr_in *)&local_addr)->sin_addr); - local_kaddr.contents = (char *)&(((struct sockaddr_in *)&local_addr)->sin_addr); + setup_kaddr(&remote_kaddr, &remote_addr); + setup_kaddr(&local_kaddr, &local_addr); ret = krb5_auth_con_setaddrs(context, auth_context, &local_kaddr, NULL); if (ret) { diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c index 8b89763c3f..b56de62730 100644 --- a/source3/libsmb/clikrb5.c +++ b/source3/libsmb/clikrb5.c @@ -50,6 +50,26 @@ krb5_error_code krb5_set_default_tgs_ktypes(krb5_context ctx, const krb5_enctype } #endif +#if defined(HAVE_ADDR_TYPE_IN_KRB5_ADDRESS) +/* HEIMDAL */ +void setup_kaddr( krb5_address *pkaddr, struct sockaddr *paddr) +{ + pkaddr->addr_type = KRB5_ADDRESS_INET; + pkaddr->address.length = sizeof(((struct sockaddr_in *)paddr)->sin_addr); + pkaddr->address.data = (char *)&(((struct sockaddr_in *)paddr)->sin_addr); +} +#elif defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) +/* MIT */ +void setup_kaddr( krb5_address *pkaddr, struct sockaddr *paddr) +{ + pkaddr->addrtype = ADDRTYPE_INET; + pkaddr->length = sizeof(((struct sockaddr_in *)paddr)->sin_addr); + pkaddr->contents = (char *)&(((struct sockaddr_in *)paddr)->sin_addr); +} +#else +__ERROR__XX__UNKNOWN_ADDRTYPE +#endif + /* we can't use krb5_mk_req because w2k wants the service to be in a particular format */ |