Bug 589366

Summary: mytop doesn't handle addresses without a reverse DNS entry properly
Product: [Fedora] Fedora Reporter: Andreas Girgensohn <andreasg123>
Component: mytopAssignee: Terje Røsten <terje.rosten>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 12CC: terje.rosten
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: mytop-1.7-3.b737f60.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-10 16:56:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andreas Girgensohn 2010-05-05 23:40:39 UTC
Description of problem:

When a client without a reverse DNS entry is connected to the MySQL server, mytop displays an error message and doesn't show the client address.

Version-Release number of selected component (if applicable):
mytop-1.7-1.b737f60.fc12.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run mytop while a client without a reverse DNS entry is connection to the MySQL server.
  
Actual results:

The following message shows up in the middle of the output:
Use of uninitialized value $host in substitution (s///) at /usr/bin/mytop line 958.

The IP address of the client is replaced by an empty string.

Expected results:

The IP address of the client should be shown.

Additional info:

Here is a patch that fixes that problem.

--- /usr/bin/mytop      2010-03-27 14:05:52.000000000 -0700
+++ /home/andreasg/bin/mytop    2010-05-05 15:15:54.000000000 -0700
@@ -955,8 +955,11 @@
         {
             $thread->{Host} =~ s/:\d+$//;
             my $host = gethostbyaddr(inet_aton($thread->{Host}), AF_INET);
-            $host =~ s/^([^.]+).*/$1/;
-            $thread->{Host} = $host;
+           if (defined $host)
+           {
+               $host =~ s/^([^.]+).*/$1/;
+               $thread->{Host} = $host;
+           }
         }
 
         ## Fix possible undefs

Comment 1 Fedora Update System 2010-05-09 14:10:22 UTC
mytop-1.7-3.b737f60.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/mytop-1.7-3.b737f60.fc11

Comment 2 Fedora Update System 2010-05-09 14:10:27 UTC
mytop-1.7-3.b737f60.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/mytop-1.7-3.b737f60.fc13

Comment 3 Fedora Update System 2010-05-09 14:10:32 UTC
mytop-1.7-3.b737f60.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/mytop-1.7-3.b737f60.fc12

Comment 4 Terje Røsten 2010-05-09 14:13:16 UTC
Thanks for report and patch.

Comment 5 Fedora Update System 2010-05-10 16:56:54 UTC
mytop-1.7-3.b737f60.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2010-05-10 17:05:30 UTC
mytop-1.7-3.b737f60.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2010-05-10 23:45:47 UTC
mytop-1.7-3.b737f60.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.