-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #579 from amazonlinux/enable-selinux
enable SELinux support
- Loading branch information
Showing
30 changed files
with
347 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "libpcre" | ||
version = "0.1.0" | ||
edition = "2018" | ||
publish = false | ||
build = "build.rs" | ||
|
||
[lib] | ||
path = "pkg.rs" | ||
|
||
[[package.metadata.build-package.external-files]] | ||
url = "https://ftp.pcre.org/pub/pcre/pcre2-10.34.tar.bz2" | ||
sha512 = "77ad75f8b0b8bbfc2f57932596151bca25b06bd621e0f047e476f38cd127f43e2052460b95c281a7e874aad2b7fd86c8f3413f4a323abb74b9440a42d0ee9524" | ||
|
||
[build-dependencies] | ||
glibc = { path = "../glibc" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use std::process::{exit, Command}; | ||
|
||
fn main() -> Result<(), std::io::Error> { | ||
let ret = Command::new("buildsys").arg("build-package").status()?; | ||
if !ret.success() { | ||
exit(1); | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Name: %{_cross_os}libpcre | ||
Version: 10.34 | ||
Release: 1%{?dist} | ||
Summary: Library for regular expressions | ||
License: BSD-3-Clause | ||
URL: https://www.pcre.org/ | ||
Source0: https://ftp.pcre.org/pub/pcre/pcre2-%{version}.tar.bz2 | ||
BuildRequires: %{_cross_os}glibc-devel | ||
|
||
%description | ||
%{summary}. | ||
|
||
%package devel | ||
Summary: Files for development using the library for regular expressions | ||
Requires: %{name} | ||
|
||
%description devel | ||
%{summary}. | ||
|
||
%prep | ||
%autosetup -n pcre2-%{version} -p1 | ||
|
||
%build | ||
%cross_configure \ | ||
--enable-newline-is-lf \ | ||
--enable-pcre2-8 \ | ||
--enable-shared \ | ||
--enable-static \ | ||
--enable-unicode \ | ||
--disable-jit \ | ||
--disable-jit-sealloc \ | ||
--disable-pcre2-16 \ | ||
--disable-pcre2-32 \ | ||
--disable-pcre2grep-callout \ | ||
--disable-pcre2grep-callout-fork \ | ||
--disable-pcre2grep-jit \ | ||
--disable-pcre2grep-libbz2 \ | ||
--disable-pcre2grep-libz \ | ||
--disable-pcre2test-libedit \ | ||
--disable-pcre2test-libreadline \ | ||
|
||
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool | ||
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool | ||
|
||
%make_build | ||
|
||
%install | ||
%make_install | ||
|
||
%files | ||
%{_cross_libdir}/*.so.* | ||
%exclude %{_cross_bindir} | ||
%exclude %{_cross_docdir} | ||
%exclude %{_cross_mandir} | ||
|
||
%files devel | ||
%{_cross_libdir}/*.a | ||
%{_cross_libdir}/*.so | ||
%{_cross_includedir}/*.h | ||
%{_cross_pkgconfigdir}/*.pc | ||
%exclude %{_cross_libdir}/*.la | ||
|
||
%changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// not used |
32 changes: 32 additions & 0 deletions
32
packages/libselinux/0001-adjust-default-selinux-directory.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From ded87ae71f953d538f7a89bfff2d0fcc417bbf06 Mon Sep 17 00:00:00 2001 | ||
From: Ben Cressey <[email protected]> | ||
Date: Tue, 3 Dec 2019 22:02:35 +0000 | ||
Subject: [PATCH] adjust default selinux directory | ||
|
||
systemd loads the SELinux policy very early, before /etc is populated | ||
with volatile files. | ||
|
||
We expect the policy to be immutable and shipped with the image, so | ||
storing it under /usr/lib is fine. | ||
|
||
Signed-off-by: Ben Cressey <[email protected]> | ||
--- | ||
src/selinux_internal.h | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/selinux_internal.h b/src/selinux_internal.h | ||
index 8b4bed2..bcaf2f7 100644 | ||
--- a/src/selinux_internal.h | ||
+++ b/src/selinux_internal.h | ||
@@ -178,7 +178,7 @@ extern int selinux_page_size hidden; | ||
} while (0) | ||
|
||
|
||
-#define SELINUXDIR "/etc/selinux/" | ||
+#define SELINUXDIR "/usr/lib/selinux/" | ||
#define SELINUXCONFIG SELINUXDIR "config" | ||
|
||
extern int has_selinux_config hidden; | ||
-- | ||
2.21.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[package] | ||
name = "libselinux" | ||
version = "0.1.0" | ||
edition = "2018" | ||
publish = false | ||
build = "build.rs" | ||
|
||
[lib] | ||
path = "pkg.rs" | ||
|
||
[[package.metadata.build-package.external-files]] | ||
url = "https://github.com/SELinuxProject/selinux/releases/download/20191204/libselinux-3.0.tar.gz" | ||
sha512 = "6fd8c3711e25cb1363232e484268609b71d823975537b3863e403836222eba026abce8ca198f64dba6f4c1ea4deb7ecef68a0397b9656a67b363e4d74409cd95" | ||
|
||
[build-dependencies] | ||
glibc = { path = "../glibc" } | ||
libpcre = { path = "../libpcre" } | ||
libsepol = { path = "../libsepol" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use std::process::{exit, Command}; | ||
|
||
fn main() -> Result<(), std::io::Error> { | ||
let ret = Command::new("buildsys").arg("build-package").status()?; | ||
if !ret.success() { | ||
exit(1); | ||
} | ||
Ok(()) | ||
} |
Oops, something went wrong.