Some cleanup; there is no point in declaring and mapping
authorgd <gd@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Thu, 9 Mar 2006 14:51:40 +0000 (14:51 +0000)
committergd <gd@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Thu, 9 Mar 2006 14:51:40 +0000 (14:51 +0000)
KRB5KRB_ERR_RESPONSE_TOO_BIG when the krb5 library does not know about
this.

Guenther

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_0@14074 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/include/includes.h
source/libads/krb5_errs.c

index aef3437d5677e2734e0159eab3c15dd154eb14e2..4bd84c877aac80b2fbac011095c9336940019b63 100644 (file)
@@ -1462,10 +1462,6 @@ time_t timegm(struct tm *tm);
 
 #if defined(HAVE_KRB5)
 
-#ifndef KRB5KRB_ERR_RESPONSE_TOO_BIG
-#define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L)
-#endif
-
 #ifndef HAVE_KRB5_SET_REAL_TIME
 krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds);
 #endif
@@ -1538,6 +1534,8 @@ int cli_krb5_get_ticket(const char *principal, time_t time_offset,
 PAC_LOGON_INFO *get_logon_info_from_pac(PAC_DATA *pac_data);
 krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *new_start_time);
 krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code);
+NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error);
+krb5_error_code nt_status_to_krb5(NTSTATUS nt_status);
 #endif /* HAVE_KRB5 */
 
 
index 027759643680b6952ada1607b3eaf90ba58a47a3..0c2e704702c0528fbd656811e3f343a218a55dc2 100644 (file)
@@ -23,7 +23,7 @@
 #ifdef HAVE_KRB5
 
 static const struct {
-       long krb5_code;
+       krb5_error_code krb5_code;
        NTSTATUS ntstatus;
 } krb5_to_nt_status_map[] = {
        {KRB5_CC_IO, NT_STATUS_UNEXPECTED_IO_ERROR},
@@ -52,13 +52,15 @@ static const struct {
        {KRB5KRB_AP_ERR_SKEW, NT_STATUS_TIME_DIFFERENCE_AT_DC},
        {KRB5KRB_AP_ERR_TKT_EXPIRED, NT_STATUS_LOGON_FAILURE},
        {KRB5KRB_ERR_GENERIC, NT_STATUS_UNSUCCESSFUL},
+#if defined(KRB5KRB_ERR_RESPONSE_TOO_BIG)
        {KRB5KRB_ERR_RESPONSE_TOO_BIG, NT_STATUS_PROTOCOL_UNREACHABLE},
+#endif
        {0, NT_STATUS_OK}
 };
 
 static const struct {
        NTSTATUS ntstatus;
-       long krb5_code;
+       krb5_error_code krb5_code;
 } nt_status_to_krb5_map[] = {
        {NT_STATUS_LOGON_FAILURE, KRB5KDC_ERR_PREAUTH_FAILED},
        {NT_STATUS_NO_LOGON_SERVERS, KRB5_KDC_UNREACH},
@@ -68,7 +70,7 @@ static const struct {
 /*****************************************************************************
 convert a KRB5 error to a NT status32 code
  *****************************************************************************/
-NTSTATUS krb5_to_nt_status(int kerberos_error)
+ NTSTATUS krb5_to_nt_status(krb5_error_code kerberos_error)
 {
        int i;
        
@@ -87,7 +89,7 @@ NTSTATUS krb5_to_nt_status(int kerberos_error)
 /*****************************************************************************
 convert an NT status32 code to a KRB5 error
  *****************************************************************************/
-int nt_status_to_krb5(NTSTATUS nt_status)
+ krb5_error_code nt_status_to_krb5(NTSTATUS nt_status)
 {
        int i;
        
@@ -103,30 +105,5 @@ int nt_status_to_krb5(NTSTATUS nt_status)
        return KRB5KRB_ERR_GENERIC;
 }
 
-#else 
-
-/*****************************************************************************
-convert a KRB5 error to a NT status32 code
- *****************************************************************************/
-NTSTATUS krb5_to_nt_status(int kerberos_error)
-{
-       if (kerberos_error == 0) {
-               return NT_STATUS_OK;
-       }
-       
-       return NT_STATUS_UNSUCCESSFUL;
-}
-
-/*****************************************************************************
-convert an NT status32 code to a KRB5 error
- *****************************************************************************/
-int nt_status_to_krb5(NTSTATUS nt_status)
-{
-       if (NT_STATUS_EQUAL(nt_status, NT_STATUS_OK)) {
-               return 0;
-       }
-       return -1; /* FIXME: what to return here ? */
-}
-
 #endif