SELinux userspace 2.9 release

This commit is contained in:
Petr Lautrbach 2019-03-18 16:56:53 +01:00
parent f3c6251fc2
commit 6aa9d48ad7
4 changed files with 63 additions and 67 deletions

1
.gitignore vendored
View File

@ -211,3 +211,4 @@ libselinux-2.0.96.tgz
/libselinux-2.8.tar.gz
/libselinux-2.9-rc1.tar.gz
/libselinux-2.9-rc2.tar.gz
/libselinux-2.9.tar.gz

View File

@ -1,7 +1,7 @@
diff --git libselinux-2.9-rc2/man/man8/selinux.8 libselinux-2.9-rc2/man/man8/selinux.8
diff --git libselinux-2.9/man/man8/selinux.8 libselinux-2.9/man/man8/selinux.8
index e37aee6..bf23b65 100644
--- libselinux-2.9-rc2/man/man8/selinux.8
+++ libselinux-2.9-rc2/man/man8/selinux.8
--- libselinux-2.9/man/man8/selinux.8
+++ libselinux-2.9/man/man8/selinux.8
@@ -91,11 +91,13 @@ This manual page was written by Dan Walsh <dwalsh@redhat.com>.
.BR sepolicy (8),
.BR system-config-selinux (8),
@ -17,10 +17,10 @@ index e37aee6..bf23b65 100644
Every confined service on the system has a man page in the following format:
.br
diff --git libselinux-2.9-rc2/src/avc_sidtab.c libselinux-2.9-rc2/src/avc_sidtab.c
diff --git libselinux-2.9/src/avc_sidtab.c libselinux-2.9/src/avc_sidtab.c
index 9669264..c775430 100644
--- libselinux-2.9-rc2/src/avc_sidtab.c
+++ libselinux-2.9-rc2/src/avc_sidtab.c
--- libselinux-2.9/src/avc_sidtab.c
+++ libselinux-2.9/src/avc_sidtab.c
@@ -81,6 +81,11 @@ sidtab_context_to_sid(struct sidtab *s,
int hvalue, rc = 0;
struct sidtab_node *cur;
@ -33,10 +33,10 @@ index 9669264..c775430 100644
*sid = NULL;
hvalue = sidtab_hash(ctx);
diff --git libselinux-2.9-rc2/src/canonicalize_context.c libselinux-2.9-rc2/src/canonicalize_context.c
diff --git libselinux-2.9/src/canonicalize_context.c libselinux-2.9/src/canonicalize_context.c
index ba4c9a2..c815872 100644
--- libselinux-2.9-rc2/src/canonicalize_context.c
+++ libselinux-2.9-rc2/src/canonicalize_context.c
--- libselinux-2.9/src/canonicalize_context.c
+++ libselinux-2.9/src/canonicalize_context.c
@@ -17,6 +17,11 @@ int security_canonicalize_context_raw(const char * con,
size_t size;
int fd, ret;
@ -49,10 +49,10 @@ index ba4c9a2..c815872 100644
if (!selinux_mnt) {
errno = ENOENT;
return -1;
diff --git libselinux-2.9-rc2/src/check_context.c libselinux-2.9-rc2/src/check_context.c
diff --git libselinux-2.9/src/check_context.c libselinux-2.9/src/check_context.c
index 8a7997f..5be8434 100644
--- libselinux-2.9-rc2/src/check_context.c
+++ libselinux-2.9-rc2/src/check_context.c
--- libselinux-2.9/src/check_context.c
+++ libselinux-2.9/src/check_context.c
@@ -14,6 +14,11 @@ int security_check_context_raw(const char * con)
char path[PATH_MAX];
int fd, ret;
@ -65,10 +65,10 @@ index 8a7997f..5be8434 100644
if (!selinux_mnt) {
errno = ENOENT;
return -1;
diff --git libselinux-2.9-rc2/src/compute_av.c libselinux-2.9-rc2/src/compute_av.c
diff --git libselinux-2.9/src/compute_av.c libselinux-2.9/src/compute_av.c
index a47cffe..6d285a2 100644
--- libselinux-2.9-rc2/src/compute_av.c
+++ libselinux-2.9-rc2/src/compute_av.c
--- libselinux-2.9/src/compute_av.c
+++ libselinux-2.9/src/compute_av.c
@@ -27,6 +27,11 @@ int security_compute_av_flags_raw(const char * scon,
return -1;
}
@ -81,10 +81,10 @@ index a47cffe..6d285a2 100644
snprintf(path, sizeof path, "%s/access", selinux_mnt);
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
diff --git libselinux-2.9-rc2/src/compute_create.c libselinux-2.9-rc2/src/compute_create.c
diff --git libselinux-2.9/src/compute_create.c libselinux-2.9/src/compute_create.c
index 0975aea..3e6a48c 100644
--- libselinux-2.9-rc2/src/compute_create.c
+++ libselinux-2.9-rc2/src/compute_create.c
--- libselinux-2.9/src/compute_create.c
+++ libselinux-2.9/src/compute_create.c
@@ -64,6 +64,11 @@ int security_compute_create_name_raw(const char * scon,
return -1;
}
@ -97,10 +97,10 @@ index 0975aea..3e6a48c 100644
snprintf(path, sizeof path, "%s/create", selinux_mnt);
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
diff --git libselinux-2.9-rc2/src/compute_member.c libselinux-2.9-rc2/src/compute_member.c
diff --git libselinux-2.9/src/compute_member.c libselinux-2.9/src/compute_member.c
index 4e2d221..d1dd977 100644
--- libselinux-2.9-rc2/src/compute_member.c
+++ libselinux-2.9-rc2/src/compute_member.c
--- libselinux-2.9/src/compute_member.c
+++ libselinux-2.9/src/compute_member.c
@@ -25,6 +25,11 @@ int security_compute_member_raw(const char * scon,
return -1;
}
@ -113,10 +113,10 @@ index 4e2d221..d1dd977 100644
snprintf(path, sizeof path, "%s/member", selinux_mnt);
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
diff --git libselinux-2.9-rc2/src/compute_relabel.c libselinux-2.9-rc2/src/compute_relabel.c
diff --git libselinux-2.9/src/compute_relabel.c libselinux-2.9/src/compute_relabel.c
index 49f77ef..c3db7c0 100644
--- libselinux-2.9-rc2/src/compute_relabel.c
+++ libselinux-2.9-rc2/src/compute_relabel.c
--- libselinux-2.9/src/compute_relabel.c
+++ libselinux-2.9/src/compute_relabel.c
@@ -25,6 +25,11 @@ int security_compute_relabel_raw(const char * scon,
return -1;
}
@ -129,10 +129,10 @@ index 49f77ef..c3db7c0 100644
snprintf(path, sizeof path, "%s/relabel", selinux_mnt);
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
diff --git libselinux-2.9-rc2/src/compute_user.c libselinux-2.9-rc2/src/compute_user.c
diff --git libselinux-2.9/src/compute_user.c libselinux-2.9/src/compute_user.c
index 7b88121..401fd10 100644
--- libselinux-2.9-rc2/src/compute_user.c
+++ libselinux-2.9-rc2/src/compute_user.c
--- libselinux-2.9/src/compute_user.c
+++ libselinux-2.9/src/compute_user.c
@@ -24,6 +24,11 @@ int security_compute_user_raw(const char * scon,
return -1;
}
@ -145,10 +145,10 @@ index 7b88121..401fd10 100644
snprintf(path, sizeof path, "%s/user", selinux_mnt);
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
diff --git libselinux-2.9-rc2/src/fsetfilecon.c libselinux-2.9-rc2/src/fsetfilecon.c
diff --git libselinux-2.9/src/fsetfilecon.c libselinux-2.9/src/fsetfilecon.c
index 52707d0..0cbe12d 100644
--- libselinux-2.9-rc2/src/fsetfilecon.c
+++ libselinux-2.9-rc2/src/fsetfilecon.c
--- libselinux-2.9/src/fsetfilecon.c
+++ libselinux-2.9/src/fsetfilecon.c
@@ -9,8 +9,12 @@
int fsetfilecon_raw(int fd, const char * context)
@ -164,10 +164,10 @@ index 52707d0..0cbe12d 100644
if (rc < 0 && errno == ENOTSUP) {
char * ccontext = NULL;
int err = errno;
diff --git libselinux-2.9-rc2/src/lsetfilecon.c libselinux-2.9-rc2/src/lsetfilecon.c
diff --git libselinux-2.9/src/lsetfilecon.c libselinux-2.9/src/lsetfilecon.c
index 1d3b28a..ea6d70b 100644
--- libselinux-2.9-rc2/src/lsetfilecon.c
+++ libselinux-2.9-rc2/src/lsetfilecon.c
--- libselinux-2.9/src/lsetfilecon.c
+++ libselinux-2.9/src/lsetfilecon.c
@@ -9,8 +9,13 @@
int lsetfilecon_raw(const char *path, const char * context)
@ -184,38 +184,30 @@ index 1d3b28a..ea6d70b 100644
if (rc < 0 && errno == ENOTSUP) {
char * ccontext = NULL;
int err = errno;
diff --git libselinux-2.9-rc2/src/procattr.c libselinux-2.9-rc2/src/procattr.c
index 48dd8af..cbb6824 100644
--- libselinux-2.9-rc2/src/procattr.c
+++ libselinux-2.9-rc2/src/procattr.c
@@ -22,8 +22,21 @@ static pthread_key_t destructor_key;
static int destructor_key_initialized = 0;
static __thread char destructor_initialized;
diff --git libselinux-2.9/src/procattr.c libselinux-2.9/src/procattr.c
index c6799ef..cbb6824 100644
--- libselinux-2.9/src/procattr.c
+++ libselinux-2.9/src/procattr.c
@@ -24,6 +24,7 @@ static __thread char destructor_initialized;
-#ifndef __BIONIC__
-/* Bionic declares this in unistd.h and has a definition for it */
+/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and
+ * has a definition for it */
/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and
* has a definition for it */
+#ifndef OVERRIDE_GETTID
+#ifdef __BIONIC__
+ #define OVERRIDE_GETTID 0
+#elif !defined(__GLIBC_PREREQ)
+ #define OVERRIDE_GETTID 1
+#elif !__GLIBC_PREREQ(2,30)
+ #define OVERRIDE_GETTID 1
+#else
+ #define OVERRIDE_GETTID 0
#ifdef __BIONIC__
#define OVERRIDE_GETTID 0
#elif !defined(__GLIBC_PREREQ)
@@ -33,6 +34,7 @@ static __thread char destructor_initialized;
#else
#define OVERRIDE_GETTID 0
#endif
+#endif
+#endif
+
+#if OVERRIDE_GETTID
#if OVERRIDE_GETTID
static pid_t gettid(void)
{
return syscall(__NR_gettid);
diff --git libselinux-2.9-rc2/src/setfilecon.c libselinux-2.9-rc2/src/setfilecon.c
diff --git libselinux-2.9/src/setfilecon.c libselinux-2.9/src/setfilecon.c
index d05969c..3f0200e 100644
--- libselinux-2.9-rc2/src/setfilecon.c
+++ libselinux-2.9-rc2/src/setfilecon.c
--- libselinux-2.9/src/setfilecon.c
+++ libselinux-2.9/src/setfilecon.c
@@ -9,8 +9,12 @@
int setfilecon_raw(const char *path, const char * context)

View File

@ -1,20 +1,20 @@
%define ruby_inc %(pkg-config --cflags ruby)
%define libsepolver 2.9-0.rc2
%define libsepolver 2.9-1
Summary: SELinux library and simple utilities
Name: libselinux
Version: 2.9
Release: 0.rc2.1%{?dist}
Release: 1%{?dist}
License: Public Domain
# https://github.com/SELinuxProject/selinux/wiki/Releases
Source0: https://github.com/SELinuxProject/selinux/releases/download/20190301/libselinux-2.9-rc2.tar.gz
Source0: https://github.com/SELinuxProject/selinux/releases/download/20190315/libselinux-2.9.tar.gz
Source1: selinuxconlist.8
Source2: selinuxdefcon.8
Url: https://github.com/SELinuxProject/selinux/wiki
# download https://raw.githubusercontent.com/fedora-selinux/scripts/master/selinux/make-fedora-selinux-patch.sh
# run:
# $ VERSION=2.9-rc2 ./make-fedora-selinux-patch.sh libselinux
# HEAD https://github.com/fedora-selinux/selinux/commit/cb42e1bf324698875492f6f8f7adf9c5f7778aab
# $ VERSION=2.9 ./make-fedora-selinux-patch.sh libselinux
# HEAD https://github.com/fedora-selinux/selinux/commit/431f72836d6c02450725cf6ffb1c7223b9fa6acc
Patch1: libselinux-fedora.patch
BuildRequires: gcc
BuildRequires: python2 python2-devel ruby-devel ruby libsepol-static >= %{libsepolver} swig pcre2-devel xz-devel
@ -98,7 +98,7 @@ The libselinux-static package contains the static libraries
needed for developing SELinux applications.
%prep
%autosetup -p 1 -n libselinux-%{version}-rc2
%autosetup -p 1 -n libselinux-%{version}
%build
export DISABLE_RPM="y"
@ -234,6 +234,9 @@ rm -f %{buildroot}%{_mandir}/man8/togglesebool*
%{ruby_vendorarchdir}/selinux.so
%changelog
* Mon Mar 18 2019 Petr Lautrbach <plautrba@redhat.com> - 2.9-1
- SELinux userspace 2.9 release
* Wed Mar 6 2019 Petr Lautrbach <plautrba@redhat.com> - 2.9-0.rc2.1
- SELinux userspace 2.9-rc2 release

View File

@ -1 +1 @@
SHA512 (libselinux-2.9-rc2.tar.gz) = b216928b090f769639bc888a69af102685247d574d1a2a44527fca1cd04d9396747080b5db87668bb01e2f8426ee74591826be7ee54de2f297e9766bcc417883
SHA512 (libselinux-2.9.tar.gz) = 727b211d09f374d45aa3fa4dec7fd5463dfdcf5aaa47f7fcaccee51fb74896c3aa1a6f0bac9cdd47ebe4929effff13f66f5f70447b27b783dca5f7b1576d30d0