Bug 120878 - [PATCH] lsof returns incorrect service names for sockets under some circumstances
[PATCH] lsof returns incorrect service names for sockets under some circumsta...
Status: CLOSED DUPLICATE of bug 120875
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: lsof (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-14 15:54 EDT by Neil Horman
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 14:02:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to correct byte order reversal in lsof (417 bytes, patch)
2004-04-14 15:55 EDT, Neil Horman
no flags Details | Diff

  None (edit)
Description Neil Horman 2004-04-14 15:54:03 EDT
Description of problem:
running lsof -i <PROTO>:<SVC_NAME> can return incorrect service names
if two services are configured with canonically byte swaped port values.

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1.configure an NIS server and client
2.export the services file via NIS and make sure the client searches
NIS first for services
3.add two services to the NIS services map as follows
servicea    11342/tcp
serviceb    20012/tcp
(Note that htons(11342)=20012)
4.open a socket on the NIS client and have it listen on port 11342
5.issue the command lsof -i TCP:servicea

  
Actual results:
lsof reports:
<host socket information mumble>:serviceb (LISTEN)

Expected results:
lsof should report:
<host socket information mumble>:servicea (LISTEN)

Additional info:
Comment 1 Neil Horman 2004-04-14 15:55:16 EDT
Created attachment 99425 [details]
patch to correct byte order reversal in lsof

This patch removes an extra byte swap in the print routine during a last
getservbyname call, and fixes the reported issue.
Comment 2 Jakub Jelinek 2004-04-15 03:11:52 EDT

*** This bug has been marked as a duplicate of 120875 ***
Comment 3 Neil Horman 2004-04-15 07:14:34 EDT
Jakub, are you sure these bugs are duplicates.  they're two separate
apps which need to be modified in separate places, or are you planning
on finding a common point to fix these?
Comment 4 Jakub Jelinek 2004-04-15 07:20:20 EDT
Yes, I am sure.
They are not application bugs, but libnss_nis.so* bugs, see:
http://sources.redhat.com/ml/libc-hacker/2004-03/msg00144.html
This patch is in RHEL3-U2 and AS2.1-U4 candidates ATM.
Comment 5 Red Hat Bugzilla 2006-02-21 14:02:35 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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