[patch] ps -Z can not be used when ENABLE_DESKTOP is enabled
Yuichi Nakamura
ynakam at hitachisoft.jp
Wed May 23 17:55:10 PDT 2007
Hello.
Sorry for late reply.
We made updated patch.
> I added ENABLE_SELINUX checks, and did some other changes,
> but did not move /proc/NN/attr/current parsing into procps_scan().
> Can you do it?
I addedPSSCAN_CONTEXT flag to libb.h,
and added logic to obtain SELinux attribute
to procps_scan. I also modified ps.c to use procps_scan.
Please look at attached patch.
On Sat, 12 May 2007 12:17:10 +0200
Denis Vlasenko wrote:
> On Friday 11 May 2007 07:06, Yuichi Nakamura wrote:
> >
> > There was a bug in previous patch.
> > I have received ver 2 from Shinji.
> > Please review this one.
>
> #if ENABLE_SELINUX are missing.
>
> +static void func_label(char *buf, int size, const procps_status_t *ps)
> +{
> + char procfilename[30];
> + FILE *fp;
> + snprintf(procfilename, 30, "/proc/%d/attr/current", ps->pid);
> + buf[0] = '\0';
> + if ((fp = fopen(procfilename, "r")) != NULL) {
> + fgets(buf, size+1, fp);
> + fclose(fp);
> + }
> +}
>
> /proc parsing code should be in libbb, in procps_scan() function,
> this allows to share code between ps and top. PSSCAN_LABEL bit should indicate
> to procps_scan() that we need label retrieved.
>
> You coded it so that ps reads label by itself, thus in the patch
> PSSCAN_LABEL seems to have no purpose.
>
> I added ENABLE_SELINUX checks, and did some other changes,
> but did not move /proc/NN/attr/current parsing into procps_scan().
> Can you do it?
>
> See attached.
> --
> vda
>
--
Yuichi Nakamura
Hitachi Software Engineering Co., Ltd.
Japan SELinux Users Group(JSELUG)
SELinux Policy Editor: http://seedit.sourceforge.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.patch
Type: application/octet-stream
Size: 5839 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070524/b67050b5/attachment.obj
More information about the busybox
mailing list