ae9676a337
Under some circumstances the ksh shell doesn't fork new processes when executing scripts and the script is interpreted by the parent process. That makes the execution faster, but it means ksh needs to reuse the /proc/PID/cmdline for the new script name and arguments while the file length needs to stay untouched. The fork is skipped only when the new cmdline is shorter than the parent's cmdline and the rest of the file is filled with '\0'. This is perfectly ok until we try to read the cmdline of such process. As the read_unvectored() function replaces all zeros with chosen separator, these trailing zeros are replaced with spaces in case of the ps tool. Consequently it appends multiple spaces at the end of the arguments string even when these zeros do not represent any separators and therefore shouldn't be replaced. With this commit the read_unvectored() function skips the replacement of trailing zeros and separates valid content only. Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1057600 |
||
---|---|---|
.. | ||
alloc.c | ||
alloc.h | ||
COPYING | ||
devname.c | ||
devname.h | ||
escape.c | ||
escape.h | ||
ksym.c | ||
libprocps.pc.in | ||
libprocps.sym | ||
Makefile.am | ||
procps.h | ||
pwcache.c | ||
pwcache.h | ||
readproc.c | ||
readproc.h | ||
sig.c | ||
sig.h | ||
slab.c | ||
slab.h | ||
sysinfo.c | ||
sysinfo.h | ||
version.c | ||
version.h | ||
wchan.h | ||
whattime.c | ||
whattime.h |