Source-Changes-HG archive

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

[src/trunk]: src/libexec/telnetd PR/21233: Onno van der Linden: -U option doe...



details:   https://anonhg.NetBSD.org/src/rev/6cd9a1348c7a
branches:  trunk
changeset: 546953:6cd9a1348c7a
user:      christos <christos%NetBSD.org@localhost>
date:      Fri May 09 20:50:35 2003 +0000

description:
PR/21233: Onno van der Linden: -U option does not work as advertised.

diffstat:

 libexec/telnetd/telnetd.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r fd6bcb199edc -r 6cd9a1348c7a libexec/telnetd/telnetd.c
--- a/libexec/telnetd/telnetd.c Fri May 09 20:43:47 2003 +0000
+++ b/libexec/telnetd/telnetd.c Fri May 09 20:50:35 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: telnetd.c,v 1.35 2002/09/20 19:11:17 mycroft Exp $     */
+/*     $NetBSD: telnetd.c,v 1.36 2003/05/09 20:50:35 christos Exp $    */
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -69,7 +69,7 @@
 #if 0
 static char sccsid[] = "@(#)telnetd.c  8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: telnetd.c,v 1.35 2002/09/20 19:11:17 mycroft Exp $");
+__RCSID("$NetBSD: telnetd.c,v 1.36 2003/05/09 20:50:35 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -890,6 +890,7 @@
        int error;
        int level;
        int ptynum;
+       int flags;
        char user_name[256];
 
        /*
@@ -930,9 +931,11 @@
        }
 #endif /* _SC_CRAY_SECURE_SYS */
 
+       flags = registerd_host_only ? NI_NAMEREQD : 0;
+
        /* get name of connected client */
        error = getnameinfo(who, who->sa_len, remote_host_name,
-           sizeof(remote_host_name), NULL, 0, 0);
+           sizeof(remote_host_name), NULL, 0, flags);
 
 #if    !defined(UTMPX) && !(defined(CRAY) || defined(__hpux)) && BSD <= 43
        if (!error && strlen(remote_host_name) > utmp_len)



Home | Main Index | Thread Index | Old Index