Bug 156768 - [patch] sockstat(1): missing spaces between long fields in output
Summary: [patch] sockstat(1): missing spaces between long fields in output
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-02 17:00 UTC by Alter
Modified: 2018-05-20 23:53 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (1.60 KB, patch)
2011-05-02 17:00 UTC, Alter
no flags Details | Diff
Always print space after procname (599 bytes, patch)
2014-08-04 10:22 UTC, Dmitry Sivachenko
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alter 2011-05-02 17:00:19 UTC
FD field is too narrow. Space between columns may be missing if we have too large value.

Fix: http://alter.org.ua/soft/fbsd/sockstat/fbsd72.sockstat.20110501.patch.gz

Patch attached with submission follows:
Comment 1 Alter 2012-06-14 15:34:25 UTC
Hello bug-followup,

unified diff is now available at
http://alter.org.ua/soft/fbsd/sockstat/fbsd72.sockstat.20120614u.patch.gz

-- 
Best regards,
 Alter                          mailto:alter@alter.org.ua
Comment 2 Lukasz Wasikowski 2013-06-30 14:32:11 UTC
Hi,

Could anyone look into this issue? sockstat output can't be used
reliably in some cases - ie. rkhunter misses lines like this:

teamspeak teamspeak_25690 18 tcp4   a.b.c.d:30033    *:*

-- 
best regards,
Lukasz Wasikowski
Comment 3 Dmitry Sivachenko freebsd_committer 2014-08-04 10:22:22 UTC
Created attachment 145337 [details]
Always print space after procname

I suggest at least the attached fix: limit username to 8 characters not to break formatting for long usernames and (more important) to always print at least one space after procname, otherwise for long procname sticks to PID and this makes mahines parsing impossible:

transmission transmissi813 9 tcp4   *:9091                *:*
Comment 4 Lukasz Wasikowski 2014-08-14 09:26:03 UTC
(In reply to Dmitry Sivachenko from comment #3)
> Created attachment 145337 [details]
> Always print space after procname
> 
> I suggest at least the attached fix: limit username to 8 characters not to
> break formatting for long usernames and (more important) to always print at
> least one space after procname, otherwise for long procname sticks to PID
> and this makes mahines parsing impossible:
> 
> transmission transmissi813 9 tcp4   *:9091                *:*

This patch works for me, thank you!
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:53:20 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"