Support both kerberised and non-kerberised versions of the POP3
protocol. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@562 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -23,7 +23,7 @@ extern int errno;
|
||||
|
||||
static
|
||||
int
|
||||
authenticate(POP *p, struct sockaddr_in *addr)
|
||||
krb_authenticate(POP *p, struct sockaddr_in *addr)
|
||||
{
|
||||
|
||||
#ifdef KERBEROS
|
||||
@@ -56,6 +56,13 @@ authenticate(POP *p, struct sockaddr_in *addr)
|
||||
return(POP_SUCCESS);
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
plain_authenticate (POP *p, struct sockaddr_in *addr)
|
||||
{
|
||||
return(POP_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* init: Start a Post Office Protocol session
|
||||
*/
|
||||
@@ -91,7 +98,7 @@ pop_init(POP *p,int argcount,char **argmessage)
|
||||
#endif
|
||||
|
||||
/* Process command line arguments */
|
||||
while ((c = getopt(argcount,argmessage,"dt:")) != EOF)
|
||||
while ((c = getopt(argcount,argmessage,"kdt:")) != EOF)
|
||||
switch (c) {
|
||||
|
||||
/* Debugging requested */
|
||||
@@ -112,6 +119,11 @@ pop_init(POP *p,int argcount,char **argmessage)
|
||||
trace_file_name = optarg;
|
||||
break;
|
||||
|
||||
/* Use kerberos version of POP3 protocol */
|
||||
case 'k':
|
||||
p->kerberosp = 1;
|
||||
break;
|
||||
|
||||
/* Timeout value passed. Default changed */
|
||||
case 'T':
|
||||
pop_timeout = atoi(optarg);
|
||||
@@ -225,5 +237,5 @@ pop_init(POP *p,int argcount,char **argmessage)
|
||||
pop_log(p,POP_PRIORITY,"Debugging turned on");
|
||||
#endif /* DEBUG */
|
||||
|
||||
return(authenticate(p, &cs));
|
||||
return((p->kerberosp ? krb_authenticate : plain_authenticate)(p, &cs));
|
||||
}
|
||||
|
Reference in New Issue
Block a user