Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/libexec/telnetd Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/c4ce6a565717
branches:  netbsd-9
changeset: 962810:c4ce6a565717
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Aug 16 19:12:46 2019 +0000

description:
Pull up following revision(s) (requested by kamil in ticket #61):

        libexec/telnetd/telnetd.c: revision 1.56
        libexec/telnetd/sys_term.c: revision 1.49

telnetd: Stop defining the same variables concurrently in bss and data
auth_level and require_secure_login were defined in two places:

 - global.c that picked it from headers and removed 'extern'
 - telnetd.c that initialized it to 0

line was defined twice: in global.c and sys_term.c with a non-zero value.

Remove the definition and initialization from sys_term.c and initialize
the variable early in main().

Detected during the build of telned with Address Sanitizer (MKSANITIZER).
Reviewed by <mrg>

diffstat:

 libexec/telnetd/sys_term.c |  11 ++---------
 libexec/telnetd/telnetd.c  |  16 ++++++----------
 2 files changed, 8 insertions(+), 19 deletions(-)

diffs (87 lines):

diff -r b6275c479be8 -r c4ce6a565717 libexec/telnetd/sys_term.c
--- a/libexec/telnetd/sys_term.c        Fri Aug 16 19:10:42 2019 +0000
+++ b/libexec/telnetd/sys_term.c        Fri Aug 16 19:12:46 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_term.c,v 1.48 2018/12/13 04:29:18 maya Exp $       */
+/*     $NetBSD: sys_term.c,v 1.48.2.1 2019/08/16 19:12:46 martin Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: sys_term.c,v 1.48 2018/12/13 04:29:18 maya Exp $");
+__RCSID("$NetBSD: sys_term.c,v 1.48.2.1 2019/08/16 19:12:46 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -177,13 +177,6 @@
  *
  * Returns the file descriptor of the opened pty.
  */
-#ifndef        __GNUC__
-char *line = NULL16STR;
-#else
-static char Xline[] = NULL16STR;
-char *line = Xline;
-#endif
-
 
 static int ptyslavefd; /* for cleanopen() */
 
diff -r b6275c479be8 -r c4ce6a565717 libexec/telnetd/telnetd.c
--- a/libexec/telnetd/telnetd.c Fri Aug 16 19:10:42 2019 +0000
+++ b/libexec/telnetd/telnetd.c Fri Aug 16 19:12:46 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: telnetd.c,v 1.55 2014/02/27 18:20:21 joerg Exp $       */
+/*     $NetBSD: telnetd.c,v 1.55.28.1 2019/08/16 19:12:46 martin Exp $ */
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -65,7 +65,7 @@
 #if 0
 static char sccsid[] = "@(#)telnetd.c  8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: telnetd.c,v 1.55 2014/02/27 18:20:21 joerg Exp $");
+__RCSID("$NetBSD: telnetd.c,v 1.55.28.1 2019/08/16 19:12:46 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -86,18 +86,10 @@
 #include <krb5/com_err.h>
 #endif
 
-#ifdef AUTHENTICATION
-int    auth_level = 0;
-#endif
-
 #if    defined(AUTHENTICATION) || defined(ENCRYPTION)
 #include <libtelnet/misc.h>
 #endif
 
-#ifdef SECURELOGIN
-int    require_secure_login = 0;
-#endif
-
 extern int require_hwpreauth;
 #ifdef KRB5
 extern krb5_context telnet_context;
@@ -164,6 +156,8 @@
 int
 main(int argc, char *argv[])
 {
+       static char Xline[] = NULL16STR;
+
        socklen_t fromlen;
        int on = 1;
        int ch;
@@ -171,6 +165,8 @@
        int tos = -1;
 #endif
 
+       line = Xline;
+
        pfrontp = pbackp = ptyobuf;
        netip = netibuf;
        nfrontp = nbackp = netobuf;



Home | Main Index | Thread Index | Old Index