summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-23 03:03:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-04-23 03:03:56 +0000
commitef66b20c1c38c380c7524dbe77f613dd418b23a9 (patch)
tree684e4ed9244c7ee58b5e2944269d8322d03306d6
parent1784c67ecbb3f803a5d99faad269261b3aa4dd25 (diff)
sync with netbsd 960418
-rw-r--r--libexec/ftpd/ftpcmd.y9
-rw-r--r--libexec/telnetd/sys_term.c26
-rw-r--r--libexec/telnetd/telnetd.811
-rw-r--r--libexec/telnetd/telnetd.c14
4 files changed, 43 insertions, 17 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y
index 98c2d8350fa..90a0b38c254 100644
--- a/libexec/ftpd/ftpcmd.y
+++ b/libexec/ftpd/ftpcmd.y
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpcmd.y,v 1.6 1995/06/03 22:46:45 mycroft Exp $ */
+/* $NetBSD: ftpcmd.y,v 1.7 1996/04/08 19:03:11 jtc Exp $ */
/*
* Copyright (c) 1985, 1988, 1993, 1994
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94";
#else
-static char rcsid[] = "$NetBSD: ftpcmd.y,v 1.6 1995/06/03 22:46:45 mycroft Exp $";
+static char rcsid[] = "$NetBSD: ftpcmd.y,v 1.7 1996/04/08 19:03:11 jtc Exp $";
#endif
#endif /* not lint */
@@ -496,8 +496,9 @@ cmd
struct tm *t;
t = gmtime(&stbuf.st_mtime);
reply(213,
- "19%02d%02d%02d%02d%02d%02d",
- t->tm_year, t->tm_mon+1, t->tm_mday,
+ "%04d%02d%02d%02d%02d%02d",
+ 1900 + t->tm_year,
+ t->tm_mon+1, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);
}
}
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c
index f8a9a30650f..a6ef8051ba2 100644
--- a/libexec/telnetd/sys_term.c
+++ b/libexec/telnetd/sys_term.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: sys_term.c,v 1.3 1996/03/28 23:22:00 niklas Exp $ */
-/* $NetBSD: sys_term.c,v 1.8 1996/02/28 20:38:21 thorpej Exp $ */
+/* $OpenBSD: sys_term.c,v 1.4 1996/04/23 03:03:47 deraadt Exp $ */
+/* $NetBSD: sys_term.c,v 1.9 1996/03/20 04:25:53 tls Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: sys_term.c,v 1.8 1996/02/28 20:38:21 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: sys_term.c,v 1.3 1996/03/28 23:22:00 niklas Exp $";
+static char rcsid[] = "$OpenBSD: sys_term.c,v 1.4 1996/04/23 03:03:47 deraadt Exp $";
#endif
#endif /* not lint */
@@ -1556,6 +1556,13 @@ start_login(host, autologin, name)
register char **argv;
char **addarg();
extern char *getenv();
+ extern char *getstr();
+ extern char *gettyname;
+#define TABBUFSIZ 512
+ char defent[TABBUFSIZ];
+ char defstrs[TABBUFSIZ];
+#undef TABBUFSIZ
+ char *loginprog;
#ifdef UTMPX
register int pid = getpid();
struct utmpx utmpx;
@@ -1777,6 +1784,13 @@ start_login(host, autologin, name)
if (pty > 2)
close(pty);
#endif
+ if (getent(defent, gettyname) == 1) {
+ char *cp = defstrs;
+
+ loginprog = getstr("lo", &cp);
+ }
+ if (loginprog == NULL)
+ loginprog = _PATH_LOGIN;
closelog();
/*
* This sleep(1) is in here so that telnetd can
@@ -1784,10 +1798,10 @@ start_login(host, autologin, name)
* the login banner message gets lost...
*/
sleep(1);
- execv(_PATH_LOGIN, argv);
+ execv(loginprog, argv);
- syslog(LOG_ERR, "%s: %m\n", _PATH_LOGIN);
- fatalperror(net, _PATH_LOGIN);
+ syslog(LOG_ERR, "%s: %m\n", loginprog);
+ fatalperror(net, loginprog);
/*NOTREACHED*/
}
diff --git a/libexec/telnetd/telnetd.8 b/libexec/telnetd/telnetd.8
index c4ff02957a8..687f08370e3 100644
--- a/libexec/telnetd/telnetd.8
+++ b/libexec/telnetd/telnetd.8
@@ -1,5 +1,5 @@
-.\" $OpenBSD: telnetd.8,v 1.3 1996/03/28 23:22:02 niklas Exp $
-.\" $NetBSD: telnetd.8,v 1.7 1996/02/28 20:30:33 thorpej Exp $
+.\" $OpenBSD: telnetd.8,v 1.4 1996/04/23 03:03:50 deraadt Exp $
+.\" $NetBSD: telnetd.8,v 1.8 1996/03/20 04:25:55 tls Exp $
.\"
.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -51,6 +51,7 @@ protocol server
.Op Fl X Ar authtype
.Op Fl a Ar authmode
.Op Fl edebug
+.Op Fl g Ar gettyent
.Op Fl r Ns Ar lowpty-highpty
.Op Fl u Ar len
.Op Fl debug Op Ar port
@@ -179,6 +180,12 @@ If
has been compiled with support for data encryption, then the
.Fl edebug
option may be used to enable encryption debugging code.
+.It Fl g Ar gettyent
+Specifies which entry from
+.Pa /etc/gettytab
+should be used to get banner strings, login program and
+other information. The default entry is
+.Dv default.
.It Fl h
Disables the printing of host-specific information before
login has been completed.
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c
index 43d6062e23f..f184628f446 100644
--- a/libexec/telnetd/telnetd.c
+++ b/libexec/telnetd/telnetd.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: telnetd.c,v 1.2 1996/03/28 23:22:03 niklas Exp $ */
-/* $NetBSD: telnetd.c,v 1.5 1996/02/28 20:38:23 thorpej Exp $ */
+/* $OpenBSD: telnetd.c,v 1.3 1996/04/23 03:03:55 deraadt Exp $ */
+/* $NetBSD: telnetd.c,v 1.6 1996/03/20 04:25:57 tls Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -45,7 +45,7 @@ static char copyright[] =
static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
static char rcsid[] = "$NetBSD: telnetd.c,v 1.5 1996/02/28 20:38:23 thorpej Exp $";
#else
-static char rcsid[] = "$OpenBSD: telnetd.c,v 1.2 1996/03/28 23:22:03 niklas Exp $";
+static char rcsid[] = "$OpenBSD: telnetd.c,v 1.3 1996/04/23 03:03:55 deraadt Exp $";
#endif
#endif /* not lint */
@@ -134,6 +134,7 @@ int lowpty = 0, highpty; /* low, high pty numbers */
int debug = 0;
int keepalive = 1;
+char *gettyname = "default";
char *progname;
extern void usage P((void));
@@ -144,7 +145,7 @@ extern void usage P((void));
* passed off to getopt().
*/
char valid_opts[] = {
- 'd', ':', 'h', 'k', 'n', 'S', ':', 'u', ':', 'U',
+ 'd', ':', 'g', ':', 'h', 'k', 'n', 'S', ':', 'u', ':', 'U',
#ifdef AUTHENTICATION
'a', ':', 'X', ':',
#endif
@@ -263,6 +264,9 @@ main(argc, argv)
break;
#endif /* DIAGNOSTICS */
+ case 'g':
+ gettyname = optarg;
+ break;
case 'h':
hostinfo = 0;
@@ -1106,7 +1110,7 @@ telnet(f, p, host)
hostinfo = 0;
#endif
- if (getent(defent, "default") == 1) {
+ if (getent(defent, gettyname) == 1) {
char *getstr();
char *cp=defstrs;