From ca5fb2430ec4c36e4765ea0e9cb00a5a1e087eda Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson Date: Sat, 27 Nov 2010 00:04:42 +0100 Subject: [PATCH 1/3] inetd: Improve printout of service changes. --- ChangeLog | 8 ++++++++ src/inetd.c | 14 +++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08c3b23..232c611 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-11-26 Mats Erik Andersson + + * src/inetd.c (print_service): If `ISMUX(SEP)' then present the + node name as `tcpmux' or as `tcpmuxplus'. Make 'builtin=' show + actual service name, or `no' for non-builtins. + (fix_tcpmux): Let SERV.se_file report `fix_tcpmux' as origin. + Correct some spelling mistakes in error message. + 2010-11-24 Mats Erik Andersson * tests/addrpeek.c: New file. diff --git a/src/inetd.c b/src/inetd.c index 625ebff..7f7adbb 100644 --- a/src/inetd.c +++ b/src/inetd.c @@ -523,12 +523,15 @@ void print_service (const char *action, struct servtab *sep) { fprintf (stderr, - "%s:%d: %s: %s:%s proto=%s, wait=%d, max=%u, user=%s builtin=%lx server=%s\n", + "%s:%d: %s: %s:%s proto=%s, wait=%d, max=%u, user=%s builtin=%s server=%s\n", sep->se_file, sep->se_line, action, - sep->se_node ? sep->se_node : "*", sep->se_service, sep->se_proto, + ISMUX (sep) ? (ISMUXPLUS (sep) ? "tcpmuxplus" : "tcpmux") + : (sep->se_node ? sep->se_node : "*"), + sep->se_service, sep->se_proto, sep->se_wait, sep->se_max, sep->se_user, - (long) sep->se_bi, sep->se_server); + sep->se_bi ? sep->se_bi->bi_service : "no", + sep->se_server); } @@ -1227,6 +1230,7 @@ fix_tcpmux (void) struct servtab serv; memset (&serv, 0, sizeof (serv)); + serv.se_file = "fix_tcpmux"; serv.se_service = newstr ("tcpmux"); serv.se_socktype = SOCK_STREAM; serv.se_checked = 1; @@ -1237,8 +1241,8 @@ fix_tcpmux (void) /* Should not happen */ freeconfig (&serv); if (debug) - fprintf (stderr, "INETERNAL ERROR: could not found tcpmux built-in"); - syslog (LOG_ERR, "INETERNAL ERROR: could not found tcpmux built-in"); + fprintf (stderr, "INTERNAL ERROR: could not find tcpmux built-in"); + syslog (LOG_ERR, "INTERNAL ERROR: could not find tcpmux built-in"); return; } serv.se_wait = serv.se_bi->bi_wait; -- 1.7.2.3