INN commit: trunk (nnrpd/nnrpd.c scripts/innreport_inn.pm)

INN Commit rra at isc.org
Sat Feb 6 11:29:33 UTC 2010


    Date: Saturday, February 6, 2010 @ 03:29:33
  Author: iulius
Revision: 8948

Log the port number of a connection (nnrpd).

Modified:
  trunk/nnrpd/nnrpd.c
  trunk/scripts/innreport_inn.pm

--------------------------+
 nnrpd/nnrpd.c            |    6 +++---
 scripts/innreport_inn.pm |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Modified: nnrpd/nnrpd.c
===================================================================
--- nnrpd/nnrpd.c	2010-02-06 11:28:56 UTC (rev 8947)
+++ nnrpd/nnrpd.c	2010-02-06 11:29:33 UTC (rev 8948)
@@ -531,7 +531,7 @@
 **  Determine access rights of the client.
 */
 static void
-StartConnection(void)
+StartConnection(unsigned short port)
 {
     static const char *default_host_error = "unknown error";
     struct sockaddr_storage ssc, sss;
@@ -612,7 +612,7 @@
      * of overviews and slow answers on some architectures (like BSD/OS). */
     setsockopt(STDIN_FILENO, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay));
 
-    notice("%s (%s) connect", Client.host, Client.ip);
+    notice("%s (%s) connect - port %u", Client.host, Client.ip, port);
 
     PERMgetaccess(NNRPACCESS);
     PERMgetpermissions();
@@ -1217,7 +1217,7 @@
     xsignal(SIGPIPE, CatchPipe);
 
     /* Get permissions and see if we can talk to this client. */
-    StartConnection();
+    StartConnection(ListenPort);
     if (!PERMcanread && !PERMcanpost && !PERMneedauth) {
 	syslog(L_NOTICE, "%s no_permission", Client.host);
 	Reply("%d You have no permission to talk.  Goodbye!\r\n",

Modified: scripts/innreport_inn.pm
===================================================================
--- scripts/innreport_inn.pm	2010-02-06 11:28:56 UTC (rev 8947)
+++ scripts/innreport_inn.pm	2010-02-06 11:29:33 UTC (rev 8948)
@@ -1536,7 +1536,7 @@
     return 1 if $left =~ /^python: dynamic authorization access for read access granted$/o;
     return 1 if $left =~ /^python: dynamic authorization access type is not known: /o;
     # connect
-    if ($left =~ /(\S+) (\([0-9a-fA-F:.]*\) )?connect$/o) {
+    if ($left =~ /(\S+) (\([0-9a-fA-F:.]*\) )?connect(?: - port \d+)?$/o) {
       my $cust = $1;
       $cust = lc $cust unless $CASE_SENSITIVE;
       my $dom = &host2dom($cust);




More information about the inn-committers mailing list