From: Richard Haines <richard_c_haines-FhtRXb7CoQBt1OO0OYaSVA@public.gmane.org>
To: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
Cc: "netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"selinux-+05T5uksL2qpZYMLLGbcSA@public.gmane.org"
<selinux-+05T5uksL2qpZYMLLGbcSA@public.gmane.org>
Subject: Re: [PATCH] ss: Add support for retrieving SELinux contexts
Date: Fri, 21 Feb 2014 12:27:43 +0000 (GMT) [thread overview]
Message-ID: <1392985663.86285.YahooMailNeo@web87903.mail.ir2.yahoo.com> (raw)
In-Reply-To: <1392556690.15615.97.camel-nDn/Rdv9kqW9Jme8/bJn5UCKIB8iOfG2tUK59QYPAWc@public.gmane.org>
I've updated the patch with your suggestions and rebuild using the latest git
repository. Will send V2 patch today.
Thanks
Richard
----- Original Message -----
> From: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
> To: Richard Haines <richard_c_haines-FhtRXb7CoQBt1OO0OYaSVA@public.gmane.org>
> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; selinux-+05T5uksL2qpZYMLLGbcSA@public.gmane.org
> Sent: Sunday, 16 February 2014, 13:18
> Subject: Re: [PATCH] ss: Add support for retrieving SELinux contexts
>
> On Fri, 2014-02-14 at 15:20 +0000, Richard Haines wrote:
>> The process SELinux contexts can be added to the output using the -Z
>> option. Using the -z option will show the process and socket contexts (see
>> the man page for details).
>> For netlink sockets: if valid process show process context, if pid = 0
>> show kernel initial context, if unknown show "not available".
>>
>> Signed-off-by: Richard Haines <richard_c_haines-FhtRXb7CoQBt1OO0OYaSVA@public.gmane.org>
>> ---
>> configure | 16 +++
>> man/man8/ss.8 | 34 ++++++
>> misc/Makefile | 12 ++
>> misc/ss.c | 375
> ++++++++++++++++++++++++++++++++++++++++++++++++++--------
>> 4 files changed, 387 insertions(+), 50 deletions(-)
>>
>> diff --git a/configure b/configure
>> index da01c19..854837e 100755
>> --- a/configure
>> +++ b/configure
>> @@ -231,6 +231,19 @@ EOF
>> rm -f $TMPDIR/ipsettest.c $TMPDIR/ipsettest
>> }
>>
>> +check_selinux()
>> +# SELinux is a compile time option in the ss utility
>> +{
>> + SELINUX_LIB=$(${PKG_CONFIG} --silence-errors libselinux --libs)
>> + if [ -n "$SELINUX_LIB" ]
>
> This should be just:
> if pkg-config libselinux --exists
>
>> + then
>> + echo "HAVE_SELINUX:=y" >>Config
>> + echo "yes"
>> + else
>> + echo "no"
>> + fi
>> +}
> [...]
>> --- a/misc/Makefile
>> +++ b/misc/Makefile
>> @@ -8,6 +8,18 @@ include ../Config
>> all: $(TARGETS)
>>
>> ss: $(SSOBJ)
>> +ifeq ($(HAVE_SELINUX),y)
>> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SSOBJ) $(LDLIBS) -lselinux
>
> This should use the output of 'pkg-config libselinux --libs'.
>
>> +else
>> + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SSOBJ) $(LDLIBS)
>> +endif
>> +
>> +ss.o: ss.c
>> +ifeq ($(HAVE_SELINUX),y)
>> + $(CC) $(CFLAGS) -DHAVE_SELINUX -c $+
>
> This should use the output of 'pkg-config libselinux --cflags'.
>
>> +else
>> + $(CC) $(CFLAGS) -c $+
>> +endif
> [...]
>
> Ben.
>
> --
> Ben Hutchings
> Any sufficiently advanced bug is indistinguishable from a feature.
>
_______________________________________________
Selinux mailing list
Selinux-+05T5uksL2qpZYMLLGbcSA@public.gmane.org
To unsubscribe, send email to Selinux-leave-+05T5uksL2pAGbPMOrvdOA@public.gmane.org
To get help, send an email containing "help" to Selinux-request-+05T5uksL2pUKDJzkOSz4g@public.gmane.orgov.
prev parent reply other threads:[~2014-02-21 12:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-14 15:20 [PATCH] ss: Add support for retrieving SELinux contexts Richard Haines
2014-02-16 13:18 ` Ben Hutchings
[not found] ` <1392556690.15615.97.camel-nDn/Rdv9kqW9Jme8/bJn5UCKIB8iOfG2tUK59QYPAWc@public.gmane.org>
2014-02-21 12:27 ` Richard Haines [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392985663.86285.YahooMailNeo@web87903.mail.ir2.yahoo.com \
--to=richard_c_haines-fhtrxb7coqbt1oo0oyasva@public.gmane.org \
--cc=ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=selinux-+05T5uksL2qpZYMLLGbcSA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox