Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/inetd query service name properly on libwrap warnings.



details:   https://anonhg.NetBSD.org/src/rev/f6373b33ff18
branches:  trunk
changeset: 474985:f6373b33ff18
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Jul 28 10:58:31 1999 +0000

description:
query service name properly on libwrap warnings.

NetBSD PR: 8101

diffstat:

 usr.sbin/inetd/inetd.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (39 lines):

diff -r aa7334a6906b -r f6373b33ff18 usr.sbin/inetd/inetd.c
--- a/usr.sbin/inetd/inetd.c    Wed Jul 28 10:07:05 1999 +0000
+++ b/usr.sbin/inetd/inetd.c    Wed Jul 28 10:58:31 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inetd.c,v 1.51 1999/07/19 15:49:39 ghudson Exp $       */
+/*     $NetBSD: inetd.c,v 1.52 1999/07/28 10:58:31 itojun Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
 #if 0
 static char sccsid[] = "@(#)inetd.c    8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.51 1999/07/19 15:49:39 ghudson Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.52 1999/07/28 10:58:31 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -660,14 +660,14 @@
                fromhost(&req);
                denied = !hosts_access(&req);
                if (denied || lflag) {
-                       sp = getservbyport(sep->se_ctrladdr_in.sin_port,
-                           sep->se_proto);
-                       if (sp == NULL) {
+                       if (getnameinfo(&sep->se_ctrladdr,
+                                       sep->se_ctrladdr.sa_len, NULL, 0,
+                                       buf, sizeof(buf), 0) != 0) {
+                               /* shouldn't happen */
                                (void)snprintf(buf, sizeof buf, "%d",
                                    ntohs(sep->se_ctrladdr_in.sin_port));
-                               service = buf;
-                       } else
-                               service = sp->s_name;
+                       }
+                       service = buf;
                }
                if (denied) {
                        syslog(deny_severity,



Home | Main Index | Thread Index | Old Index