Re: [PATCH 0/3 v5] libsepol, policycoreutils, and checkpolicy: Add support for generating CIL to libsepol and checkpolicy

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

 



I am working on switching AOSP to the upstream selinux project. Unfortunately this commit breaks the AOSP build on Mac OS. Darwin has no fmemopen. 

external/selinux/libsepol/src/module_to_cil.c:2927:7: warning: implicit declaration of function 'fmemopen' [-Wimplicit-function-declaration]
        fp = fmemopen(seusers, seusers_len, "r");
             ^
external/selinux/libsepol/src/module_to_cil.c:2927:5: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Werror,-Wint-conversion]
        fp = fmemopen(seusers, seusers_len, "r");
           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/selinux/libsepol/src/module_to_cil.c:3017:5: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Werror,-Wint-conversion]
        fp = fmemopen(userx, userx_len, "r");
           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/selinux/libsepol/src/module_to_cil.c:3073:5: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Werror,-Wint-conversion]
        fp = fmemopen(fc, fc_len, "r");
           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 3 errors generated.
make: *** [out/host/darwin-x86/obj32/STATIC_LIBRARIES/libsepol_intermediates/src/module_to_cil.o] Error 1

On Wed, Apr 1, 2015 at 10:29 AM, Steve Lawrence <slawrence@xxxxxxxxxx> wrote:
On 04/01/2015 01:11 PM, James Carter wrote:
> V5 Update usage functions for checkpolicy and checkmodule.
> V4 Adds the new command-line options to the checkpolicy and checkmodule man pages, adds error checking and messages to checkpolicy and checkmodule, updates libsepol's Android.mk and libsepol.map.in files as needed, and makes pp linke libsepol dynamically.
> V3 fixes another whitespace issue.
> V2 fixes some whitespace issues and make the new libsepol file LGPL instead of GPL.
>
> This patch set moves the code to generate CIL from pp.c in policycoreutils/hll/pp to libsepol, adds a new function to generate CIL from a module policydb, and modifies checkpolicy and checkmodule to support generating CIL as their output.
>
> The primary motivation of this work is to allow SE for Android to use the CIl compiler. Converting the policy.conf to CIL and then compiling to the kernel binary policy results in a policy that is about 20% smaller. The smaller size is because type expressions with negations are converted to type attribute sets in CIL instead of being expanded.
>
> James Carter (3):
>   libsepol, policycoreutils: Move functions to convert a module package
>     to CIL
>   libsepol: add function to generate CIL from a module policydb
>   checkpolicy: Add support for generating CIL
>
>  checkpolicy/checkmodule.8              |    5 +-
>  checkpolicy/checkmodule.c              |   66 +-
>  checkpolicy/checkpolicy.8              |    5 +-
>  checkpolicy/checkpolicy.c              |   85 +-
>  libsepol/Android.mk                    |    1 +
>  libsepol/include/sepol/module_to_cil.h |    8 +
>  libsepol/src/libsepol.map.in           |    3 +
>  libsepol/src/module_to_cil.c           | 4010 ++++++++++++++++++++++++++++++++
>  policycoreutils/hll/pp/Makefile        |    2 +-
>  policycoreutils/hll/pp/pp.c            | 3830 +-----------------------------
>  10 files changed, 4131 insertions(+), 3884 deletions(-)
>  create mode 100644 libsepol/include/sepol/module_to_cil.h
>  create mode 100644 libsepol/src/module_to_cil.c
>

Acked-by: Steve Lawrence <slawrence@xxxxxxxxxx>
_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.

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

  Powered by Linux