Sometimes with libselinux present but SELinux inactive
the context reported is "unconfined" which contains an
embedded newline. This then causes misalignment of any
subsequent data. So, ps will now protect against that.
Reference(s):
http://www.freelists.org/post/procps/enablelibselinux-switch,14
Signed-off-by: Jim Warner <james.warner@comcast.net>
len = strlen(context);
if(len > max_len) len = max_len;
memcpy(outbuf, context, len);
+ if (outbuf[len-1] == '\n') --len;
outbuf[len] = '\0';
free(context);
}else{