cleanup
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@325 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -9,10 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_dele.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_dele.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dele: Delete a message from the POP maildrop
|
* dele: Delete a message from the POP maildrop
|
||||||
|
@@ -9,16 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_dropcopy.c 2.6 2.6 4/3/91";
|
static char SccsId[] = "@(#)@(#)pop_dropcopy.c 2.6 2.6 4/3/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <popper.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/file.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
extern int errno;
|
extern int errno;
|
||||||
|
|
||||||
@@ -27,9 +18,8 @@ extern int errno;
|
|||||||
* save a stream pointer for it.
|
* save a stream pointer for it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pop_dropcopy(p,pwp)
|
int
|
||||||
POP * p;
|
pop_dropcopy(POP *p, struct passwd *pwp)
|
||||||
struct passwd * pwp;
|
|
||||||
{
|
{
|
||||||
int mfd; /* File descriptor for
|
int mfd; /* File descriptor for
|
||||||
the user's maildrop */
|
the user's maildrop */
|
||||||
|
@@ -9,13 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_dropinfo.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_dropinfo.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <popper.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/file.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
extern int errno;
|
extern int errno;
|
||||||
|
|
||||||
@@ -24,8 +18,8 @@ extern int errno;
|
|||||||
* it for use by the other POP routines.
|
* it for use by the other POP routines.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pop_dropinfo(p)
|
int
|
||||||
POP * p;
|
pop_dropinfo(POP *p)
|
||||||
{
|
{
|
||||||
char buffer[BUFSIZ]; /* Read buffer */
|
char buffer[BUFSIZ]; /* Read buffer */
|
||||||
MsgInfoList * mp; /* Pointer to message
|
MsgInfoList * mp; /* Pointer to message
|
||||||
|
@@ -9,10 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_get_command.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_get_command.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get_command: Extract the command from an input line form a POP client
|
* get_command: Extract the command from an input line form a POP client
|
||||||
@@ -39,10 +36,8 @@ static state_table states[] = {
|
|||||||
(state) 0, NULL, 0, 0, NULL, {halt, halt},
|
(state) 0, NULL, 0, 0, NULL, {halt, halt},
|
||||||
};
|
};
|
||||||
|
|
||||||
state_table *pop_get_command(p,mp)
|
state_table *
|
||||||
POP * p;
|
pop_get_command(POP *p, char *mp)
|
||||||
register char * mp; /* Pointer to unparsed line
|
|
||||||
received from the client */
|
|
||||||
{
|
{
|
||||||
state_table * s;
|
state_table * s;
|
||||||
char buf[MAXMSGLINELEN];
|
char buf[MAXMSGLINELEN];
|
||||||
@@ -76,14 +71,20 @@ register char * mp; /* Pointer to unparsed line
|
|||||||
&& s->ValidCurrentState == p->CurrentState) {
|
&& s->ValidCurrentState == p->CurrentState) {
|
||||||
|
|
||||||
/* Were too few parameters passed to the command? */
|
/* Were too few parameters passed to the command? */
|
||||||
if (p->parm_count < s->min_parms)
|
if (p->parm_count < s->min_parms) {
|
||||||
return((state_table *)pop_msg(p,POP_FAILURE,
|
pop_msg(p,POP_FAILURE,
|
||||||
"Too few arguments for the %s command.",p->pop_command));
|
"Too few arguments for the %s command.",
|
||||||
|
p->pop_command);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Were too many parameters passed to the command? */
|
/* Were too many parameters passed to the command? */
|
||||||
if (p->parm_count > s->max_parms)
|
if (p->parm_count > s->max_parms) {
|
||||||
return((state_table *)pop_msg(p,POP_FAILURE,
|
pop_msg(p,POP_FAILURE,
|
||||||
"Too many arguments for the %s command.",p->pop_command));
|
"Too many arguments for the %s command.",
|
||||||
|
p->pop_command);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return a pointer to the entry for this command in
|
/* Return a pointer to the entry for this command in
|
||||||
the command/state table */
|
the command/state table */
|
||||||
@@ -91,6 +92,7 @@ register char * mp; /* Pointer to unparsed line
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* The client command was not located in the command/state table */
|
/* The client command was not located in the command/state table */
|
||||||
return((state_table *)pop_msg(p,POP_FAILURE,
|
pop_msg(p,POP_FAILURE,
|
||||||
"Unknown command: \"%s\".",p->pop_command));
|
"Unknown command: \"%s\".",p->pop_command);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -9,10 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_get_subcommand.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_get_subcommand.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get_subcommand: Extract a POP XTND subcommand from a client input line
|
* get_subcommand: Extract a POP XTND subcommand from a client input line
|
||||||
@@ -23,8 +20,8 @@ static xtnd_table subcommands[] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
xtnd_table *pop_get_subcommand(p)
|
xtnd_table *
|
||||||
POP * p;
|
pop_get_subcommand(POP *p)
|
||||||
{
|
{
|
||||||
xtnd_table * s;
|
xtnd_table * s;
|
||||||
|
|
||||||
@@ -34,16 +31,20 @@ POP * p;
|
|||||||
if (strcmp(s->subcommand,p->pop_subcommand) == 0) {
|
if (strcmp(s->subcommand,p->pop_subcommand) == 0) {
|
||||||
|
|
||||||
/* Were too few parameters passed to the subcommand? */
|
/* Were too few parameters passed to the subcommand? */
|
||||||
if ((p->parm_count-1) < s->min_parms)
|
if ((p->parm_count-1) < s->min_parms) {
|
||||||
return((xtnd_table *)pop_msg(p,POP_FAILURE,
|
pop_msg(p,POP_FAILURE,
|
||||||
"Too few arguments for the %s %s command.",
|
"Too few arguments for the %s %s command.",
|
||||||
p->pop_command,p->pop_subcommand));
|
p->pop_command,p->pop_subcommand);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Were too many parameters passed to the subcommand? */
|
/* Were too many parameters passed to the subcommand? */
|
||||||
if ((p->parm_count-1) > s->max_parms)
|
if ((p->parm_count-1) > s->max_parms) {
|
||||||
return((xtnd_table *)pop_msg(p,POP_FAILURE,
|
pop_msg(p,POP_FAILURE,
|
||||||
"Too many arguments for the %s %s command.",
|
"Too many arguments for the %s %s command.",
|
||||||
p->pop_command,p->pop_subcommand));
|
p->pop_command,p->pop_subcommand);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return a pointer to the entry for this subcommand
|
/* Return a pointer to the entry for this subcommand
|
||||||
in the XTND command table */
|
in the XTND command table */
|
||||||
@@ -51,6 +52,7 @@ POP * p;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* The client subcommand was not located in the XTND command table */
|
/* The client subcommand was not located in the XTND command table */
|
||||||
return((xtnd_table *)pop_msg(p,POP_FAILURE,
|
pop_msg(p,POP_FAILURE,
|
||||||
"Unknown command: \"%s %s\".",p->pop_command,p->pop_subcommand));
|
"Unknown command: \"%s %s\".",p->pop_command,p->pop_subcommand);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -9,18 +9,9 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_init.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_init.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <popper.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
#include <krb.h>
|
|
||||||
|
|
||||||
AUTH_DAT kdata;
|
AUTH_DAT kdata;
|
||||||
#endif /* KERBEROS */
|
#endif /* KERBEROS */
|
||||||
|
|
||||||
@@ -34,10 +25,8 @@ extern int errno;
|
|||||||
* init: Start a Post Office Protocol session
|
* init: Start a Post Office Protocol session
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pop_init(p,argcount,argmessage)
|
int
|
||||||
POP * p;
|
pop_init(POP *p,int argcount,char **argmessage)
|
||||||
int argcount;
|
|
||||||
char ** argmessage;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
struct sockaddr_in cs; /* Communication parameters */
|
struct sockaddr_in cs; /* Communication parameters */
|
||||||
@@ -202,9 +191,8 @@ char ** argmessage;
|
|||||||
return(authenticate(p, &cs));
|
return(authenticate(p, &cs));
|
||||||
}
|
}
|
||||||
|
|
||||||
authenticate(p, addr)
|
int
|
||||||
POP *p;
|
authenticate(POP *p, struct sockaddr_in *addr)
|
||||||
struct sockaddr_in *addr;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
@@ -232,8 +220,6 @@ authenticate(p, addr)
|
|||||||
kdata.pinst, kdata.prealm, inet_ntoa(addr->sin_addr));
|
kdata.pinst, kdata.prealm, inet_ntoa(addr->sin_addr));
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
strcpy(p->user, kdata.pname);
|
|
||||||
|
|
||||||
#endif /* KERBEROS */
|
#endif /* KERBEROS */
|
||||||
|
|
||||||
return(POP_SUCCESS);
|
return(POP_SUCCESS);
|
||||||
|
@@ -9,16 +9,14 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_last.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_last.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* last: Display the last message touched in a POP session
|
* last: Display the last message touched in a POP session
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pop_last (p)
|
int
|
||||||
POP * p;
|
pop_last (POP *p)
|
||||||
{
|
{
|
||||||
return (pop_msg(p,POP_SUCCESS,"%u is the last message seen.",p->last_msg));
|
return (pop_msg(p,POP_SUCCESS,"%u is the last message seen.",p->last_msg));
|
||||||
}
|
}
|
||||||
|
@@ -9,16 +9,14 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_list.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_list.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* list: List the contents of a POP maildrop
|
* list: List the contents of a POP maildrop
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pop_list (p)
|
int
|
||||||
POP * p;
|
pop_list (POP *p)
|
||||||
{
|
{
|
||||||
MsgInfoList * mp; /* Pointer to message info list */
|
MsgInfoList * mp; /* Pointer to message info list */
|
||||||
register int i;
|
register int i;
|
||||||
|
@@ -9,10 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_log.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_log.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* log: Make a log entry
|
* log: Make a log entry
|
||||||
@@ -24,8 +21,8 @@ int
|
|||||||
pop_log(POP *p, int stat, char *format, ...)
|
pop_log(POP *p, int stat, char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
|
||||||
|
|
||||||
|
va_start(ap, format);
|
||||||
#ifdef HAVE_VSPRINTF
|
#ifdef HAVE_VSPRINTF
|
||||||
vsprintf(msgbuf,format,ap);
|
vsprintf(msgbuf,format,ap);
|
||||||
#else
|
#else
|
||||||
|
@@ -9,16 +9,14 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_lower.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_lower.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* lower: Convert a string to lowercase
|
* lower: Convert a string to lowercase
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pop_lower (buf)
|
void
|
||||||
char * buf;
|
pop_lower (char *buf)
|
||||||
{
|
{
|
||||||
char * mp;
|
char * mp;
|
||||||
|
|
||||||
|
@@ -9,11 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_msg.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_msg.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* msg: Send a formatted line to the POP client
|
* msg: Send a formatted line to the POP client
|
||||||
|
@@ -9,20 +9,15 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_parse.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_parse.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* parse: Parse a raw input line from a POP client
|
* parse: Parse a raw input line from a POP client
|
||||||
* into null-delimited tokens
|
* into null-delimited tokens
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pop_parse(p,buf)
|
int
|
||||||
POP * p;
|
pop_parse(POP *p, char *buf)
|
||||||
char * buf; /* Pointer to a message containing
|
|
||||||
the line from the client */
|
|
||||||
{
|
{
|
||||||
char * mp;
|
char * mp;
|
||||||
register int i;
|
register int i;
|
||||||
|
@@ -9,14 +9,9 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_pass.c 2.3 2.3 4/2/91";
|
static char SccsId[] = "@(#)@(#)pop_pass.c 2.3 2.3 4/2/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
#include <krb.h>
|
|
||||||
extern AUTH_DAT kdata;
|
extern AUTH_DAT kdata;
|
||||||
#endif /* KERBEROS */
|
#endif /* KERBEROS */
|
||||||
|
|
||||||
@@ -24,17 +19,22 @@ extern AUTH_DAT kdata;
|
|||||||
* pass: Obtain the user password from a POP client
|
* pass: Obtain the user password from a POP client
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pop_pass (p)
|
int
|
||||||
POP * p;
|
pop_pass (POP *p)
|
||||||
{
|
{
|
||||||
|
struct passwd * pw;
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
char lrealm[REALM_SZ];
|
char lrealm[REALM_SZ];
|
||||||
int status;
|
int status;
|
||||||
#else
|
#else
|
||||||
register struct passwd * pw;
|
|
||||||
char *crypt();
|
char *crypt();
|
||||||
#endif /* KERBEROS */
|
#endif /* KERBEROS */
|
||||||
|
|
||||||
|
/* Look for the user in the password file */
|
||||||
|
if ((pw = getpwnam(p->user)) == NULL)
|
||||||
|
return (pop_msg(p,POP_FAILURE,
|
||||||
|
"Password supplied for \"%s\" is incorrect.",p->user));
|
||||||
|
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
if ((status = krb_get_lrealm(lrealm,1)) == KFAILURE) {
|
if ((status = krb_get_lrealm(lrealm,1)) == KFAILURE) {
|
||||||
pop_log(p, POP_FAILURE, "%s: (%s.%s@%s) %s", p->client, kdata.pname,
|
pop_log(p, POP_FAILURE, "%s: (%s.%s@%s) %s", p->client, kdata.pname,
|
||||||
@@ -43,6 +43,16 @@ POP * p;
|
|||||||
"Kerberos error: \"%s\".", krb_get_err_text(status)));
|
"Kerberos error: \"%s\".", krb_get_err_text(status)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (kuserok (&kdata, p->user)) {
|
||||||
|
pop_log(p, POP_FAILURE,
|
||||||
|
"%s: (%s.%s@%s) tried to retrieve mail for %s.",
|
||||||
|
p->client, kdata.pname, kdata.pinst, kdata.prealm,
|
||||||
|
p->user);
|
||||||
|
return(pop_msg(p,POP_FAILURE,
|
||||||
|
"Popping not authorized"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (strcmp(kdata.prealm,lrealm)) {
|
if (strcmp(kdata.prealm,lrealm)) {
|
||||||
pop_log(p, POP_FAILURE, "%s: (%s.%s@%s) realm not accepted.",
|
pop_log(p, POP_FAILURE, "%s: (%s.%s@%s) realm not accepted.",
|
||||||
p->client, kdata.pname, kdata.pinst, kdata.prealm);
|
p->client, kdata.pname, kdata.pinst, kdata.prealm);
|
||||||
@@ -57,20 +67,10 @@ POP * p;
|
|||||||
"Must use null Kerberos(tm) instance - \"%s.%s\" not accepted.",
|
"Must use null Kerberos(tm) instance - \"%s.%s\" not accepted.",
|
||||||
kdata.pname, kdata.pinst));
|
kdata.pname, kdata.pinst));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* Build the name of the user's maildrop */
|
|
||||||
(void)sprintf(p->drop_name,"%s/%s",POP_MAILDIR,p->user);
|
|
||||||
|
|
||||||
/* Make a temporary copy of the user's maildrop */
|
|
||||||
if (pop_dropcopy(p, 0) != POP_SUCCESS) return (POP_FAILURE);
|
|
||||||
|
|
||||||
#else /* !KERBEROS */
|
#else /* !KERBEROS */
|
||||||
|
|
||||||
/* Look for the user in the password file */
|
|
||||||
if ((pw = getpwnam(p->user)) == NULL)
|
|
||||||
return (pop_msg(p,POP_FAILURE,
|
|
||||||
"Password supplied for \"%s\" is incorrect.",p->user));
|
|
||||||
|
|
||||||
/* We don't accept connections from users with null passwords */
|
/* We don't accept connections from users with null passwords */
|
||||||
if (pw->pw_passwd == NULL)
|
if (pw->pw_passwd == NULL)
|
||||||
return (pop_msg(p,POP_FAILURE,
|
return (pop_msg(p,POP_FAILURE,
|
||||||
@@ -81,6 +81,8 @@ POP * p;
|
|||||||
return (pop_msg(p,POP_FAILURE,
|
return (pop_msg(p,POP_FAILURE,
|
||||||
"Password supplied for \"%s\" is incorrect.",p->user));
|
"Password supplied for \"%s\" is incorrect.",p->user));
|
||||||
|
|
||||||
|
#endif /* !KERBEROS */
|
||||||
|
|
||||||
/* Build the name of the user's maildrop */
|
/* Build the name of the user's maildrop */
|
||||||
(void)sprintf(p->drop_name,"%s/%s",POP_MAILDIR,p->user);
|
(void)sprintf(p->drop_name,"%s/%s",POP_MAILDIR,p->user);
|
||||||
|
|
||||||
@@ -88,8 +90,6 @@ POP * p;
|
|||||||
/* and set the group and user id */
|
/* and set the group and user id */
|
||||||
if (pop_dropcopy(p,pw) != POP_SUCCESS) return (POP_FAILURE);
|
if (pop_dropcopy(p,pw) != POP_SUCCESS) return (POP_FAILURE);
|
||||||
|
|
||||||
#endif /* !KERBEROS */
|
|
||||||
|
|
||||||
/* Get information about the maildrop */
|
/* Get information about the maildrop */
|
||||||
if (pop_dropinfo(p) != POP_SUCCESS) return(POP_FAILURE);
|
if (pop_dropinfo(p) != POP_SUCCESS) return(POP_FAILURE);
|
||||||
|
|
||||||
|
@@ -9,16 +9,14 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_quit.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_quit.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* quit: Terminate a POP session
|
* quit: Terminate a POP session
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pop_quit (p)
|
int
|
||||||
POP * p;
|
pop_quit (POP *p)
|
||||||
{
|
{
|
||||||
/* Release the message information list */
|
/* Release the message information list */
|
||||||
if (p->mlp) free ((char *)p->mlp);
|
if (p->mlp) free ((char *)p->mlp);
|
||||||
|
@@ -9,16 +9,14 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_rset.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_rset.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rset: Unflag all messages flagged for deletion in a POP maildrop
|
* rset: Unflag all messages flagged for deletion in a POP maildrop
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pop_rset (p)
|
int
|
||||||
POP * p;
|
pop_rset (POP *p)
|
||||||
{
|
{
|
||||||
MsgInfoList * mp; /* Pointer to the message info list */
|
MsgInfoList * mp; /* Pointer to the message info list */
|
||||||
register int i;
|
register int i;
|
||||||
|
@@ -9,18 +9,40 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_send.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_send.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
/*
|
||||||
#include "popper.h"
|
* sendline: Send a line of a multi-line response to a client.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
pop_sendline(POP *p, char *buffer)
|
||||||
|
{
|
||||||
|
char * bp;
|
||||||
|
|
||||||
|
/* Byte stuff lines that begin with the temirnation octet */
|
||||||
|
if (*buffer == POP_TERMINATE) (void)fputc(POP_TERMINATE,p->output);
|
||||||
|
|
||||||
|
/* Look for a <NL> in the buffer */
|
||||||
|
if (bp = strchr(buffer,NEWLINE)) *bp = 0;
|
||||||
|
|
||||||
|
/* Send the line to the client */
|
||||||
|
(void)fputs(buffer,p->output);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
if(p->debug)pop_log(p,POP_DEBUG,"Sending line \"%s\"",buffer);
|
||||||
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
/* Put a <CR><NL> if a newline was removed from the buffer */
|
||||||
|
if (bp) (void)fputs ("\r\n",p->output);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* send: Send the header and a specified number of lines
|
* send: Send the header and a specified number of lines
|
||||||
* from a mail message to a POP client.
|
* from a mail message to a POP client.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pop_send(p)
|
int
|
||||||
POP * p;
|
pop_send(POP *p)
|
||||||
{
|
{
|
||||||
MsgInfoList * mp; /* Pointer to message info list */
|
MsgInfoList * mp; /* Pointer to message info list */
|
||||||
register int msg_num;
|
register int msg_num;
|
||||||
@@ -128,29 +150,3 @@ POP * p;
|
|||||||
|
|
||||||
return(POP_SUCCESS);
|
return(POP_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* sendline: Send a line of a multi-line response to a client.
|
|
||||||
*/
|
|
||||||
pop_sendline(p,buffer)
|
|
||||||
POP * p;
|
|
||||||
char * buffer;
|
|
||||||
{
|
|
||||||
char * bp;
|
|
||||||
|
|
||||||
/* Byte stuff lines that begin with the temirnation octet */
|
|
||||||
if (*buffer == POP_TERMINATE) (void)fputc(POP_TERMINATE,p->output);
|
|
||||||
|
|
||||||
/* Look for a <NL> in the buffer */
|
|
||||||
if (bp = strchr(buffer,NEWLINE)) *bp = 0;
|
|
||||||
|
|
||||||
/* Send the line to the client */
|
|
||||||
(void)fputs(buffer,p->output);
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
if(p->debug)pop_log(p,POP_DEBUG,"Sending line \"%s\"",buffer);
|
|
||||||
#endif /* DEBUG */
|
|
||||||
|
|
||||||
/* Put a <CR><NL> if a newline was removed from the buffer */
|
|
||||||
if (bp) (void)fputs ("\r\n",p->output);
|
|
||||||
}
|
|
||||||
|
@@ -9,19 +9,19 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_stat.c 2.2 2.2 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_stat.c 2.2 2.2 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* stat: Display the status of a POP maildrop to its client
|
* stat: Display the status of a POP maildrop to its client
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pop_stat (p)
|
int
|
||||||
POP * p;
|
pop_stat (POP *p)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (p->debug) pop_log(p,POP_DEBUG,"%d message(s) (%d octets).",p->msg_count-p->msgs_deleted,p->drop_size-p->bytes_deleted);
|
if (p->debug) pop_log(p,POP_DEBUG,"%d message(s) (%d octets).",
|
||||||
|
p->msg_count-p->msgs_deleted,
|
||||||
|
p->drop_size-p->bytes_deleted);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
return (pop_msg (p,POP_SUCCESS,
|
return (pop_msg (p,POP_SUCCESS,
|
||||||
"%u %u",p->msg_count-p->msgs_deleted,p->drop_size-p->bytes_deleted));
|
"%u %u",p->msg_count-p->msgs_deleted,p->drop_size-p->bytes_deleted));
|
||||||
|
@@ -9,15 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_updt.c 2.3 2.3 3/20/91";
|
static char SccsId[] = "@(#)@(#)pop_updt.c 2.3 2.3 3/20/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <popper.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/file.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
extern int errno;
|
extern int errno;
|
||||||
|
|
||||||
@@ -28,8 +20,8 @@ static char standard_error[] =
|
|||||||
* updt: Apply changes to a user's POP maildrop
|
* updt: Apply changes to a user's POP maildrop
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pop_updt (p)
|
int
|
||||||
POP * p;
|
pop_updt (POP *p)
|
||||||
{
|
{
|
||||||
FILE * md; /* Stream pointer for
|
FILE * md; /* Stream pointer for
|
||||||
the user's maildrop */
|
the user's maildrop */
|
||||||
|
@@ -9,22 +9,17 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_user.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_user.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* user: Prompt for the user name at the start of a POP session
|
* user: Prompt for the user name at the start of a POP session
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pop_user (p)
|
int
|
||||||
POP * p;
|
pop_user (POP *p)
|
||||||
{
|
{
|
||||||
#ifndef KERBEROS
|
|
||||||
/* Save the user name */
|
/* Save the user name */
|
||||||
(void)strcpy(p->user, p->pop_parm[1]);
|
(void)strcpy(p->user, p->pop_parm[1]);
|
||||||
#endif /* KERBEROS */
|
|
||||||
|
|
||||||
/* Tell the user that the password is required */
|
/* Tell the user that the password is required */
|
||||||
return (pop_msg(p,POP_SUCCESS,"Password required for %s.",p->user));
|
return (pop_msg(p,POP_SUCCESS,"Password required for %s.",p->user));
|
||||||
|
@@ -9,27 +9,15 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_xmit.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_xmit.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#include <popper.h>
|
||||||
#include <config.h>
|
|
||||||
#endif /* HAVE_CONFIG_H */
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/file.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#ifdef HAVE_SYS_RESOURCE_H
|
|
||||||
#include <sys/resource.h>
|
|
||||||
#endif /* HAVE_SYS_RESOURCE_H */
|
|
||||||
#include <sys/wait.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xmit: POP XTND function to receive a message from
|
* xmit: POP XTND function to receive a message from
|
||||||
* a client and send it in the mail
|
* a client and send it in the mail
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pop_xmit (p)
|
int
|
||||||
POP * p;
|
pop_xmit (POP *p)
|
||||||
{
|
{
|
||||||
FILE * tmp; /* File descriptor for
|
FILE * tmp; /* File descriptor for
|
||||||
temporary file */
|
temporary file */
|
||||||
|
@@ -9,9 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)pop_xtnd.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)pop_xtnd.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <popper.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xtnd: Handle extensions to the POP protocol suite
|
* xtnd: Handle extensions to the POP protocol suite
|
||||||
@@ -19,8 +17,8 @@ static char SccsId[] = "@(#)@(#)pop_xtnd.c 2.1 2.1 3/18/91";
|
|||||||
|
|
||||||
extern xtnd_table * pop_get_subcommand();
|
extern xtnd_table * pop_get_subcommand();
|
||||||
|
|
||||||
int pop_xtnd (p)
|
int
|
||||||
POP * p;
|
pop_xtnd (POP *p)
|
||||||
{
|
{
|
||||||
xtnd_table * x;
|
xtnd_table * x;
|
||||||
|
|
||||||
|
@@ -9,15 +9,7 @@ static char copyright[] = "Copyright (c) 1990 Regents of the University of Calif
|
|||||||
static char SccsId[] = "@(#)@(#)popper.c 2.1 2.1 3/18/91";
|
static char SccsId[] = "@(#)@(#)popper.c 2.1 2.1 3/18/91";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#include <popper.h>
|
||||||
#include <config.h>
|
|
||||||
#endif /* HAVE_CONFIG_H */
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include "popper.h"
|
|
||||||
|
|
||||||
extern state_table * pop_get_command();
|
extern state_table * pop_get_command();
|
||||||
|
|
||||||
@@ -64,9 +56,8 @@ tgets(char *str, int size, FILE *fp, int timeout)
|
|||||||
/*
|
/*
|
||||||
* popper: Handle a Post Office Protocol version 3 session
|
* popper: Handle a Post Office Protocol version 3 session
|
||||||
*/
|
*/
|
||||||
main (argc, argv)
|
int
|
||||||
int argc;
|
main (int argc, char **argv)
|
||||||
char ** argv;
|
|
||||||
{
|
{
|
||||||
POP p;
|
POP p;
|
||||||
state_table * s;
|
state_table * s;
|
||||||
@@ -133,11 +124,8 @@ char ** argv;
|
|||||||
/*
|
/*
|
||||||
* Perform a case-insensitive string comparision
|
* Perform a case-insensitive string comparision
|
||||||
*/
|
*/
|
||||||
#include <ctype.h>
|
int
|
||||||
strncasecmp(str1,str2,len)
|
strncasecmp(char *str1, char *str2,int len)
|
||||||
register char * str1;
|
|
||||||
register char * str2;
|
|
||||||
register int len;
|
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
char a,
|
char a,
|
||||||
|
@@ -21,11 +21,35 @@
|
|||||||
#define RETURN_PATH_HANDLING
|
#define RETURN_PATH_HANDLING
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define KERBEROS
|
/* Common include files */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <setjmp.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/file.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#ifdef HAVE_SYS_RESOURCE_H
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#endif
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
#define KERBEROS
|
||||||
|
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
#include <krb.h>
|
#include <krb.h>
|
||||||
#else
|
#else
|
||||||
@@ -69,7 +93,9 @@
|
|||||||
#include <maillock.h>
|
#include <maillock.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_PATH_MAILDIR)
|
#if defined(KRB4_MAILDIR)
|
||||||
|
#define POP_MAILDIR KRB4_MAILDIR
|
||||||
|
#elif defined(_PATH_MAILDIR)
|
||||||
#define POP_MAILDIR _PATH_MAILDIR
|
#define POP_MAILDIR _PATH_MAILDIR
|
||||||
#elif defined(MAILDIR)
|
#elif defined(MAILDIR)
|
||||||
#define POP_MAILDIR MAILDIR
|
#define POP_MAILDIR MAILDIR
|
||||||
|
@@ -24,7 +24,6 @@ SOURCES=auth.c encrypt.c genget.c \
|
|||||||
getent.c herror.c memmove.c setenv.c strcasecmp.c \
|
getent.c herror.c memmove.c setenv.c strcasecmp.c \
|
||||||
strchr.c strdup.c strerror.c strftime.c strrchr.c
|
strchr.c strdup.c strerror.c strftime.c strrchr.c
|
||||||
|
|
||||||
|
|
||||||
OBJECTS=auth.o encrypt.o genget.o enc_des.o misc.o kerberos.o read_password.o \
|
OBJECTS=auth.o encrypt.o genget.o enc_des.o misc.o kerberos.o read_password.o \
|
||||||
$(LIBOBJS)
|
$(LIBOBJS)
|
||||||
|
|
||||||
@@ -36,7 +35,6 @@ libtop = @libtop@
|
|||||||
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) \
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) \
|
||||||
@KRBINCPATH@ -I.. -I$(srcdir)/.. $<
|
@KRBINCPATH@ -I.. -I$(srcdir)/.. $<
|
||||||
|
|
||||||
|
|
||||||
libtelnet.a: $(OBJECTS)
|
libtelnet.a: $(OBJECTS)
|
||||||
$(AR) cr libtelnet.a $(OBJECTS)
|
$(AR) cr libtelnet.a $(OBJECTS)
|
||||||
$(RANLIB) libtelnet.a
|
$(RANLIB) libtelnet.a
|
||||||
|
@@ -23,10 +23,10 @@ libdir = $(exec_prefix)/lib
|
|||||||
|
|
||||||
SOURCES=commands.c main.c network.c ring.c \
|
SOURCES=commands.c main.c network.c ring.c \
|
||||||
sys_bsd.c telnet.c terminal.c \
|
sys_bsd.c telnet.c terminal.c \
|
||||||
utilities.c ${GETOPT_SRC}
|
utilities.c $(GETOPT_SRC)
|
||||||
|
|
||||||
OBJECTS=authenc.o commands.o main.o network.o ring.o sys_bsd.o \
|
OBJECTS=authenc.o commands.o main.o network.o ring.o sys_bsd.o \
|
||||||
telnet.o terminal.o utilities.o ${GETOPT_OBJ}
|
telnet.o terminal.o utilities.o $(GETOPT_OBJ)
|
||||||
|
|
||||||
libtop=@libtop@
|
libtop=@libtop@
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user