All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Paul Moore <pmoore@redhat.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: [PATCH selinux-testsuite] capable_net: check for ifconfig in different locations
Date: Wed, 4 Dec 2013 21:54:08 +0000	[thread overview]
Message-ID: <20131204215408.GA28279@mail.hallyn.com> (raw)
In-Reply-To: <20131204204244.29439.79786.stgit@localhost>

Quoting Paul Moore (pmoore@redhat.com):
> Pardon my C-like Perl, but in current Fedora Rawhide releases we need
> to check for ifconfig in /usr/bin and not just /sbin.
> 
> Signed-off-by: Paul Moore <pmoore@redhat.com>

Thanks, looks good, will apply.

> ---
>  tests/capable_net/test |   13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/capable_net/test b/tests/capable_net/test
> index 378bf92..24261c3 100755
> --- a/tests/capable_net/test
> +++ b/tests/capable_net/test
> @@ -8,11 +8,20 @@ BEGIN { plan tests => 5 }
>  
>  $basedir = $0;  $basedir =~ s|(.*)/[^/]*|$1|;
>  
> +# Find a usable ifconfig
> +if (-x "/sbin/ifconfig") {
> +	$ifconfig = "/sbin/ifconfig";
> +} elsif (-x "/usr/bin/ifconfig") {
> +	$ifconfig = "/usr/bin/ifconfig";
> +} else {
> +	BAIL_OUT("can not find a copy of ifconfig");
> +}
> +
>  #
>  # Tests for the good domain.
>  #
>  # CAP_NET_ADMIN
> -$result = system "runcon -t test_ncap_t -- /sbin/ifconfig lo -promisc 2>&1";
> +$result = system "runcon -t test_ncap_t -- $ifconfig lo -promisc 2>&1";
>  ok($result, 0); 
>  
>  # CAP_NET_BIND_SERVICE
> @@ -30,7 +39,7 @@ ok($result, 0);
>  #
>  
>  # CAP_NET_ADMIN
> -$result = system "runcon -t test_resncap_t -- /sbin/ifconfig lo -promisc 2>&1";
> +$result = system "runcon -t test_resncap_t -- $ifconfig lo -promisc 2>&1";
>  ok($result); 
>  
>  # CAP_NET_BIND_SERVICE; included in can_network by fedora policy

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2013-12-04 21:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 20:42 [PATCH selinux-testsuite] capable_net: check for ifconfig in different locations Paul Moore
2013-12-04 21:54 ` Serge E. Hallyn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-12-03 23:02 Paul Moore

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=20131204215408.GA28279@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=pmoore@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.