]> git.eshelyaron.com Git - emacs.git/commitdiff
(socket_connection): Add conditionals for HAVE_KRB5_ERROR_TEXT and
authorChong Yidong <cyd@stupidchicken.com>
Tue, 5 Aug 2008 18:06:53 +0000 (18:06 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 5 Aug 2008 18:06:53 +0000 (18:06 +0000)
HAVE_KRB5_ERROR_E_TEXT to support compilation with MIT Kerberos and
Heimdal, respectively.

lib-src/pop.c

index 7de5e17e20dc11b9eff77250901c277f1d615e72..29c9712d3ec51e22f4cc3a568687f5b9d7a96557 100644 (file)
@@ -1200,11 +1200,12 @@ socket_connection (host, flags)
       krb5_free_principal (kcontext, server);
       if (rem)
        {
+         strcpy (pop_error, KRB_ERROR);
+         strncat (pop_error, error_message (rem),
+                  ERROR_MAX - sizeof (KRB_ERROR));
+#if defined HAVE_KRB5_ERROR_TEXT
          if (err_ret && err_ret->text.length)
            {
-             strcpy (pop_error, KRB_ERROR);
-             strncat (pop_error, error_message (rem),
-                      ERROR_MAX - sizeof (KRB_ERROR));
              strncat (pop_error, " [server says '",
                       ERROR_MAX - strlen (pop_error) - 1);
              strncat (pop_error, err_ret->text.data,
@@ -1213,12 +1214,17 @@ socket_connection (host, flags)
              strncat (pop_error, "']",
                       ERROR_MAX - strlen (pop_error) - 1);
            }
-         else
+#elif defined HAVE_KRB5_ERROR_E_TEXT
+         if (err_ret && err_ret->e_text && strlen(*err_ret->e_text))
            {
-             strcpy (pop_error, KRB_ERROR);
-             strncat (pop_error, error_message (rem),
-                      ERROR_MAX - sizeof (KRB_ERROR));
+             strncat (pop_error, " [server says '",
+                      ERROR_MAX - strlen (pop_error) - 1);
+             strncat (pop_error, *err_ret->e_text,
+                      ERROR_MAX - strlen (pop_error) - 1);
+             strncat (pop_error, "']",
+                      ERROR_MAX - strlen (pop_error) - 1);
            }
+#endif
          if (err_ret)
            krb5_free_error (kcontext, err_ret);
          krb5_auth_con_free (kcontext, auth_context);