From 2e78a17edabd63d548e6ffd71d516c894e5de96a Mon Sep 17 00:00:00 2001 From: albert <> Date: Wed, 5 Jan 2005 20:09:03 +0000 Subject: [PATCH] security labels can contain any printable ASCII --- NEWS | 4 ++++ ps/output.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 4a89b482..ed49f0d3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +procps-3.2.4 --> procps-3.2.5 + +ps: security labels can contain any printable ASCII + procps-3.2.3 --> procps-3.2.4 support 64-bit MIPS with n32 binary diff --git a/ps/output.c b/ps/output.c index 47442062..3d8862ae 100644 --- a/ps/output.c +++ b/ps/output.c @@ -1087,7 +1087,7 @@ static int pr_context(char *restrict const outbuf, const proc_t *restrict const // wchan file is suitable for testing //snprintf(filename, sizeof filename, "/proc/%d/wchan", pp->tgid); - snprintf(filename, sizeof filename, "/proc/%d/attr/current", pp->tgid); +snprintf(filename, sizeof filename, "/proc/%d/attr/current", pp->tgid); fd = open(filename, O_RDONLY, 0); if(likely(fd==-1)) goto fail; @@ -1096,10 +1096,10 @@ static int pr_context(char *restrict const outbuf, const proc_t *restrict const if(unlikely(num_read<=0)) goto fail; outbuf[num_read] = '\0'; - len = strspn(outbuf, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:_0123456789/^"); - if(!len) goto fail; + len = 0; + while(outbuf[len]>' ' && outbuf[len]<='~') len++; outbuf[len] = '\0'; - return len; + if(len) return len; fail: outbuf[0] = '-';