All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominick Grift <dac.override@gmail.com>
To: selinux@tycho.nsa.gov
Subject: Re: [PATCH 2/2] semanage: default to "s0" if serange empty for port modify
Date: Mon, 15 Aug 2016 10:52:27 +0200	[thread overview]
Message-ID: <4bc07f02-6fde-fe57-e65b-153b1185e440@gmail.com> (raw)
In-Reply-To: <1471250698-16573-2-git-send-email-mvadkert@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1668 bytes --]

On 08/15/2016 10:44 AM, Miroslav Vadkerti wrote:
> In case serange is empty, but the record is beeing modified
> (setype was supplied), use default "s0" range. With the original
> code the audit event would be printed with no range (i.e.
> "system_u:object_r:ssh_port_t:")
> 
> Note that default "s0" is currently used in other places
> of seobject.py.
> 

Note-to-self: when we deal with refpolicy specific identifiers like
system_u remember to also deal with these. Since these are essentially
also refpolicy specific identifiers.

> Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
> ---
>  policycoreutils/semanage/seobject.py | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py
> index 538ff0a..a6681f0 100644
> --- a/policycoreutils/semanage/seobject.py
> +++ b/policycoreutils/semanage/seobject.py
> @@ -1161,8 +1161,11 @@ class portRecords(semanageRecords):
>  
>          con = semanage_port_get_con(p)
>  
> -        if (is_mls_enabled == 1) and (serange != ""):
> -            semanage_context_set_mls(self.sh, con, untranslate(serange))
> +        if is_mls_enabled == 1:
> +            if serange == "":
> +                serange = "s0"
> +            else:
> +                semanage_context_set_mls(self.sh, con, untranslate(serange))
>          if setype != "":
>              semanage_context_set_type(self.sh, con, setype)
>  
> 


-- 
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8  02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 648 bytes --]

  reply	other threads:[~2016-08-15  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15  8:44 [PATCH 1/2] semanage: use socket.getprotobyname for protocol Miroslav Vadkerti
2016-08-15  8:44 ` [PATCH 2/2] semanage: default to "s0" if serange empty for port modify Miroslav Vadkerti
2016-08-15  8:52   ` Dominick Grift [this message]
2016-08-15 18:29 ` [PATCH 1/2] semanage: use socket.getprotobyname for protocol James Carter

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=4bc07f02-6fde-fe57-e65b-153b1185e440@gmail.com \
    --to=dac.override@gmail.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.