Bug 139615 - databases/mytop - error in case of client IP without hostname
Summary: databases/mytop - error in case of client IP without hostname
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-15 00:10 UTC by Miroslav Lachman
Modified: 2009-10-26 16:00 UTC (History)
0 users

See Also:


Attachments
file.diff (4.12 KB, patch)
2009-10-15 00:10 UTC, Miroslav Lachman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Lachman 2009-10-15 00:10:01 UTC
On machine with private network IP address (192.168.1.xx) without DNS or entry in /etc/hosts mytop command shows following error message for each line containing hosts connected from unresolvable IP:
Use of uninitialized value in substitution (s///) at /usr/local/bin/mytop line 998.

It is old known problem. The fix can be found on other systems:
http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/7ac750bd208e819a?pli=1

Fix: @@ -952,8 +955,11 @@
         {
             $thread->{Host} =~ s/:\d+$//;
             my $host = gethostbyaddr(inet_aton($thread->{Host}), AF_INET);
-            $host =~ s/^([^.]+).*/$1/;
-            $thread->{Host} = $host;
+            if ($host)
+            {
+              $host =~ s/^([^.]+).*/$1/;
+              $thread->{Host} = $host;
+            }
         }


Attached patch is reorganized original patch-mytop including fix above.

Patch attached with submission follows:
How-To-Repeat: Install and use mytop on machine with LAN clients without IP to hostname entry in DNS or /etc/hosts.

For example machine with 192.168.1.2, run mytop, connect to configurred mysql server from client with IP 192.168.1.3 and mytop show:
Use of uninitialized value in substitution (s///) at /usr/local/bin/mytop line 998.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-10-15 00:10:09 UTC
Maintainer of databases/mytop,

Please note that PR ports/139615 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/139615

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2009-10-15 00:10:11 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Matthew Seaman 2009-10-15 07:39:14 UTC
Edwin Groothuis wrote:
> Maintainer of databases/mytop,
> 
> Please note that PR ports/139615 has just been submitted.
> 
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
> 
> The full text of the PR can be found at:
>     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/139615
> 


Approved, and thanks.

	Cheers,

	Matthew


-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2009-10-15 08:04:34 UTC
State Changed
From-To: feedback->open

Maintainer approved.
Comment 5 Pav Lucistnik freebsd_committer freebsd_triage 2009-10-26 15:49:30 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 6 dfilter service freebsd_committer freebsd_triage 2009-10-26 15:56:16 UTC
pav         2009-10-26 15:56:07 UTC

  FreeBSD ports repository

  Modified files:
    databases/mytop      Makefile 
    databases/mytop/files patch-mytop 
  Log:
  - Squelch perl warning triggered when a client is connected to the server and
    his IP cannot be resolved into a hostname
  
  PR:             ports/139615
  Submitted by:   Miroslav Lachman <000.fbsd@quip.cz>
  Approved by:    Matthew Seaman <m.seaman@infracaninophile.co.uk> (maintainer)
  
  Revision  Changes    Path
  1.22      +1 -1      ports/databases/mytop/Makefile
  1.8       +44 -32    ports/databases/mytop/files/patch-mytop
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"