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):
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
(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
<host socket information mumble>:serviceb (LISTEN)
lsof should report:
<host socket information mumble>:servicea (LISTEN)
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.
*** This bug has been marked as a duplicate of 120875 ***
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?
Yes, I am sure.
They are not application bugs, but libnss_nis.so* bugs, see:
This patch is in RHEL3-U2 and AS2.1-U4 candidates ATM.
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.