Re: [PATCH v1 8/9] semanage: Update semanage to allow runtime labeling of ibendports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 15, 2017 at 11:42:40PM +0300, Dan Jurgens wrote:
> From: Daniel Jurgens <danielj@xxxxxxxxxxxx>
> 
> Update libsepol and libsemanage to work with ibendport records. Add local
> storage for new and modified ibendport records in ibendports.local.
> Update semanage to parse the ibendport command options to add, modify,
> and delete them.
> 
> Signed-off-by: Daniel Jurgens <danielj@xxxxxxxxxxxx>
> 
> ---
> v1:
> Jason Zaman:
> - Use SETools directly to query types in seobject.py
> 
> Signed-off-by: Daniel Jurgens <danielj@xxxxxxxxxxxx>
> diff --git a/python/semanage/seobject.py b/python/semanage/seobject.py
> index 41b0aca..037c9ae 100644
> --- a/python/semanage/seobject.py
> +++ b/python/semanage/seobject.py
> @@ -1565,6 +1565,245 @@ class ibpkeyRecords(semanageRecords):
>                  rec += ", %s" % p
>              print rec
>  
> +class ibendportRecords(semanageRecords):
> +    try:
> +        q = setools.TypeQuery(setools.SELinuxPolicy(sepolicy.get_installed_policy()), attrs=["ibendport_type"])
> +        valid_types = sorted(str(t) for t in q.results())

Super minor nit pick here: set() (or even frozenset()) is probably
better than sorted() since you appear to only just check membership.

I probably wouldnt bother updating unless there is a v2 for some other
reason.

And if want it on this or an updated version:
Acked-by: Jason Zaman <jason@xxxxxxxxxxxxx>

-- Jason



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux