Bug 589366 - mytop doesn't handle addresses without a reverse DNS entry properly
mytop doesn't handle addresses without a reverse DNS entry properly
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mytop (Show other bugs)
12
All Linux
low Severity low
: ---
: ---
Assigned To: Terje Røsten
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-05 19:40 EDT by Andreas Girgensohn
Modified: 2010-05-10 19:45 EDT (History)
1 user (show)

See Also:
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 12:56:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andreas Girgensohn 2010-05-05 19:40:39 EDT
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 10:10:22 EDT
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 10:10:27 EDT
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 10:10:32 EDT
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 10:13:16 EDT
Thanks for report and patch.
Comment 5 Fedora Update System 2010-05-10 12:56:54 EDT
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 13:05:30 EDT
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 19:45:47 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.