[procps] Re: rhbz#737215 - ps does not resolve some user names

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Thu, 27 Sep 2012 15:08:15 -0500

On Sep 18, 2012, at 5:26 AM, Jaromir Capik <jcapik@xxxxxxxxxx> wrote:
> I'm unsure now, but I think that NTLM UIDs go from the upper limit
> down to zero (probably to avoid conflicts with local UIDs???).
> So ... even the very first user in the list can have
> a very long number. I'm a bit unsure if it has 24 bits or more.

Hi Jaromir,

I think I've solved the potential overflow problem, and a little bit more.  But 
rather than burden everyone with a rather large tarball, I've just sent the 
patches to Craig.

Below is a copy of my covering letter.  After Craig pushes the changes, I look 
forward to any feedback.

Regards,
Jim


--------------------------------------------------------------
Begin forwarded message:

> From: Jim Warner <james.warner@xxxxxxxxxxx>
> Subject: ps/top truncation issues
> Date: September 27, 2012 2:56:23 PM CDT
> To: Craig Small <csmall@xxxxxxxxxx>
> 
> Hi Craig,
> 
> Thanks for applying my ps patch.  Here's a brief summary of current ps/top 
> truncation state:
> 
>  PS
>  . now truncates USER type fields with '+' 
>  . never truncates PID/UID type numbers
>  . but could overflow columns, misaligning others
>  . that alerts user to need for explicit size override
> 
>  TOP
>  . automatically adjusts many widths (PID, TGID, etc)
>  . silently truncates USER types and other string fields
>  . could overflow UID type numbers, misaligning others
>  . there is no user remedy for such misalignment
> 
> With the ps commit now applied, I consider him completed with respect to 
> truncation.  However, top's silent truncation and potential overflow both 
> needed attention, so I tried to parallel ps.  And while misaligned columns in 
> ps are acceptable, under a continuously running program like top they would 
> be a disaster.
> 
> I have refactored top to eliminate any possible overflow/misalignment while 
> providing the '+' visual clue when truncation occurs.  If truncated, users 
> can dynamically (temporarily?) widen affected fields if they wish.  As I 
> noted in a commit message, a user is free to vastly exceed screen dimensions 
> with some undesirable but logical implications.
> 
> Also, as a natural outgrowth of refactoring, column headings are now 
> translatable and will be included in the .pot file.  They had to be excluded 
> previously because of their dependency on leading/trailing padding tied to 
> the now non-existent format specifiers.
> 
> Finally, I introduced separate justification capabilities for numeric and 
> string columns.  This feature may never be needed (or even used) but it 
> required very little code, carried no additional runtime costs and was 
> another benefit from refactoring (plus it was fun, see the postscript below).
> 
> In spite of all the changes, performance remains on a par with versions 3.3.1 
> through 3.3.3.
> 
> The attached tarball contains all of the above plus 3 unrelated fixes.
> 
> Regards,
> Jim
> 
> p.s. It's been over a decade since any top feature earned a place of honor in 
> the Section 7. STUPID TRICKS Sampler.  With the new justification provisions, 
> that long dry spell has finally been broken.


Other related posts: