https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288731

            Bug ID: 288731
           Summary: sockstat: -p option broken by libxo conversion
           Product: Base System
           Version: 15.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

sockstat's -p option is supposed to filter sockets by port.  It used to.  But
the addition of libxo broke it.  For example:

somers@fbsd-head ~/s/f/s/u/sockstat ((7b35b4d1))>
/usr/obj/usr/home/somers/src/freebsd.org/src/amd64.amd64/usr.bin/sockstat/sockstat
 -4p 22
USER COMMAND     PID FD PROTO LOCAL ADDRESS         FOREIGN ADDRESS      
root sshd       3683  8 tcp4  *:22                  *:*                  
root syslogd    2619  7 udp4  *:514                 *:*       

That last line uses port 514, so it shouldn't be there.  It wasn't, on versions
of sockstat that didn't use libXO.

The problem seems to be that libXO changes the default encoding from "NONE" to
"UTF-8", and that influences how digittoint works.  That in turn breaks port
parsing.  A minimal solution might be to replace digittoint with digittoint_l. 
But a more robust solution would be to refactor to use strtol instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to