summaryrefslogtreecommitdiff
path: root/libexec/telnetd/sys_term.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-02-22 10:39:32 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-02-22 10:39:32 +0000
commit4c854868cc9d88b40b51805184ab69d76d36dad6 (patch)
tree7934a1829f90cda4b75c04aecd6fde694c0a7d22 /libexec/telnetd/sys_term.c
parentbd978a3cd2531b8b9199c83ee514bfc7a1b95854 (diff)
From NetBSD:
Make sure that the user name cannot ever be interpreted as an option to login(8). Note: This does *not* fix any security holes.
Diffstat (limited to 'libexec/telnetd/sys_term.c')
-rw-r--r--libexec/telnetd/sys_term.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c
index cf17db3dbac..10cc5439119 100644
--- a/libexec/telnetd/sys_term.c
+++ b/libexec/telnetd/sys_term.c
@@ -33,7 +33,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)sys_term.c 8.1 (Berkeley) 6/4/93"; */
-static char *rcsid = "$Id: sys_term.c,v 1.1 1995/10/18 08:43:24 deraadt Exp $";
+static char *rcsid = "$Id: sys_term.c,v 1.2 1996/02/22 10:39:31 niklas Exp $";
#endif /* not lint */
#include "telnetd.h"
@@ -1590,6 +1590,7 @@ start_login(host, autologin, name)
if (auth_level >= 0 && autologin == AUTH_VALID) {
# if !defined(NO_LOGIN_F)
argv = addarg(argv, "-f");
+ argv = addarg(argv, "--");
argv = addarg(argv, name);
# else
# if defined(LOGIN_R)
@@ -1662,12 +1663,14 @@ start_login(host, autologin, name)
pty = xpty;
}
# else
+ argv = addarg(argv, "--");
argv = addarg(argv, name);
# endif
# endif
} else
#endif
if (getenv("USER")) {
+ argv = addarg(argv, "--");
argv = addarg(argv, getenv("USER"));
#if defined(LOGIN_ARGS) && defined(NO_LOGIN_P)
{