Bug 190174

Summary: ps truncates command-line when length is 2047 characters
Product: Red Hat Enterprise Linux 4 Reporter: Bastien Nocera <bnocera>
Component: procpsAssignee: Karel Zak <kzak>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: jturner, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-08 21:38:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bastien Nocera 2006-04-28 14:40:38 UTC
+++ This bug was initially created as a clone of Bug #134516 +++

-- Additional comment from bnocera on 2006-04-28 10:38 EST --
The problem still exists when the command-line is exactly 2047 characters
because of an off-by-one error in the procps-2.0.17-longcmd.patch patch.

in readproc.c:
        /* read whole file into a memory buffer, allocating as we go */
       while ((n = read(fd, buf, sizeof buf - 1)) > 0) {
               if (n < BUF_LEN)
                       end_of_file = 1;

BUF_LEN is *always* greater than n, as BUF_LEN is 2048, and we read up to 2048-1
characters.

Comment 2 Karel Zak 2006-04-28 15:29:11 UTC
See bug #134516. Note there is not procps-2.0.17-longcmd.patch patch.in RHEL4
(the problem has been fixed by upstream).

Comment 5 Karel Zak 2007-01-08 21:38:26 UTC

*** This bug has been marked as a duplicate of 198140 ***