aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-04-12 22:49:06 +0000
committerEric Andersen <andersen@codepoet.org>2004-04-12 22:49:06 +0000
commitb37f883478f61cf5aed1b5d46b339b42219b6d18 (patch)
treee84c48c2f7eaa2d6eddd5a99284186d2842c08d3
parent99fcd168cc7d36e054bb29628b5eb023fc9f51b4 (diff)
downloadbusybox-b37f883478f61cf5aed1b5d46b339b42219b6d18.tar.gz
Sigh. The patch from David Anders (prpplague) broke standard
securetty files since the /dev was not stripped.
-rw-r--r--loginutils/login.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index 99f66b53b..10b7133d7 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -127,7 +127,9 @@ extern int login_main(int argc, char **argv)
#endif
tmp = ttyname ( 0 );
- if ( tmp )
+ if ( tmp && ( strncmp ( tmp, "/dev/", 5 ) == 0 ))
+ safe_strncpy ( tty, tmp + 5, sizeof( tty ));
+ else if ( tmp && *tmp == '/' )
safe_strncpy ( tty, tmp, sizeof( tty ));
else
safe_strncpy ( tty, "UNKNOWN", sizeof( tty ));