aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-10-10 17:33:30 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-10-10 17:33:30 +0000
commitdcc479703ddcd3b99224a06b0947e4d8bd657063 (patch)
tree0f34a0805b5a7d866f42179615ea974a497de87f
parent825fe5d54ee0303f939900c03927415601094bdd (diff)
downloadfetchmail-dcc479703ddcd3b99224a06b0947e4d8bd657063.tar.gz
fetchmail-dcc479703ddcd3b99224a06b0947e4d8bd657063.tar.bz2
fetchmail-dcc479703ddcd3b99224a06b0947e4d8bd657063.zip
Implemented --auth as a way of generalizing the Kerberos support.
svn path=/trunk/; revision=282
-rw-r--r--driver.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/driver.c b/driver.c
index 91454e39..4a18403f 100644
--- a/driver.c
+++ b/driver.c
@@ -23,7 +23,7 @@
#include <des.h>
#include <netinet/in.h> /* must be included before "socket.h".*/
#include <netdb.h>
-#endif
+#endif /* KERBEROS_V4 */
#include "socket.h"
#include "fetchmail.h"
#include "smtp.h"
@@ -507,7 +507,7 @@ kerberos_auth (socket, servername)
struct hostent * hp = (gethostbyname (servername));
if (hp == 0)
{
- fprintf (stderr, "MAILHOST unknown: %s\n", servername);
+ fprintf (stderr, "fetchmail: server %s unknown: n", servername);
return (PS_ERROR);
}
host_primary = ((char *) (malloc ((strlen (hp -> h_name)) + 1)));
@@ -530,7 +530,7 @@ kerberos_auth (socket, servername)
free (host_primary);
if (rem != KSUCCESS)
{
- fprintf (stderr, "kerberos error: %s\n", (krb_get_err_text (rem)));
+ fprintf (stderr, "fetchmail: kerberos error %s\n", (krb_get_err_text (rem)));
return (PS_ERROR);
}
return (0);
@@ -568,6 +568,14 @@ struct method *proto;
sigsave = signal(SIGALRM, alarm_handler);
alarm (timeout);
+#ifndef KERBEROS_V4
+ if (queryctl->authenticate == A_KERBEROS)
+ {
+ fputs("fetchmail: Kerberos support not linked.\n", stderr);
+ return(PS_ERROR);
+ }
+#endif /* KERBEROS_V4 */
+
/* lacking methods, there are some options that may fail */
if (!proto->is_old)
{
@@ -604,13 +612,13 @@ struct method *proto;
}
#ifdef KERBEROS_V4
- if (queryctl->protocol == P_KPOP)
+ if (queryctl->authentication == A_KERBEROS)
{
ok = (kerberos_auth (socket, queryctl->servername));
if (ok != 0)
goto cleanUp;
}
-#endif
+#endif /* KERBEROS_V4 */
/* accept greeting message from mail server */
ok = (protocol->parse_response)(socket, buf);