SELinux userspace 2.8-rc1 release candidate

This commit is contained in:
Petr Lautrbach 2018-04-23 13:21:56 +02:00
parent 680bec3de6
commit 036a8af3d6
4 changed files with 55 additions and 323 deletions

1
.gitignore vendored
View File

@ -205,3 +205,4 @@ libselinux-2.0.96.tgz
/libselinux-2.5.tar.gz
/libselinux-2.6.tar.gz
/libselinux-2.7.tar.gz
/libselinux-2.8-rc1.tar.gz

View File

@ -1,123 +1,7 @@
diff --git libselinux-2.7/Makefile libselinux-2.7/Makefile
index 1ecab17..16531fe 100644
--- libselinux-2.7/Makefile
+++ libselinux-2.7/Makefile
@@ -21,13 +21,14 @@ export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST
USE_PCRE2 ?= n
ifeq ($(USE_PCRE2),y)
- PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
- PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
+ PCRE_MODULE := libpcre2-8
+ PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
else
- PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
- PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
+ PCRE_MODULE := libpcre
endif
-export PCRE_CFLAGS PCRE_LDLIBS
+PCRE_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(PCRE_MODULE))
+PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs $(PCRE_MODULE))
+export PCRE_MODULE PCRE_CFLAGS PCRE_LDLIBS
OS := $(shell uname)
export OS
diff --git libselinux-2.7/include/Makefile libselinux-2.7/include/Makefile
index 757a6c9..8ab9ce9 100644
--- libselinux-2.7/include/Makefile
+++ libselinux-2.7/include/Makefile
@@ -1,12 +1,12 @@
# Installation directories.
-PREFIX ?= $(DESTDIR)/usr
-INCDIR ?= $(PREFIX)/include/selinux
+PREFIX ?= /usr
+INCDIR = $(PREFIX)/include/selinux
all:
install: all
- test -d $(INCDIR) || install -m 755 -d $(INCDIR)
- install -m 644 $(wildcard selinux/*.h) $(INCDIR)
+ test -d $(DESTDIR)$(INCDIR) || install -m 755 -d $(DESTDIR)$(INCDIR)
+ install -m 644 $(wildcard selinux/*.h) $(DESTDIR)$(INCDIR)
relabel:
diff --git libselinux-2.7/man/Makefile libselinux-2.7/man/Makefile
index 0643e6a..f634d1f 100644
--- libselinux-2.7/man/Makefile
+++ libselinux-2.7/man/Makefile
@@ -1,17 +1,18 @@
# Installation directories.
-MAN8DIR ?= $(DESTDIR)/usr/share/man/man8
-MAN5DIR ?= $(DESTDIR)/usr/share/man/man5
-MAN3DIR ?= $(DESTDIR)/usr/share/man/man3
+PREFIX ?= /usr
+MAN8DIR ?= $(PREFIX)/share/man/man8
+MAN5DIR ?= $(PREFIX)/share/man/man5
+MAN3DIR ?= $(PREFIX)/share/man/man3
all:
install: all
- mkdir -p $(MAN3DIR)
- mkdir -p $(MAN5DIR)
- mkdir -p $(MAN8DIR)
- install -m 644 man3/*.3 $(MAN3DIR)
- install -m 644 man5/*.5 $(MAN5DIR)
- install -m 644 man8/*.8 $(MAN8DIR)
+ mkdir -p $(DESTDIR)$(MAN3DIR)
+ mkdir -p $(DESTDIR)$(MAN5DIR)
+ mkdir -p $(DESTDIR)$(MAN8DIR)
+ install -m 644 man3/*.3 $(DESTDIR)$(MAN3DIR)
+ install -m 644 man5/*.5 $(DESTDIR)$(MAN5DIR)
+ install -m 644 man8/*.8 $(DESTDIR)$(MAN8DIR)
relabel:
diff --git libselinux-2.7/man/man5/removable_context.5 libselinux-2.7/man/man5/removable_context.5
index 60aaa93..f16e8bd 100644
--- libselinux-2.7/man/man5/removable_context.5
+++ libselinux-2.7/man/man5/removable_context.5
@@ -3,8 +3,7 @@
removable_context \- The SELinux removable devices context configuration file
.
.SH "DESCRIPTION"
-This file contains the default label that should be used for removable devices that are not defined in the \fImedia\fR file (that is described in
-.BR selabel_media "(5)). "
+This file contains the default label that should be used for removable devices.
.sp
.BR selinux_removable_context_path "(3) "
will return the active policy path to this file. The default removable context file is:
@@ -34,4 +33,4 @@ A user, role, type and optional range (for MCS/MLS) separated by colons (:) that
system_u:object_r:removable_t:s0
.
.SH "SEE ALSO"
-.BR selinux "(8), " selinux_removable_context_path "(3), " selabel_media "(5), " selinux_config "(5) "
+.BR selinux "(8), " selinux_removable_context_path "(3), " selinux_config "(5) "
diff --git libselinux-2.7/man/man5/selabel_media.5 libselinux-2.7/man/man5/selabel_media.5
index 395ed0e..b7c28e3 100644
--- libselinux-2.7/man/man5/selabel_media.5
+++ libselinux-2.7/man/man5/selabel_media.5
@@ -52,8 +52,6 @@ The default media contexts file is:
.RE
.sp
Where \fI{SELINUXTYPE}\fR is the entry from the selinux configuration file \fIconfig\fR (see \fBselinux_config\fR(5)).
-.sp
-Should there not be a valid entry in the \fImedia\fR file, then the default \fIremovable_context\fR file will be read (see \fBremovable_context\fR(5)).
.
.SH "FILE FORMAT"
Each line within the \fImedia\fR file is as follows:
@@ -90,4 +88,4 @@ this is not set, then it is possible for an invalid context to be returned.
.SH "SEE ALSO"
.ad l
.nh
-.BR selinux "(8), " selabel_open "(3), " selabel_lookup "(3), " selabel_stats "(3), " selabel_close "(3), " selinux_set_callback "(3), " selinux_media_context_path "(3), " freecon "(3), " selinux_config "(5), " removable_context "(5) "
+.BR selinux "(8), " selabel_open "(3), " selabel_lookup "(3), " selabel_stats "(3), " selabel_close "(3), " selinux_set_callback "(3), " selinux_media_context_path "(3), " freecon "(3), " selinux_config "(5) "
diff --git libselinux-2.7/man/man8/selinux.8 libselinux-2.7/man/man8/selinux.8
diff --git libselinux-2.8-rc1/man/man8/selinux.8 libselinux-2.8-rc1/man/man8/selinux.8
index e37aee6..bf23b65 100644
--- libselinux-2.7/man/man8/selinux.8
+++ libselinux-2.7/man/man8/selinux.8
--- libselinux-2.8-rc1/man/man8/selinux.8
+++ libselinux-2.8-rc1/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),
@ -133,124 +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.7/src/Makefile libselinux-2.7/src/Makefile
index 2408fae..8af04aa 100644
--- libselinux-2.7/src/Makefile
+++ libselinux-2.7/src/Makefile
@@ -8,19 +8,17 @@ RUBYPREFIX ?= $(notdir $(RUBY))
PKG_CONFIG ?= pkg-config
# Installation directories.
-PREFIX ?= $(DESTDIR)/usr
+PREFIX ?= /usr
LIBDIR ?= $(PREFIX)/lib
-SHLIBDIR ?= $(DESTDIR)/lib
+SHLIBDIR ?= /lib
INCLUDEDIR ?= $(PREFIX)/include
PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
-PYSITEDIR ?= $(DESTDIR)$(shell $(PYTHON) -c 'import site; print(site.getsitepackages()[0])')
+PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))")
PYCEXT ?= $(shell $(PYTHON) -c 'import imp;print([s for s,m,t in imp.get_suffixes() if t == imp.C_EXTENSION][0])')
RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]')
RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')
-RUBYINSTALL ?= $(DESTDIR)$(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')
-LIBBASE ?= $(shell basename $(LIBDIR))
-LIBSEPOLA ?= $(LIBDIR)/libsepol.a
+RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')
VERSION = $(shell cat ../VERSION)
LIBVERSION = 1
@@ -50,6 +48,13 @@ LIBSO=$(TARGET).$(LIBVERSION)
AUDIT2WHYLOBJ=$(PYPREFIX)audit2why.lo
AUDIT2WHYSO=$(PYPREFIX)audit2why.so
+# If no specific libsepol.a is specified, fall back on LDFLAGS search path
+# Otherwise, as $(LIBSEPOLA) already appears in the dependencies, there
+# is no need to define a value for LDLIBS_LIBSEPOLA
+ifeq ($(LIBSEPOLA),)
+ LDLIBS_LIBSEPOLA := -l:libsepol.a
+endif
+
GENERATED=$(SWIGCOUT) $(SWIGRUBYCOUT) selinuxswig_python_exception.i
SRCS= $(filter-out $(GENERATED) audit2why.c, $(sort $(wildcard *.c)))
@@ -148,7 +153,7 @@ $(LIBSO): $(LOBJS)
ln -sf $@ $(TARGET)
$(LIBPC): $(LIBPC).in ../VERSION
- sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@
+ sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCLUDEDIR):; s:@PCRE_MODULE@:$(PCRE_MODULE):' < $< > $@
selinuxswig_python_exception.i: ../include/selinux/selinux.h
bash -e exception.sh > $@ || (rm -f $@ ; false)
@@ -157,7 +162,7 @@ $(AUDIT2WHYLOBJ): audit2why.c
$(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
$(AUDIT2WHYSO): $(AUDIT2WHYLOBJ) $(LIBSEPOLA)
- $(CC) $(CFLAGS) $(LDFLAGS) -L. -shared -o $@ $^ -lselinux $(PYLIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -L. -shared -o $@ $^ -lselinux $(LDLIBS_LIBSEPOLA) $(PYLIBS)
%.o: %.c policy.h
$(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
@@ -177,26 +182,26 @@ swigify: $(SWIGIF)
$(SWIG) $<
install: all
- test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
- install -m 644 $(LIBA) $(LIBDIR)
- test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
- install -m 755 $(LIBSO) $(SHLIBDIR)
- test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
- install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
- ln -sf --relative $(SHLIBDIR)/$(LIBSO) $(LIBDIR)/$(TARGET)
+ test -d $(DESTDIR)$(LIBDIR) || install -m 755 -d $(DESTDIR)$(LIBDIR)
+ install -m 644 $(LIBA) $(DESTDIR)$(LIBDIR)
+ test -d $(DESTDIR)$(SHLIBDIR) || install -m 755 -d $(DESTDIR)$(SHLIBDIR)
+ install -m 755 $(LIBSO) $(DESTDIR)$(SHLIBDIR)
+ test -d $(DESTDIR)$(LIBDIR)/pkgconfig || install -m 755 -d $(DESTDIR)$(LIBDIR)/pkgconfig
+ install -m 644 $(LIBPC) $(DESTDIR)$(LIBDIR)/pkgconfig
+ ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
install-pywrap: pywrap
- test -d $(PYSITEDIR)/selinux || install -m 755 -d $(PYSITEDIR)/selinux
- install -m 755 $(SWIGSO) $(PYSITEDIR)/_selinux$(PYCEXT)
- install -m 755 $(AUDIT2WHYSO) $(PYSITEDIR)/selinux/audit2why$(PYCEXT)
- install -m 644 $(SWIGPYOUT) $(PYSITEDIR)/selinux/__init__.py
+ test -d $(DESTDIR)$(PYTHONLIBDIR)/selinux || install -m 755 -d $(DESTDIR)$(PYTHONLIBDIR)/selinux
+ install -m 755 $(SWIGSO) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
+ install -m 755 $(AUDIT2WHYSO) $(DESTDIR)$(PYTHONLIBDIR)/selinux/audit2why$(PYCEXT)
+ install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
install-rubywrap: rubywrap
- test -d $(RUBYINSTALL) || install -m 755 -d $(RUBYINSTALL)
- install -m 755 $(SWIGRUBYSO) $(RUBYINSTALL)/selinux.so
+ test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL)
+ install -m 755 $(SWIGRUBYSO) $(DESTDIR)$(RUBYINSTALL)/selinux.so
relabel:
- /sbin/restorecon $(SHLIBDIR)/$(LIBSO)
+ /sbin/restorecon $(DESTDIR)$(SHLIBDIR)/$(LIBSO)
clean-pywrap:
-rm -f $(SWIGLOBJ) $(SWIGSO) $(AUDIT2WHYLOBJ) $(AUDIT2WHYSO)
diff --git libselinux-2.7/src/avc.c libselinux-2.7/src/avc.c
index 96b2678..5230efd 100644
--- libselinux-2.7/src/avc.c
+++ libselinux-2.7/src/avc.c
@@ -4,7 +4,7 @@
* Author : Eamon Walsh <ewalsh@epoch.ncsc.mil>
*
* Derived from the kernel AVC implementation by
- * Stephen Smalley <sds@epoch.ncsc.mil> and
+ * Stephen Smalley <sds@tycho.nsa.gov> and
* James Morris <jmorris@redhat.com>.
*/
#include <selinux/avc.h>
diff --git libselinux-2.7/src/avc_sidtab.c libselinux-2.7/src/avc_sidtab.c
diff --git libselinux-2.8-rc1/src/avc_sidtab.c libselinux-2.8-rc1/src/avc_sidtab.c
index 9669264..c775430 100644
--- libselinux-2.7/src/avc_sidtab.c
+++ libselinux-2.7/src/avc_sidtab.c
--- libselinux-2.8-rc1/src/avc_sidtab.c
+++ libselinux-2.8-rc1/src/avc_sidtab.c
@@ -81,6 +81,11 @@ sidtab_context_to_sid(struct sidtab *s,
int hvalue, rc = 0;
struct sidtab_node *cur;
@ -263,10 +33,10 @@ index 9669264..c775430 100644
*sid = NULL;
hvalue = sidtab_hash(ctx);
diff --git libselinux-2.7/src/booleans.c libselinux-2.7/src/booleans.c
diff --git libselinux-2.8-rc1/src/booleans.c libselinux-2.8-rc1/src/booleans.c
index 1da55bf..604c588 100644
--- libselinux-2.7/src/booleans.c
+++ libselinux-2.7/src/booleans.c
--- libselinux-2.8-rc1/src/booleans.c
+++ libselinux-2.8-rc1/src/booleans.c
@@ -55,6 +55,7 @@ int security_get_boolean_names(char ***names, int *len)
snprintf(path, sizeof path, "%s%s", selinux_mnt, SELINUX_BOOL_DIR);
*len = scandir(path, &namelist, &filename_select, alphasort);
@ -275,10 +45,10 @@ index 1da55bf..604c588 100644
return -1;
}
diff --git libselinux-2.7/src/canonicalize_context.c libselinux-2.7/src/canonicalize_context.c
diff --git libselinux-2.8-rc1/src/canonicalize_context.c libselinux-2.8-rc1/src/canonicalize_context.c
index ba4c9a2..c815872 100644
--- libselinux-2.7/src/canonicalize_context.c
+++ libselinux-2.7/src/canonicalize_context.c
--- libselinux-2.8-rc1/src/canonicalize_context.c
+++ libselinux-2.8-rc1/src/canonicalize_context.c
@@ -17,6 +17,11 @@ int security_canonicalize_context_raw(const char * con,
size_t size;
int fd, ret;
@ -291,10 +61,10 @@ index ba4c9a2..c815872 100644
if (!selinux_mnt) {
errno = ENOENT;
return -1;
diff --git libselinux-2.7/src/check_context.c libselinux-2.7/src/check_context.c
diff --git libselinux-2.8-rc1/src/check_context.c libselinux-2.8-rc1/src/check_context.c
index 8a7997f..5be8434 100644
--- libselinux-2.7/src/check_context.c
+++ libselinux-2.7/src/check_context.c
--- libselinux-2.8-rc1/src/check_context.c
+++ libselinux-2.8-rc1/src/check_context.c
@@ -14,6 +14,11 @@ int security_check_context_raw(const char * con)
char path[PATH_MAX];
int fd, ret;
@ -307,10 +77,10 @@ index 8a7997f..5be8434 100644
if (!selinux_mnt) {
errno = ENOENT;
return -1;
diff --git libselinux-2.7/src/compute_av.c libselinux-2.7/src/compute_av.c
diff --git libselinux-2.8-rc1/src/compute_av.c libselinux-2.8-rc1/src/compute_av.c
index 1d05e7b..d9095cc 100644
--- libselinux-2.7/src/compute_av.c
+++ libselinux-2.7/src/compute_av.c
--- libselinux-2.8-rc1/src/compute_av.c
+++ libselinux-2.8-rc1/src/compute_av.c
@@ -26,6 +26,11 @@ int security_compute_av_flags_raw(const char * scon,
return -1;
}
@ -323,10 +93,10 @@ index 1d05e7b..d9095cc 100644
snprintf(path, sizeof path, "%s/access", selinux_mnt);
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
diff --git libselinux-2.7/src/compute_create.c libselinux-2.7/src/compute_create.c
diff --git libselinux-2.8-rc1/src/compute_create.c libselinux-2.8-rc1/src/compute_create.c
index 0975aea..3e6a48c 100644
--- libselinux-2.7/src/compute_create.c
+++ libselinux-2.7/src/compute_create.c
--- libselinux-2.8-rc1/src/compute_create.c
+++ libselinux-2.8-rc1/src/compute_create.c
@@ -64,6 +64,11 @@ int security_compute_create_name_raw(const char * scon,
return -1;
}
@ -339,10 +109,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.7/src/compute_member.c libselinux-2.7/src/compute_member.c
diff --git libselinux-2.8-rc1/src/compute_member.c libselinux-2.8-rc1/src/compute_member.c
index 4e2d221..d1dd977 100644
--- libselinux-2.7/src/compute_member.c
+++ libselinux-2.7/src/compute_member.c
--- libselinux-2.8-rc1/src/compute_member.c
+++ libselinux-2.8-rc1/src/compute_member.c
@@ -25,6 +25,11 @@ int security_compute_member_raw(const char * scon,
return -1;
}
@ -355,10 +125,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.7/src/compute_relabel.c libselinux-2.7/src/compute_relabel.c
diff --git libselinux-2.8-rc1/src/compute_relabel.c libselinux-2.8-rc1/src/compute_relabel.c
index 49f77ef..c3db7c0 100644
--- libselinux-2.7/src/compute_relabel.c
+++ libselinux-2.7/src/compute_relabel.c
--- libselinux-2.8-rc1/src/compute_relabel.c
+++ libselinux-2.8-rc1/src/compute_relabel.c
@@ -25,6 +25,11 @@ int security_compute_relabel_raw(const char * scon,
return -1;
}
@ -371,10 +141,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.7/src/compute_user.c libselinux-2.7/src/compute_user.c
diff --git libselinux-2.8-rc1/src/compute_user.c libselinux-2.8-rc1/src/compute_user.c
index 7b88121..401fd10 100644
--- libselinux-2.7/src/compute_user.c
+++ libselinux-2.7/src/compute_user.c
--- libselinux-2.8-rc1/src/compute_user.c
+++ libselinux-2.8-rc1/src/compute_user.c
@@ -24,6 +24,11 @@ int security_compute_user_raw(const char * scon,
return -1;
}
@ -387,10 +157,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.7/src/fsetfilecon.c libselinux-2.7/src/fsetfilecon.c
diff --git libselinux-2.8-rc1/src/fsetfilecon.c libselinux-2.8-rc1/src/fsetfilecon.c
index 52707d0..0cbe12d 100644
--- libselinux-2.7/src/fsetfilecon.c
+++ libselinux-2.7/src/fsetfilecon.c
--- libselinux-2.8-rc1/src/fsetfilecon.c
+++ libselinux-2.8-rc1/src/fsetfilecon.c
@@ -9,8 +9,12 @@
int fsetfilecon_raw(int fd, const char * context)
@ -406,29 +176,10 @@ index 52707d0..0cbe12d 100644
if (rc < 0 && errno == ENOTSUP) {
char * ccontext = NULL;
int err = errno;
diff --git libselinux-2.7/src/libselinux.pc.in libselinux-2.7/src/libselinux.pc.in
index 2cd04d3..7c66b1f 100644
--- libselinux-2.7/src/libselinux.pc.in
+++ libselinux-2.7/src/libselinux.pc.in
@@ -1,12 +1,12 @@
prefix=@prefix@
exec_prefix=${prefix}
-libdir=${exec_prefix}/@libdir@
+libdir=@libdir@
includedir=@includedir@
Name: libselinux
Description: SELinux utility library
Version: @VERSION@
URL: http://userspace.selinuxproject.org/
-Requires.private: libsepol libpcre
+Requires.private: libsepol @PCRE_MODULE@
Libs: -L${libdir} -lselinux
Cflags: -I${includedir}
diff --git libselinux-2.7/src/lsetfilecon.c libselinux-2.7/src/lsetfilecon.c
diff --git libselinux-2.8-rc1/src/lsetfilecon.c libselinux-2.8-rc1/src/lsetfilecon.c
index 1d3b28a..ea6d70b 100644
--- libselinux-2.7/src/lsetfilecon.c
+++ libselinux-2.7/src/lsetfilecon.c
--- libselinux-2.8-rc1/src/lsetfilecon.c
+++ libselinux-2.8-rc1/src/lsetfilecon.c
@@ -9,8 +9,13 @@
int lsetfilecon_raw(const char *path, const char * context)
@ -445,10 +196,10 @@ index 1d3b28a..ea6d70b 100644
if (rc < 0 && errno == ENOTSUP) {
char * ccontext = NULL;
int err = errno;
diff --git libselinux-2.7/src/setfilecon.c libselinux-2.7/src/setfilecon.c
diff --git libselinux-2.8-rc1/src/setfilecon.c libselinux-2.8-rc1/src/setfilecon.c
index d05969c..3f0200e 100644
--- libselinux-2.7/src/setfilecon.c
+++ libselinux-2.7/src/setfilecon.c
--- libselinux-2.8-rc1/src/setfilecon.c
+++ libselinux-2.8-rc1/src/setfilecon.c
@@ -9,8 +9,12 @@
int setfilecon_raw(const char *path, const char * context)
@ -464,35 +215,10 @@ index d05969c..3f0200e 100644
if (rc < 0 && errno == ENOTSUP) {
char * ccontext = NULL;
int err = errno;
diff --git libselinux-2.7/utils/Makefile libselinux-2.7/utils/Makefile
index eb4851a..d06ffd6 100644
--- libselinux-2.7/utils/Makefile
+++ libselinux-2.7/utils/Makefile
@@ -1,8 +1,6 @@
# Installation directories.
-PREFIX ?= $(DESTDIR)/usr
-LIBDIR ?= $(PREFIX)/lib
+PREFIX ?= /usr
SBINDIR ?= $(PREFIX)/sbin
-INCLUDEDIR ?= $(PREFIX)/include
OS ?= $(shell uname)
@@ -63,8 +61,8 @@ sefcontext_compile: sefcontext_compile.o ../src/regex.o
all: $(TARGETS)
install: all
- -mkdir -p $(SBINDIR)
- install -m 755 $(TARGETS) $(SBINDIR)
+ -mkdir -p $(DESTDIR)$(SBINDIR)
+ install -m 755 $(TARGETS) $(DESTDIR)$(SBINDIR)
clean:
rm -f $(TARGETS) *.o *~
diff --git libselinux-2.7/utils/matchpathcon.c libselinux-2.7/utils/matchpathcon.c
diff --git libselinux-2.8-rc1/utils/matchpathcon.c libselinux-2.8-rc1/utils/matchpathcon.c
index 67e4a43..9756d7d 100644
--- libselinux-2.7/utils/matchpathcon.c
+++ libselinux-2.7/utils/matchpathcon.c
--- libselinux-2.8-rc1/utils/matchpathcon.c
+++ libselinux-2.8-rc1/utils/matchpathcon.c
@@ -14,7 +14,7 @@
static __attribute__ ((__noreturn__)) void usage(const char *progname)
{

View File

@ -3,22 +3,24 @@
%endif
%define ruby_inc %(pkg-config --cflags ruby)
%define libsepolver 2.7-6
%define libsepolver 2.8-0
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%global rcversion rc1
Summary: SELinux library and simple utilities
Name: libselinux
Version: 2.7
Release: 13%{?dist}
Version: 2.8
Release: 0%{?rcversion:.%rcversion}.1%{?dist}
License: Public Domain
# https://github.com/SELinuxProject/selinux/wiki/Releases
Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20170804/libselinux-2.7.tar.gz
Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20180419/libselinux-2.8-rc1.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.7 ./make-fedora-selinux-patch.sh libselinux
# $ VERSION=2.8-rc1 ./make-fedora-selinux-patch.sh libselinux
# HEAD https://github.com/fedora-selinux/selinux/commit/0a28664012ec7383cf5cbdef4ad2dbedf1f70707
Patch1: libselinux-fedora.patch
BuildRequires: gcc
@ -107,7 +109,7 @@ The libselinux-static package contains the static libraries
needed for developing SELinux applications.
%prep
%autosetup -p 1 -n libselinux-%{version}
%autosetup -p 1 -n libselinux-%{version}%{?rcversion:-%rcversion}
%build
export LDFLAGS="%{?__global_ldflags}"
@ -244,6 +246,9 @@ rm -f %{buildroot}%{_mandir}/man8/togglesebool*
%{ruby_vendorarchdir}/selinux.so
%changelog
* Mon Apr 23 2018 Petr Lautrbach <plautrba@workstation> - 2.8-0.rc1.1
- SELinux userspace 2.8-rc1 release candidate
* Wed Mar 21 2018 Petr Lautrbach <plautrba@workstation> - 2.7-13
- build: Replace PYSITEDIR with PYTHONLIBDIR

View File

@ -1 +1 @@
SHA512 (libselinux-2.7.tar.gz) = 415d10306692d4323455b61fb61d7e56e53b9144276ff206d72760e1df9b04ab07c62a4d6f04bf4e5fa708f9f14b21a9801069b16ece0a0aade886950941ab8d
SHA512 (libselinux-2.8-rc1.tar.gz) = 11f51348d1b743e82b5c01abed4664b3513295436bec109e414df1ed86334422e294109c9563e6552ecab0d16e23c2fb3ea5f420f6ba3f11d35be1d9c8d20477