Commit graph

10 commits

Author SHA1 Message Date
Thiébaud Weksteen
4d132a10b0 Fix build after upstream merge
- Reference renamed file: COPYING -> LICENSE in Android.bp
- Fix constext_str calls now returning const char *
- Comment out cil_write_src_info_node which is not used on Android
- Include new selinux_internal.c source file

Bug: 253327909
Test: build and boot on bramble
Test: sediff between current and new policy; no change
Change-Id: I506479befb3c0b99136cd842b2a77a6a8bea18ed
2022-11-25 14:10:15 +11:00
Thiébaud Weksteen
0ff24d85f1 Update Android.bp
Uses defaults to define the cflags.

Test: build
Bug: 215415360
Change-Id: Ic128b15ac9308508aaabfee7aa2c42a46a558190
2022-03-15 12:44:23 +11:00
Thiébaud Weksteen
e1de766bff Revert^2 "Fix build and use new cil_write_build_ast"
f4408b8e8e

Change-Id: I68eca0e6b3bea874561a414733d5320e6ffa62c9
2021-10-27 04:50:56 +00:00
Thiébaud Weksteen
f4408b8e8e Revert "Fix build and use new cil_write_build_ast"
Revert "Use cil_write_build_ast"

Revert submission 1827311-update_libselinux

Reason for revert: b/200771997 
Reverted Changes:
I088d1e94c:Fix build and use new cil_write_build_ast
I14dc4dc58:Merge remote-tracking branch 'aosp/upstream-master...
I7b77f4469:Use cil_write_build_ast

Change-Id: I7b34185a9205c550cdfee2ac29acad1bea7879a4
2021-09-22 09:15:53 +00:00
Thiébaud Weksteen
3342f74ef8 Fix build and use new cil_write_build_ast
Previously, Android used its own cil_write_ast function to output the
resulting AST. libsepol now defines a similar function named
cil_write_build_ast. The new function differs slightly in behaviour:

* It will output "source information" nodes in the resulting CIL. When
  loading, it is expected that each source information line (e.g.,
  `;;* lms 100 file.cil`) will be matched with a terminating entry (e.g.,
  `;;* lme`). If not, the loading will fail. Because we split and merge
  policy files in AOSP, explicitly ignore these lines when writing the
  AST.

* genfscon paths are now quoted following 644c5bb.

* An extra superfluous set of parentheses was previously added for some
  operators (e.g., "range" "and" or "not").

For typeattributes, cil_write_build_ast uses the `fqn` field and not
`name`. Ensure the nodes are correctly populated.

Bug: 190808996
Test: Build aosp_bramble-userdebug and manually compare the generated
    /{system,vendor,product}/etc/selinux* files with their previous
    versions. The differences are due to the new behaviours described
    above.
Test: Force a recompilation of the policy on device, the new policy is
    correctly loaded.
Change-Id: I088d1e94ca07cfbd0b6c604f1f82464b3537c392
2021-09-16 16:52:44 +02:00
Bob Badour
57866d006b [LSC] Add LOCAL_LICENSE_KINDS to external/selinux
Added SPDX-license-identifier-Apache-2.0 to:
  libselinux/fuzzers/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.1
    SPDX-license-identifier-LGPL-3.0 SPDX-license-identifier-Zlib
    legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL-2.0
    legacy_unencumbered
to:
  libselinux/Android.bp

Added SPDX-license-identifier-BSD
to:
  secilc/Android.bp

Added SPDX-license-identifier-BSD SPDX-license-identifier-GPL
    SPDX-license-identifier-LGPL SPDX-license-identifier-LGPL-2.1
    SPDX-license-identifier-LGPL-3.0 SPDX-license-identifier-Zlib
    legacy_unencumbered
to:
  libsepol/Android.bp

Added SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-LGPL
to:
  checkpolicy/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I3859438c836077d59ed424d04659213c3018f5fe
2021-02-05 01:27:52 -08:00
Nick Kralevich
b4d24a3629 libsepol: Fix compiler errors
The merge from upstream deleted and created some files.
Update the Android.bp file to incorporate those changes.

Test: compiles
Test: treehugger
Change-Id: I52d797cb43b96e5fa6e1237153d6000cc286405d
2020-02-03 13:13:09 -08:00
Chih-Hung Hsieh
f48068e8dc Use -Werror in external/selinux
* Use -Wno-error= to keep existing warnings to fix later.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Id7d641c73f396c37c1fb8c5228919c722e2bedd3
2017-10-12 20:24:01 -07:00
Dan Willemsen
300e83bfe4 Turn off libc++ for libsepol, turn off host sanitize
libsepol is entirely C, so it doesn't need libc++. On the host,
libsepolwrap loads libsepol into the system python, which does not have
the sanitizer runtime.

Test: SANITIZE_HOST=true m treble_sepolicy_tests
Test: mmma external/selinux
Change-Id: If22a6b3d492170871bdb70e71bba8148c607af01
2017-09-01 14:09:46 -07:00
Jeff Vander Stoep
a762060607 libsepol: migrate to soong
Clean up build warning
1 warning generated.
[ 55% 4201/7636] cc
out/soong/.interme...nal/selinux/libsepol/cil/src/android.o
external/selinux/libsepol/cil/src/android.c:396:87: warning: unused
parameter 'args' [-Wunused-parameter]
static int cil_attrib_typepermissive(struct cil_tree_node *node,
struct version_args *args)

Bug: 37512442
Test: build and boot Marlin.
Change-Id: I83c4908ce7ca90cfbcb84455dd539db5f0b88c5a
2017-05-09 07:18:35 -07:00