Commit graph

16 commits

Author SHA1 Message Date
Brian Murray
d72d78d969 Improve selinux utils wrappers
Added checks to wrapper scripts for selinux utils. Before running
commands, verify enviromental variables are set and that required files
exists. Return an error code in the event of failure.

Test: Verify audit2allow, audit2why, sediff, seinfo commands still run.
Test: Verify failure if prerequisites are not satisfied.

Change-Id: I3705a90e0a81704829aa5a5feedbfe22aec5fa55
Signed-off-by: Brian Murray <Brian@Clover.com>
2017-06-23 09:08:33 -07:00
William Roberts
32e425e247 sesearch: don't clobber PYTHONPATH
Allow PYTHONPATH to be specified through the environment, this handy
for having the networkx dependency in a non-standard location for
when the user doesn't have admin rights.

Test: Uninstall networkx and run sesearch so it throws an exception on
      not being able to resolve networkx. export PYTHONPATH to point
      to a local download of networkx. Run sesearch and ensure the
      exception on networkx goes away.

Change-Id: I490ffe28e872af4a6d94103e49d487b06147f3f3
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2017-04-04 17:07:49 -07:00
Nick Kralevich
9af686cf3f Delete "libselinux.so.1"
Use the libselinux.so library that's already compiled for the host
rather than relying on a prebuilt library. Add functions needed by
the prebuilt python wrappers.

While I'm here, delete -DDARWIN. This define is no longer used as of
commit bedef7d124

Bug: 33170640
Test: code compiles
Test: audit2allow, audit2why, sediff, and search work

Change-Id: I4c8d9eef6149339744e9b3ef823683289d25551c
2016-11-30 19:14:01 +00:00
Nick Kralevich
715ff04e5c Revert "Delete "libselinux.so.1""
The mac build is broken. Reverting while I figure out an appropriate solution.

external/selinux/libselinux/src/avc_internal.c:21:10: fatal error: 'linux/types.h' file not found
#include <linux/types.h>

This reverts commit 85457a374f.

Bug: 33170640
Change-Id: I285d0b4d138897725f54180812a6c816755d4db5
2016-11-29 01:08:36 +00:00
Nick Kralevich
85457a374f Delete "libselinux.so.1"
Use the libselinux.so library that's already compiled for the host
rather than relying on a prebuilt library. Add functions needed by the
prebuilt python wrappers.

Bug: 33170640
Test: code compiles
Test: audit2allow, audit2why, sediff, and search work
Change-Id: Ibcd26f3cbb10fe5576d77b8b7715dd769205c9d0
2016-11-28 13:15:49 -08:00
Nick Kralevich
d4f63e1bc6 audit2allow / audit2why: fix broken paths
Commit 48dc2326 (Move
policycoreutils/{sepolicy,audit2allow,semanage,scripts/chcat*} and
sepolgen to python.) broke our audit2allow and audit2why wrappers. Fix
them.

Test: audit2allow and audit2why work from the command line
Change-Id: I07a37279677773c3d2b86e21257f75bbeb58a2e2
2016-11-22 20:05:53 -08:00
Jeff Vander Stoep
c0410e0e5e Update prebuilt setools to 4.0.1
Adds support for extended permissions.

Change-Id: I89862c49020c7b87d4907963db2e12f2b6536dca
2016-05-19 09:23:05 -07:00
Jeff Vander Stoep
e4205bda05 selinux: add sediff prebuilt
update seinfo

Bug: 26480956
Change-Id: I383050200fca7a2a7ca1a72a3aeb4be6bbec2086
2016-02-04 13:29:22 -08:00
Jeff Vander Stoep
29145d69eb Merge "setools: point audit2allow back to /bin/sh" 2015-06-18 23:01:57 +00:00
Jeff Vander Stoep
37bab14763 setools: point audit2allow back to /bin/sh
Change-Id: Ifb65488e9e58575e6a9a9fd6c009b3a7db7ba5ba
2015-06-18 16:00:05 -07:00
Jeff Vander Stoep
cb4c73022a add prebuilt seinfo
Change-Id: I48b9cd9c6a47d9d71ed43dbab4306106b18c76fc
2015-06-18 09:19:53 -07:00
Jeff Vander Stoep
8a2e0bafc9 Move python libraries to prebuilt directory
Update script syntax to work with sh/dash/bash

Add cleanspec

Change-Id: Ifc19252d8d8e178b86c51fe1f54e162a61ffc0dd
2015-06-18 15:23:21 +00:00
Jeff Vander Stoep
51abfb29ee Merge "adding sesearch to prebuilts" 2015-06-18 15:21:24 +00:00
Jeff Vander Stoep
c4022dd423 adding sesearch to prebuilts
Change-Id: I95c04b3f72c397857385e638fc1b7591f9cf6925
2015-06-17 16:52:49 -07:00
William Roberts
3f392cdbcd Fix Linux-only check in prebuilt audit2allow
Fix the following error:

$ audit2allow external/selinux/prebuilts/bin/audit2allow: 4: /external/selinux/prebuilts/bin/audit2allow: [[: not found
audit2allow is only supported on linux

Bug: 21894097
Change-Id: Ic7df339daa3a8db891fd8de3584da10c8bb2f4d5
2015-06-17 11:44:30 -07:00
Jeff Vander Stoep
24f9ffc478 audit2allow: execute selinux tools from prebuilts
Instead of moving audit2allow into out directory, run directly from
selinux/prebuilts. Include path in build/envsetup.sh

Includes some general cleanup of the file structure.

Bug: 21724977
Change-Id: Ide320a56b9cdbfa426b978443f6df07fa2a38fbc
2015-06-12 10:09:18 -07:00