No functional changes, but:

o unifdef AUTHENTICATE. We have never compiled this code, and its
  doubtful it will even work in this case.

o Style changes (some ansification, some comment updating)

o Diff reduction and code style merging with crypto telnet.
This commit is contained in:
Mark Murray 2001-08-20 12:04:53 +00:00
parent 2aad70eb9e
commit 5adb5c82e3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81961
5 changed files with 47 additions and 38 deletions

View File

@ -1,18 +1,18 @@
# From: @(#)Makefile 8.2 (Berkeley) 12/15/93 # From: @(#)Makefile 8.2 (Berkeley) 12/15/93
# $FreeBSD$ # $FreeBSD$
LIB= telnet LIB= telnet
INTERNALLIB=yes INTERNALLIB= yes
INTERNALSTATICLIB=yes INTERNALSTATICLIB=yes
NOPIC= yes NOPIC= yes
SRCS= genget.c getent.c misc.c SRCS= genget.c getent.c misc.c
CFLAGS+= -DHAS_CGETENT CFLAGS+= -DHAS_CGETENT
# #
# Remove obsolete shared libraries, if any. We don't bother moving them # Remove obsolete shared libraries, if any. We don't bother moving them
# to/usr/lib/compat, since they were only used by telnet, telnetd and # to /usr/lib/compat, since they were only used by telnet, telnetd and
# tn3270. # tn3270.
# #
beforeinstall: beforeinstall:

View File

@ -32,7 +32,12 @@
*/ */
#ifndef lint #ifndef lint
static char sccsid[] = "@(#)genget.c 8.1 (Berkeley) 6/4/93"; #if 0
static const char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */ #endif /* not lint */
@ -45,37 +50,33 @@ static char sccsid[] = "@(#)genget.c 8.1 (Berkeley) 6/4/93";
* the length is returned. If *s1 is a prefix of *s2, * the length is returned. If *s1 is a prefix of *s2,
* the length of *s1 is returned. * the length of *s1 is returned.
*/ */
int int
isprefix(s1, s2) isprefix(char *s1, char *s2)
register char *s1, *s2;
{ {
char *os1; char *os1;
register char c1, c2; char c1, c2;
if (*s1 == '\0') if (*s1 == '\0')
return(-1); return(-1);
os1 = s1; os1 = s1;
c1 = *s1; c1 = *s1;
c2 = *s2; c2 = *s2;
while (LOWER(c1) == LOWER(c2)) { while (LOWER(c1) == LOWER(c2)) {
if (c1 == '\0') if (c1 == '\0')
break; break;
c1 = *++s1; c1 = *++s1;
c2 = *++s2; c2 = *++s2;
} }
return(*s1 ? 0 : (*s2 ? (s1 - os1) : (os1 - s1))); return(*s1 ? 0 : (*s2 ? (s1 - os1) : (os1 - s1)));
} }
static char *ambiguous; /* special return value for command routines */ static char *ambiguous; /* special return value for command routines */
char ** char **
genget(name, table, stlen) genget(char *name, char **table, int stlen)
char *name; /* name to match */
char **table; /* name entry in table */
int stlen;
{ {
register char **c, **found; char **c, **found;
register int n; int n;
if (name == 0) if (name == 0)
return 0; return 0;
@ -96,9 +97,8 @@ genget(name, table, stlen)
/* /*
* Function call version of Ambiguous() * Function call version of Ambiguous()
*/ */
int int
Ambiguous(s) Ambiguous(char *s)
char *s;
{ {
return((char **)s == &ambiguous); return((char **)s == &ambiguous);
} }

View File

@ -32,17 +32,23 @@
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93"; static char sccsid[] = "@(#)getent.c 8.2 (Berkeley) 12/15/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */ #endif /* not lint */
#ifdef HAS_CGETENT
#include <stdlib.h> #include <stdlib.h>
#endif
static char *area; static char *area;
/*ARGSUSED*/ /*ARGSUSED*/
int int
getent(cp, name) getent(char *cp, char *name)
char *cp, *name;
{ {
#ifdef HAS_CGETENT #ifdef HAS_CGETENT
char *dba[2]; char *dba[2];
@ -58,8 +64,7 @@ char *cp, *name;
#ifndef SOLARIS #ifndef SOLARIS
/*ARGSUSED*/ /*ARGSUSED*/
char * char *
Getstr(id, cpp) Getstr(char *id, char **cpp)
char *id, **cpp;
{ {
# ifdef HAS_CGETENT # ifdef HAS_CGETENT
char *answer; char *answer;

View File

@ -31,6 +31,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)misc-proto.h 8.1 (Berkeley) 6/4/93 * @(#)misc-proto.h 8.1 (Berkeley) 6/4/93
* $FreeBSD$
*/ */
/* /*
@ -76,4 +77,5 @@ void net_encrypt P((void));
int telnet_spin P((void)); int telnet_spin P((void));
char *telnet_getenv P((char *)); char *telnet_getenv P((char *));
char *telnet_gets P((char *, char *, int, int)); char *telnet_gets P((char *, char *, int, int));
void printsub P((int, unsigned char *, int));
#endif #endif

View File

@ -32,7 +32,12 @@
*/ */
#ifndef lint #ifndef lint
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93"; #if 0
static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */ #endif /* not lint */
#include <stdio.h> #include <stdio.h>
@ -53,9 +58,6 @@ auth_encrypt_init(local, remote, name, server)
{ {
RemoteHostName = remote; RemoteHostName = remote;
LocalHostName = local; LocalHostName = local;
#if defined(AUTHENTICATION)
auth_init(name, server);
#endif
if (UserNameRequested) { if (UserNameRequested) {
free(UserNameRequested); free(UserNameRequested);
UserNameRequested = 0; UserNameRequested = 0;