From 2bc7f701cc11f398e032c8bf640db31f189a01de Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 20 Mar 1996 02:09:52 +0000 Subject: [PATCH] cleanup git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@325 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/popper/pop_dele.c | 5 +-- appl/popper/pop_dropcopy.c | 16 ++------- appl/popper/pop_dropinfo.c | 12 ++----- appl/popper/pop_get_command.c | 34 +++++++++--------- appl/popper/pop_get_subcommand.c | 34 +++++++++--------- appl/popper/pop_init.c | 24 +++---------- appl/popper/pop_last.c | 8 ++--- appl/popper/pop_list.c | 8 ++--- appl/popper/pop_log.c | 7 ++-- appl/popper/pop_lower.c | 8 ++--- appl/popper/pop_msg.c | 6 +--- appl/popper/pop_parse.c | 11 ++---- appl/popper/pop_pass.c | 44 +++++++++++------------ appl/popper/pop_quit.c | 8 ++--- appl/popper/pop_rset.c | 8 ++--- appl/popper/pop_send.c | 60 +++++++++++++++---------------- appl/popper/pop_stat.c | 12 +++---- appl/popper/pop_updt.c | 14 ++------ appl/popper/pop_user.c | 11 ++---- appl/popper/pop_xmit.c | 18 ++-------- appl/popper/pop_xtnd.c | 8 ++--- appl/popper/popper.c | 22 +++--------- appl/popper/popper.h | 30 ++++++++++++++-- appl/telnet/libtelnet/Makefile.in | 2 -- appl/telnet/telnet/Makefile.in | 4 +-- 25 files changed, 172 insertions(+), 242 deletions(-) diff --git a/appl/popper/pop_dele.c b/appl/popper/pop_dele.c index 43c6ebbb5..ebe50fddc 100644 --- a/appl/popper/pop_dele.c +++ b/appl/popper/pop_dele.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include "popper.h" +#include /* * dele: Delete a message from the POP maildrop diff --git a/appl/popper/pop_dropcopy.c b/appl/popper/pop_dropcopy.c index 0cffc0b09..ffea224a8 100644 --- a/appl/popper/pop_dropcopy.c +++ b/appl/popper/pop_dropcopy.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "popper.h" +#include extern int errno; @@ -27,9 +18,8 @@ extern int errno; * save a stream pointer for it. */ -pop_dropcopy(p,pwp) -POP * p; -struct passwd * pwp; +int +pop_dropcopy(POP *p, struct passwd *pwp) { int mfd; /* File descriptor for the user's maildrop */ diff --git a/appl/popper/pop_dropinfo.c b/appl/popper/pop_dropinfo.c index 412780b6d..5b53f7c53 100644 --- a/appl/popper/pop_dropinfo.c +++ b/appl/popper/pop_dropinfo.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include -#include -#include -#include "popper.h" +#include extern int errno; @@ -24,8 +18,8 @@ extern int errno; * it for use by the other POP routines. */ -pop_dropinfo(p) -POP * p; +int +pop_dropinfo(POP *p) { char buffer[BUFSIZ]; /* Read buffer */ MsgInfoList * mp; /* Pointer to message diff --git a/appl/popper/pop_get_command.c b/appl/popper/pop_get_command.c index 32181632a..9d3107b18 100644 --- a/appl/popper/pop_get_command.c +++ b/appl/popper/pop_get_command.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include "popper.h" +#include /* * 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_table *pop_get_command(p,mp) -POP * p; -register char * mp; /* Pointer to unparsed line - received from the client */ +state_table * +pop_get_command(POP *p, char *mp) { state_table * s; char buf[MAXMSGLINELEN]; @@ -76,14 +71,20 @@ register char * mp; /* Pointer to unparsed line && s->ValidCurrentState == p->CurrentState) { /* Were too few parameters passed to the command? */ - if (p->parm_count < s->min_parms) - return((state_table *)pop_msg(p,POP_FAILURE, - "Too few arguments for the %s command.",p->pop_command)); + if (p->parm_count < s->min_parms) { + pop_msg(p,POP_FAILURE, + "Too few arguments for the %s command.", + p->pop_command); + return NULL; + } /* Were too many parameters passed to the command? */ - if (p->parm_count > s->max_parms) - return((state_table *)pop_msg(p,POP_FAILURE, - "Too many arguments for the %s command.",p->pop_command)); + if (p->parm_count > s->max_parms) { + pop_msg(p,POP_FAILURE, + "Too many arguments for the %s command.", + p->pop_command); + return NULL; + } /* Return a pointer to the entry for this command in 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 */ - return((state_table *)pop_msg(p,POP_FAILURE, - "Unknown command: \"%s\".",p->pop_command)); + pop_msg(p,POP_FAILURE, + "Unknown command: \"%s\".",p->pop_command); + return NULL; } diff --git a/appl/popper/pop_get_subcommand.c b/appl/popper/pop_get_subcommand.c index d531260bf..ca3e2dfa2 100644 --- a/appl/popper/pop_get_subcommand.c +++ b/appl/popper/pop_get_subcommand.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include "popper.h" +#include /* * get_subcommand: Extract a POP XTND subcommand from a client input line @@ -23,8 +20,8 @@ static xtnd_table subcommands[] = { NULL }; -xtnd_table *pop_get_subcommand(p) -POP * p; +xtnd_table * +pop_get_subcommand(POP *p) { xtnd_table * s; @@ -34,16 +31,20 @@ POP * p; if (strcmp(s->subcommand,p->pop_subcommand) == 0) { /* Were too few parameters passed to the subcommand? */ - if ((p->parm_count-1) < s->min_parms) - return((xtnd_table *)pop_msg(p,POP_FAILURE, - "Too few arguments for the %s %s command.", - p->pop_command,p->pop_subcommand)); + if ((p->parm_count-1) < s->min_parms) { + pop_msg(p,POP_FAILURE, + "Too few arguments for the %s %s command.", + p->pop_command,p->pop_subcommand); + return NULL; + } /* Were too many parameters passed to the subcommand? */ - if ((p->parm_count-1) > s->max_parms) - return((xtnd_table *)pop_msg(p,POP_FAILURE, - "Too many arguments for the %s %s command.", - p->pop_command,p->pop_subcommand)); + if ((p->parm_count-1) > s->max_parms) { + pop_msg(p,POP_FAILURE, + "Too many arguments for the %s %s command.", + p->pop_command,p->pop_subcommand); + return NULL; + } /* Return a pointer to the entry for this subcommand in the XTND command table */ @@ -51,6 +52,7 @@ POP * p; } } /* The client subcommand was not located in the XTND command table */ - return((xtnd_table *)pop_msg(p,POP_FAILURE, - "Unknown command: \"%s %s\".",p->pop_command,p->pop_subcommand)); + pop_msg(p,POP_FAILURE, + "Unknown command: \"%s %s\".",p->pop_command,p->pop_subcommand); + return NULL; } diff --git a/appl/popper/pop_init.c b/appl/popper/pop_init.c index 1e87d1ec5..b7ad630a3 100644 --- a/appl/popper/pop_init.c +++ b/appl/popper/pop_init.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include -#include -#include -#include -#include "popper.h" +#include #ifdef KERBEROS -#include - AUTH_DAT kdata; #endif /* KERBEROS */ @@ -34,10 +25,8 @@ extern int errno; * init: Start a Post Office Protocol session */ -pop_init(p,argcount,argmessage) -POP * p; -int argcount; -char ** argmessage; +int +pop_init(POP *p,int argcount,char **argmessage) { struct sockaddr_in cs; /* Communication parameters */ @@ -202,9 +191,8 @@ char ** argmessage; return(authenticate(p, &cs)); } -authenticate(p, addr) - POP *p; - struct sockaddr_in *addr; +int +authenticate(POP *p, struct sockaddr_in *addr) { #ifdef KERBEROS @@ -232,8 +220,6 @@ authenticate(p, addr) kdata.pinst, kdata.prealm, inet_ntoa(addr->sin_addr)); #endif /* DEBUG */ - strcpy(p->user, kdata.pname); - #endif /* KERBEROS */ return(POP_SUCCESS); diff --git a/appl/popper/pop_last.c b/appl/popper/pop_last.c index 1db90e15e..2aede1ee6 100644 --- a/appl/popper/pop_last.c +++ b/appl/popper/pop_last.c @@ -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"; #endif /* not lint */ -#include -#include -#include "popper.h" +#include /* * last: Display the last message touched in a POP session */ -int pop_last (p) -POP * p; +int +pop_last (POP *p) { return (pop_msg(p,POP_SUCCESS,"%u is the last message seen.",p->last_msg)); } diff --git a/appl/popper/pop_list.c b/appl/popper/pop_list.c index 06931ebf1..0ab382d10 100644 --- a/appl/popper/pop_list.c +++ b/appl/popper/pop_list.c @@ -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"; #endif /* not lint */ -#include -#include -#include "popper.h" +#include /* * list: List the contents of a POP maildrop */ -int pop_list (p) -POP * p; +int +pop_list (POP *p) { MsgInfoList * mp; /* Pointer to message info list */ register int i; diff --git a/appl/popper/pop_log.c b/appl/popper/pop_log.c index 719356d4c..c3b41d12d 100644 --- a/appl/popper/pop_log.c +++ b/appl/popper/pop_log.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include "popper.h" +#include /* * log: Make a log entry @@ -24,8 +21,8 @@ int pop_log(POP *p, int stat, char *format, ...) { va_list ap; - va_start(ap, format); + va_start(ap, format); #ifdef HAVE_VSPRINTF vsprintf(msgbuf,format,ap); #else diff --git a/appl/popper/pop_lower.c b/appl/popper/pop_lower.c index 8c9e3922f..578ff17e1 100644 --- a/appl/popper/pop_lower.c +++ b/appl/popper/pop_lower.c @@ -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"; #endif /* not lint */ -#include -#include -#include +#include /* * lower: Convert a string to lowercase */ -pop_lower (buf) -char * buf; +void +pop_lower (char *buf) { char * mp; diff --git a/appl/popper/pop_msg.c b/appl/popper/pop_msg.c index 9d3329ccc..430ea6fce 100644 --- a/appl/popper/pop_msg.c +++ b/appl/popper/pop_msg.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include -#include "popper.h" +#include /* * msg: Send a formatted line to the POP client diff --git a/appl/popper/pop_parse.c b/appl/popper/pop_parse.c index 0915b5578..5d5bed5c4 100644 --- a/appl/popper/pop_parse.c +++ b/appl/popper/pop_parse.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include "popper.h" +#include /* * parse: Parse a raw input line from a POP client * into null-delimited tokens */ -pop_parse(p,buf) -POP * p; -char * buf; /* Pointer to a message containing - the line from the client */ +int +pop_parse(POP *p, char *buf) { char * mp; register int i; diff --git a/appl/popper/pop_pass.c b/appl/popper/pop_pass.c index a4075de99..d3b3e8293 100644 --- a/appl/popper/pop_pass.c +++ b/appl/popper/pop_pass.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include -#include "popper.h" +#include #ifdef KERBEROS -#include extern AUTH_DAT kdata; #endif /* KERBEROS */ @@ -24,17 +19,22 @@ extern AUTH_DAT kdata; * pass: Obtain the user password from a POP client */ -int pop_pass (p) -POP * p; +int +pop_pass (POP *p) { + struct passwd * pw; #ifdef KERBEROS char lrealm[REALM_SZ]; int status; #else - register struct passwd * pw; char *crypt(); #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 if ((status = krb_get_lrealm(lrealm,1)) == KFAILURE) { 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))); } + 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)) { pop_log(p, POP_FAILURE, "%s: (%s.%s@%s) realm not accepted.", p->client, kdata.pname, kdata.pinst, kdata.prealm); @@ -57,20 +67,10 @@ POP * p; "Must use null Kerberos(tm) instance - \"%s.%s\" not accepted.", kdata.pname, kdata.pinst)); } - - /* 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); +#endif #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 */ if (pw->pw_passwd == NULL) return (pop_msg(p,POP_FAILURE, @@ -81,6 +81,8 @@ POP * p; return (pop_msg(p,POP_FAILURE, "Password supplied for \"%s\" is incorrect.",p->user)); +#endif /* !KERBEROS */ + /* Build the name of the user's maildrop */ (void)sprintf(p->drop_name,"%s/%s",POP_MAILDIR,p->user); @@ -88,8 +90,6 @@ POP * p; /* and set the group and user id */ if (pop_dropcopy(p,pw) != POP_SUCCESS) return (POP_FAILURE); -#endif /* !KERBEROS */ - /* Get information about the maildrop */ if (pop_dropinfo(p) != POP_SUCCESS) return(POP_FAILURE); diff --git a/appl/popper/pop_quit.c b/appl/popper/pop_quit.c index 907bc9cdf..85c621a20 100644 --- a/appl/popper/pop_quit.c +++ b/appl/popper/pop_quit.c @@ -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"; #endif /* not lint */ -#include -#include -#include "popper.h" +#include /* * quit: Terminate a POP session */ -int pop_quit (p) -POP * p; +int +pop_quit (POP *p) { /* Release the message information list */ if (p->mlp) free ((char *)p->mlp); diff --git a/appl/popper/pop_rset.c b/appl/popper/pop_rset.c index 7ce3d1cbf..fd986095e 100644 --- a/appl/popper/pop_rset.c +++ b/appl/popper/pop_rset.c @@ -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"; #endif /* not lint */ -#include -#include -#include "popper.h" +#include /* * rset: Unflag all messages flagged for deletion in a POP maildrop */ -int pop_rset (p) -POP * p; +int +pop_rset (POP *p) { MsgInfoList * mp; /* Pointer to the message info list */ register int i; diff --git a/appl/popper/pop_send.c b/appl/popper/pop_send.c index 7e32c5edd..764fc66b1 100644 --- a/appl/popper/pop_send.c +++ b/appl/popper/pop_send.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include "popper.h" +#include + +/* + * 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 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 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 * from a mail message to a POP client. */ -pop_send(p) -POP * p; +int +pop_send(POP *p) { MsgInfoList * mp; /* Pointer to message info list */ register int msg_num; @@ -128,29 +150,3 @@ POP * p; 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 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 if a newline was removed from the buffer */ - if (bp) (void)fputs ("\r\n",p->output); -} diff --git a/appl/popper/pop_stat.c b/appl/popper/pop_stat.c index 5fa7fa595..a34719db4 100644 --- a/appl/popper/pop_stat.c +++ b/appl/popper/pop_stat.c @@ -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"; #endif /* not lint */ -#include -#include -#include "popper.h" +#include /* * stat: Display the status of a POP maildrop to its client */ -int pop_stat (p) -POP * p; +int +pop_stat (POP *p) { #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 */ return (pop_msg (p,POP_SUCCESS, "%u %u",p->msg_count-p->msgs_deleted,p->drop_size-p->bytes_deleted)); diff --git a/appl/popper/pop_updt.c b/appl/popper/pop_updt.c index b8300870d..155ce96cb 100644 --- a/appl/popper/pop_updt.c +++ b/appl/popper/pop_updt.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include -#include -#include -#include -#include -#include "popper.h" +#include extern int errno; @@ -28,8 +20,8 @@ static char standard_error[] = * updt: Apply changes to a user's POP maildrop */ -int pop_updt (p) -POP * p; +int +pop_updt (POP *p) { FILE * md; /* Stream pointer for the user's maildrop */ diff --git a/appl/popper/pop_user.c b/appl/popper/pop_user.c index 2fa0a24cc..d7da4a732 100644 --- a/appl/popper/pop_user.c +++ b/appl/popper/pop_user.c @@ -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"; #endif /* not lint */ -#include -#include -#include -#include "popper.h" +#include /* * user: Prompt for the user name at the start of a POP session */ -int pop_user (p) -POP * p; +int +pop_user (POP *p) { -#ifndef KERBEROS /* Save the user name */ (void)strcpy(p->user, p->pop_parm[1]); -#endif /* KERBEROS */ /* Tell the user that the password is required */ return (pop_msg(p,POP_SUCCESS,"Password required for %s.",p->user)); diff --git a/appl/popper/pop_xmit.c b/appl/popper/pop_xmit.c index 2f0887496..99d409800 100644 --- a/appl/popper/pop_xmit.c +++ b/appl/popper/pop_xmit.c @@ -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"; #endif /* not lint */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ -#include -#include -#include -#include -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif /* HAVE_SYS_RESOURCE_H */ -#include -#include -#include "popper.h" +#include /* * xmit: POP XTND function to receive a message from * a client and send it in the mail */ -pop_xmit (p) -POP * p; +int +pop_xmit (POP *p) { FILE * tmp; /* File descriptor for temporary file */ diff --git a/appl/popper/pop_xtnd.c b/appl/popper/pop_xtnd.c index 03afe7f29..73c214664 100644 --- a/appl/popper/pop_xtnd.c +++ b/appl/popper/pop_xtnd.c @@ -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"; #endif /* not lint */ -#include -#include -#include "popper.h" +#include /* * 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(); -int pop_xtnd (p) -POP * p; +int +pop_xtnd (POP *p) { xtnd_table * x; diff --git a/appl/popper/popper.c b/appl/popper/popper.c index a1abe60fd..9528cab73 100644 --- a/appl/popper/popper.c +++ b/appl/popper/popper.c @@ -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"; #endif /* not lint */ -#ifdef HAVE_CONFIG_H -#include -#endif /* HAVE_CONFIG_H */ - -#include -#include -#include -#include -#include "popper.h" +#include 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 */ -main (argc, argv) -int argc; -char ** argv; +int +main (int argc, char **argv) { POP p; state_table * s; @@ -133,11 +124,8 @@ char ** argv; /* * Perform a case-insensitive string comparision */ -#include -strncasecmp(str1,str2,len) -register char * str1; -register char * str2; -register int len; +int +strncasecmp(char *str1, char *str2,int len) { register int i; char a, diff --git a/appl/popper/popper.h b/appl/popper/popper.h index a3d4c2dfa..43048332f 100644 --- a/appl/popper/popper.h +++ b/appl/popper/popper.h @@ -21,11 +21,35 @@ #define RETURN_PATH_HANDLING #endif -#define KERBEROS +/* Common include files */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#include +#include +#include +#include +#include #include #include "version.h" +#define KERBEROS + #ifdef KERBEROS #include #else @@ -69,7 +93,9 @@ #include #endif -#if defined(_PATH_MAILDIR) +#if defined(KRB4_MAILDIR) +#define POP_MAILDIR KRB4_MAILDIR +#elif defined(_PATH_MAILDIR) #define POP_MAILDIR _PATH_MAILDIR #elif defined(MAILDIR) #define POP_MAILDIR MAILDIR diff --git a/appl/telnet/libtelnet/Makefile.in b/appl/telnet/libtelnet/Makefile.in index fab93b4ac..596118e84 100644 --- a/appl/telnet/libtelnet/Makefile.in +++ b/appl/telnet/libtelnet/Makefile.in @@ -24,7 +24,6 @@ SOURCES=auth.c encrypt.c genget.c \ getent.c herror.c memmove.c setenv.c strcasecmp.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 \ $(LIBOBJS) @@ -36,7 +35,6 @@ libtop = @libtop@ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) \ @KRBINCPATH@ -I.. -I$(srcdir)/.. $< - libtelnet.a: $(OBJECTS) $(AR) cr libtelnet.a $(OBJECTS) $(RANLIB) libtelnet.a diff --git a/appl/telnet/telnet/Makefile.in b/appl/telnet/telnet/Makefile.in index 09435fb0f..c4860ad50 100644 --- a/appl/telnet/telnet/Makefile.in +++ b/appl/telnet/telnet/Makefile.in @@ -23,10 +23,10 @@ libdir = $(exec_prefix)/lib SOURCES=commands.c main.c network.c ring.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 \ - telnet.o terminal.o utilities.o ${GETOPT_OBJ} + telnet.o terminal.o utilities.o $(GETOPT_OBJ) libtop=@libtop@