public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/, sys-libs/libsemanage/files/
@ 2016-02-17 20:11 Mike Frysinger
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2016-02-17 20:11 UTC (permalink / raw
  To: gentoo-commits

commit:     0eb147b01782e40c55276fe284e9804c25a7981e
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 17 19:41:07 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Feb 17 20:11:03 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0eb147b0

sys-libs/libsemanage: fix bad -I/-L flag usage

 .../files/libsemanage-2.4-build-paths.patch        | 35 ++++++++++++++++++++++
 sys-libs/libsemanage/libsemanage-2.4-r2.ebuild     |  1 +
 sys-libs/libsemanage/libsemanage-9999.ebuild       |  1 +
 3 files changed, 37 insertions(+)

diff --git a/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch b/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch
new file mode 100644
index 0000000..7eeb9be
--- /dev/null
+++ b/sys-libs/libsemanage/files/libsemanage-2.4-build-paths.patch
@@ -0,0 +1,35 @@
+there's no point in using -I/-L flags to the system paths and this breaks
+cross-compiling.  just drop them.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -60,7 +60,7 @@
+ SWIG_CFLAGS += -Wno-error -Wno-unused-but-set-variable -Wno-unused-variable -Wno-shadow \
+ 		-Wno-unused-parameter
+ 
+-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
++override CFLAGS += -I../include -D_GNU_SOURCE
+ RANLIB=ranlib
+ 
+ SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
+@@ -82,17 +82,17 @@
+ 	$(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
+ 
+ $(SWIGSO): $(SWIGLOBJ)
+-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -L$(LIBDIR)
++	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage
+ 
+ $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
+-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage -L$(LIBDIR)
++	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage
+ 
+ $(LIBA): $(OBJS)
+ 	$(AR) rcs $@ $^
+ 	$(RANLIB) $@
+ 
+ $(LIBSO): $(LOBJS)
+-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -lustr -L$(LIBDIR) -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
++	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -lustr -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
+ 	ln -sf $@ $(TARGET)
+ 
+ $(LIBPC): $(LIBPC).in ../VERSION

diff --git a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
index b949d14..d43e13b 100644
--- a/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
+++ b/sys-libs/libsemanage/libsemanage-2.4-r2.ebuild
@@ -70,6 +70,7 @@ src_prepare() {
 		"${FILESDIR}/0003-libsemanage-Add-file_contexts-and-seusers-to-the-sto.patch" \
 		"${FILESDIR}/0004-libsemanage-save-homedir_template-in-the-policy-stor.patch" \
 		"${FILESDIR}/0005-libsemanage-store-users_extra-in-the-policy-store.patch"
+	epatch "${FILESDIR}"/${PN}-2.4-build-paths.patch
 
 	epatch_user
 

diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild
index 5132051..734b838 100644
--- a/sys-libs/libsemanage/libsemanage-9999.ebuild
+++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
@@ -76,6 +76,7 @@ src_prepare() {
 		# If wanted for live builds, please use /etc/portage/patches
 		epatch "${FILESDIR}/0001-libsemanage-do-not-copy-contexts-in-semanage_migrate.patch"
 	fi
+	epatch "${FILESDIR}"/${PN}-2.4-build-paths.patch
 
 	epatch_user
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/, sys-libs/libsemanage/files/
@ 2016-08-07 17:07 Jason Zaman
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Zaman @ 2016-08-07 17:07 UTC (permalink / raw
  To: gentoo-commits

commit:     0c73493b4c6e4a222d19b84cc83f4f461fd232f3
Author:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  4 16:52:54 2016 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Sun Aug  7 17:05:18 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c73493b

sys-libs/libsemanage: update to eapi6 and update build patch

Package-Manager: portage-2.2.28

 .../files/libsemanage-2.6-build-paths.patch        | 35 ++++++++++++++++++++++
 sys-libs/libsemanage/libsemanage-9999.ebuild       | 14 ++++-----
 2 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/sys-libs/libsemanage/files/libsemanage-2.6-build-paths.patch b/sys-libs/libsemanage/files/libsemanage-2.6-build-paths.patch
new file mode 100644
index 0000000..86e5c7e
--- /dev/null
+++ b/sys-libs/libsemanage/files/libsemanage-2.6-build-paths.patch
@@ -0,0 +1,35 @@
+there's no point in using -I/-L flags to the system paths and this breaks
+cross-compiling.  just drop them.
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -60,7 +60,7 @@
+ SWIG_CFLAGS += -Wno-error -Wno-unused-but-set-variable -Wno-unused-variable -Wno-shadow \
+ 		-Wno-unused-parameter
+ 
+-override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
++override CFLAGS += -I../include -D_GNU_SOURCE
+ RANLIB ?= ranlib
+ 
+ SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
+@@ -82,17 +82,17 @@
+ 	$(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
+ 
+ $(SWIGSO): $(SWIGLOBJ)
+-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage -L$(LIBDIR)
++	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage
+ 
+ $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
+-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage -L$(LIBDIR)
++	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage
+ 
+ $(LIBA): $(OBJS)
+ 	$(AR) rcs $@ $^
+ 	$(RANLIB) $@
+ 
+ $(LIBSO): $(LOBJS)
+-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -lustr -L$(LIBDIR) -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
++	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -lustr -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
+ 	ln -sf $@ $(TARGET)
+ 
+ $(LIBPC): $(LIBPC).in ../VERSION

diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild
index ce10d31..aa544a3 100644
--- a/sys-libs/libsemanage/libsemanage-9999.ebuild
+++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
@@ -2,10 +2,10 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI="5"
-PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
+EAPI="6"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
 
-inherit multilib python-r1 toolchain-funcs eutils multilib-minimal
+inherit multilib python-r1 toolchain-funcs multilib-minimal
 
 MY_P="${P//_/-}"
 MY_RELEASEDATE="20160223"
@@ -16,7 +16,7 @@ SELNX_VER="${PV}"
 DESCRIPTION="SELinux kernel and policy management library"
 HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
 
-if [[ ${PV} == 9999 ]] ; then
+if [[ ${PV} == 9999 ]]; then
 	inherit git-r3
 	EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
 	S="${WORKDIR}/${MY_P}/${PN}"
@@ -74,11 +74,11 @@ src_prepare() {
 
 	if [[ ${PV} != 9999 ]] ; then
 		# If wanted for live builds, please use /etc/portage/patches
-		epatch "${FILESDIR}/0001-libsemanage-do-not-copy-contexts-in-semanage_migrate.patch"
+		eapply "${FILESDIR}/0001-libsemanage-do-not-copy-contexts-in-semanage_migrate.patch"
 	fi
-	epatch "${FILESDIR}"/${PN}-2.4-build-paths.patch
+	eapply "${FILESDIR}"/${PN}-2.6-build-paths.patch
 
-	epatch_user
+	eapply_user
 
 	multilib_copy_sources
 }


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/, sys-libs/libsemanage/files/
@ 2016-09-01 16:31 Jason Zaman
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Zaman @ 2016-09-01 16:31 UTC (permalink / raw
  To: gentoo-commits

commit:     685aedaac01af5646f14c545bd81c7d4d6069dd8
Author:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
AuthorDate: Thu Sep  1 15:54:03 2016 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Thu Sep  1 16:28:20 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=685aedaa

sys-libs/libsemanage: Remove unneeded patch

Package-Manager: portage-2.2.28

 ...-do-not-copy-contexts-in-semanage_migrate.patch | 208 ---------------------
 sys-libs/libsemanage/libsemanage-9999.ebuild       |   4 -
 2 files changed, 212 deletions(-)

diff --git a/sys-libs/libsemanage/files/0001-libsemanage-do-not-copy-contexts-in-semanage_migrate.patch b/sys-libs/libsemanage/files/0001-libsemanage-do-not-copy-contexts-in-semanage_migrate.patch
deleted file mode 100644
index 8e523dc..00000000
--- a/sys-libs/libsemanage/files/0001-libsemanage-do-not-copy-contexts-in-semanage_migrate.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-From 9caebebd598de737f27cdc8d5253a2cebd67d5a9 Mon Sep 17 00:00:00 2001
-From: Jason Zaman <jason@perfinion.com>
-Date: Wed, 22 Apr 2015 18:27:09 +0400
-Subject: [PATCH] libsemanage: do not copy contexts in semanage_migrate_store
-
-The modules from the old store were previously copied to the new one
-using setfscreatecon and shutil.copy2(). Now that refpolicy has rules
-about the new policy location[1], copying the contexts is redundant.
-
-More importantly, the setcreatefscon caused a constraint violation[2]
-which made the migration fail. In python3, shutil.copy2() copies xattrs
-as well which again causes problems. shutil.copy() is enough for our
-needs here as it will copy the file and permissions in both py2 and 3.
-We do not need the extra things that copy2() does (mtime, xattr, etc).
-
-[1] http://oss.tresys.com/pipermail/refpolicy/2014-December/007511.html
-
-[2]
-type=AVC msg=audit(1429438272.872:1869): avc:  denied  { create } for  pid=28739 comm="semanage_migrat" name="strict" scontext=staff_u:sysadm_r:semanage_t tcontext=system_u:object_r:semanage_store_t tclass=dir permissive=0
-	constrain dir { create relabelfrom relabelto } ((u1 == u2 -Fail-)  or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED
-allow semanage_t semanage_store_t:dir create;
-
-Signed-off-by: Jason Zaman <jason@perfinion.com>
----
- libsemanage/utils/semanage_migrate_store | 77 ++++++++------------------------
- 1 file changed, 18 insertions(+), 59 deletions(-)
-
-diff --git a/libsemanage/utils/semanage_migrate_store b/libsemanage/utils/semanage_migrate_store
-index 03b492e..2f85e9c 100755
---- a/libsemanage/utils/semanage_migrate_store
-+++ b/libsemanage/utils/semanage_migrate_store
-@@ -8,7 +8,6 @@ import shutil
- import sys
- from optparse import OptionParser
- 
--import bz2
- import ctypes
- 
- sepol = ctypes.cdll.LoadLibrary('libsepol.so')
-@@ -21,41 +20,20 @@ except:
- 	exit(1)
- 
- 
--
--
--# For some reason this function doesn't exist in libselinux :\
--def copy_with_context(src, dst):
-+def copy_file(src, dst):
- 	if DEBUG:
- 		print("copying %s to %s" % (src, dst))
- 	try:
--		con = selinux.lgetfilecon_raw(src)[1]
--	except:
--		print("Could not get file context of %s" % src, file=sys.stderr)
--		exit(1)
--
--	try:
--		selinux.setfscreatecon_raw(con)
--	except:
--		print("Could not set fs create context: %s" %con, file=sys.stderr)
--		exit(1)
--
--	try:
--		shutil.copy2(src, dst)
-+		shutil.copy(src, dst)
- 	except OSError as the_err:
- 		(err, strerr) = the_err.args
- 		print("Could not copy %s to %s, %s" %(src, dst, strerr), file=sys.stderr)
- 		exit(1)
- 
--	try:
--		selinux.setfscreatecon_raw(None)
--	except:
--		print("Could not reset fs create context. May need to relabel system.", file=sys.stderr)
- 
--def create_dir_from(src, dst, mode):
-+def create_dir(dst, mode):
- 	if DEBUG: print("Making directory %s" % dst)
- 	try:
--		con = selinux.lgetfilecon_raw(src)[1]
--		selinux.setfscreatecon_raw(con)
- 		os.makedirs(dst, mode)
- 	except OSError as the_err:
- 		(err, stderr) = the_err.args
-@@ -65,28 +43,18 @@ def create_dir_from(src, dst, mode):
- 			print("Error creating %s" % dst, file=sys.stderr)
- 			exit(1)
- 
--	try:
--		selinux.setfscreatecon_raw(None)
--	except:
--		print("Could not reset fs create context. May need to relabel system.", file=sys.stderr)
- 
--def create_file_from(src, dst):
-+def create_file(dst):
- 	if DEBUG: print("Making file %s" % dst)
- 	try:
--		con = selinux.lgetfilecon_raw(src)[1]
--		selinux.setfscreatecon_raw(con)
- 		open(dst, 'a').close()
- 	except OSError as the_err:
- 		(err, stderr) = the_err.args
- 		print("Error creating %s" % dst, file=sys.stderr)
- 		exit(1)
- 
--	try:
--		selinux.setfscreatecon_raw(None)
--	except:
--		print("Could not reset fs create context. May need to relabel system.", file=sys.stderr)
- 
--def copy_module(store, name, con, base):
-+def copy_module(store, name, base):
- 	if DEBUG: print("Install module %s" % name)
- 	(file, ext) = os.path.splitext(name)
- 	if ext != ".pp":
-@@ -94,8 +62,6 @@ def copy_module(store, name, con, base):
- 		print("warning: %s has invalid extension, skipping" % name, file=sys.stderr)
- 		return
- 	try:
--		selinux.setfscreatecon_raw(con)
--
- 		if base:
- 			root = oldstore_path(store)
- 		else:
-@@ -105,7 +71,7 @@ def copy_module(store, name, con, base):
- 
- 		os.mkdir("%s/%s" % (bottomdir, file))
- 
--		copy_with_context(os.path.join(root, name), "%s/%s/hll" % (bottomdir, file))
-+		copy_file(os.path.join(root, name), "%s/%s/hll" % (bottomdir, file))
- 
- 		# This is the ext file that will eventually be used to choose a compiler
- 		efile = open("%s/%s/lang_ext" % (bottomdir, file), "w+", 0o600)
-@@ -116,15 +82,11 @@ def copy_module(store, name, con, base):
- 		print("Error installing module %s" % name, file=sys.stderr)
- 		exit(1)
- 
--	try:
--		selinux.setfscreatecon_raw(None)
--	except:
--		print("Could not reset fs create context. May need to relabel system.", file=sys.stderr)
- 
--def disable_module(file, root, name, disabledmodules):
-+def disable_module(file, name, disabledmodules):
- 	if DEBUG: print("Disabling %s" % name)
- 	(disabledname, disabledext) = os.path.splitext(file)
--	create_file_from(os.path.join(root, name), "%s/%s" % (disabledmodules, disabledname))
-+	create_file("%s/%s" % (disabledmodules, disabledname))
- 
- def migrate_store(store):
- 
-@@ -138,17 +100,14 @@ def migrate_store(store):
- 	print("Migrating from %s to %s" % (oldstore, newstore))
- 
- 	# Build up new directory structure
--	create_dir_from(oldstore, "%s/%s" % (newroot_path(), store), 0o755)
--	create_dir_from(oldstore, newstore, 0o700)
--	create_dir_from(oldstore, newmodules, 0o700)
--	create_dir_from(oldstore, bottomdir, 0o700)
--	create_dir_from(oldstore, disabledmodules, 0o700)
--
--	# use whatever the file context of bottomdir is for the module directories
--	con = selinux.lgetfilecon_raw(bottomdir)[1]
-+	create_dir("%s/%s" % (newroot_path(), store), 0o755)
-+	create_dir(newstore, 0o700)
-+	create_dir(newmodules, 0o700)
-+	create_dir(bottomdir, 0o700)
-+	create_dir(disabledmodules, 0o700)
- 
- 	# Special case for base since it was in a different location
--	copy_module(store, "base.pp", con, 1)
-+	copy_module(store, "base.pp", 1)
- 
- 	# Dir structure built, start copying files
- 	for root, dirs, files in os.walk(oldstore):
-@@ -161,7 +120,7 @@ def migrate_store(store):
- 						newname = "seusers.local"
- 					else:
- 						newname = name
--					copy_with_context(os.path.join(root, name), os.path.join(newstore, newname))
-+					copy_file(os.path.join(root, name), os.path.join(newstore, newname))
- 
- 		elif root == oldmodules:
- 			# This should be the modules directory
-@@ -171,9 +130,9 @@ def migrate_store(store):
- 					print("Error installing module %s, name conflicts with base" % name, file=sys.stderr)
- 					exit(1)
- 				elif ext == ".disabled":
--					disable_module(file, root, name, disabledmodules)
-+					disable_module(file, name, disabledmodules)
- 				else:
--					copy_module(store, name, con, 0)
-+					copy_module(store, name, 0)
- 
- def rebuild_policy():
- 	# Ok, the modules are loaded, lets try to rebuild the policy
-@@ -287,7 +246,7 @@ if __name__ == "__main__":
- 		"preserve_tunables" ]
- 
- 
--	create_dir_from(oldroot_path(), newroot_path(), 0o755)
-+	create_dir(newroot_path(), 0o755)
- 
- 	stores = None
- 	if TYPE is not None:
--- 
-2.0.5
-

diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild
index aa544a3..d444574 100644
--- a/sys-libs/libsemanage/libsemanage-9999.ebuild
+++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
@@ -72,10 +72,6 @@ src_prepare() {
 	echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
 	echo "bzip-small=true" >> "${S}/src/semanage.conf"
 
-	if [[ ${PV} != 9999 ]] ; then
-		# If wanted for live builds, please use /etc/portage/patches
-		eapply "${FILESDIR}/0001-libsemanage-do-not-copy-contexts-in-semanage_migrate.patch"
-	fi
 	eapply "${FILESDIR}"/${PN}-2.6-build-paths.patch
 
 	eapply_user


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/, sys-libs/libsemanage/files/
@ 2016-10-04  5:14 Jason Zaman
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Zaman @ 2016-10-04  5:14 UTC (permalink / raw
  To: gentoo-commits

commit:     eed549ec62dcbf9a5b22003df16c8d5a10551815
Author:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  4 04:53:11 2016 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Tue Oct  4 05:05:54 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eed549ec

sys-libs/libsemanage: Add patch to fix loading base module

Package-Manager: portage-2.3.0

 ...-Fixes-bug-preventing-the-installation-of.patch | 98 ++++++++++++++++++++++
 ....6_rc1.ebuild => libsemanage-2.6_rc1-r1.ebuild} |  1 +
 2 files changed, 99 insertions(+)

diff --git a/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch b/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch
new file mode 100644
index 00000000..8f99b76
--- /dev/null
+++ b/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch
@@ -0,0 +1,98 @@
+From 9d25ca61603a2eed08d1b58b25c81f878c729474 Mon Sep 17 00:00:00 2001
+From: James Carter <jwcart2@tycho.nsa.gov>
+Date: Mon, 3 Oct 2016 14:15:40 -0400
+Subject: [PATCH] libsemanage: Fixes bug preventing the installation of base
+ modules
+
+Commit 7a728e46 changed module installation so that a module pp would
+be installed using its module name instead of its filename and a warning
+would be printed if they were different. With this change, base modules
+could no longer be installed because of the way error handling was done.
+
+This change fixes the error handling, so that when a base module is
+installed it will be installed using its filename (since it does not
+have a module name).
+
+Based on bug report by Jason Zaman
+
+Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
+---
+ libsemanage/src/direct_api.c | 39 ++++++++++++++-------------------------
+ 1 file changed, 14 insertions(+), 25 deletions(-)
+
+diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
+index 3719cb1..e5c72cd 100644
+--- libsemanage/src/direct_api.c
++++ libsemanage/src/direct_api.c
+@@ -368,7 +368,7 @@ static int semanage_direct_begintrans(semanage_handle_t * sh)
+  * 'version' to module's version.  The caller is responsible for
+  * free()ing 'module_name', and 'version'; they will be
+  * set to NULL upon entering this function.  Returns 0 on success, -1
+- * if out of memory, or -2 if data did not represent a module.
++ * if out of memory.
+  */
+ static int parse_module_headers(semanage_handle_t * sh, char *module_data,
+                                size_t data_len, char **module_name,
+@@ -384,23 +384,10 @@ static int parse_module_headers(semanage_handle_t * sh, char *module_data,
+        }
+        sepol_policy_file_set_mem(pf, module_data, data_len);
+        sepol_policy_file_set_handle(pf, sh->sepolh);
+-       if (module_data == NULL ||
+-           data_len == 0 ||
++       if (module_data != NULL && data_len > 0)
+            sepol_module_package_info(pf, &file_type, module_name,
+-                                     version) == -1) {
+-               sepol_policy_file_free(pf);
+-               ERR(sh, "Could not parse module data.");
+-               return -2;
+-       }
++                                     version);
+        sepol_policy_file_free(pf);
+-       if (file_type != SEPOL_POLICY_MOD) {
+-               if (file_type == SEPOL_POLICY_BASE)
+-                       ERR(sh,
+-                           "Received a base module, expected a non-base module.");
+-               else
+-                       ERR(sh, "Data did not represent a module.");
+-               return -2;
+-       }
+ 
+        return 0;
+ }
+@@ -1608,22 +1595,24 @@ static int semanage_direct_install_file(semanage_handle_t * sh,
+ 		lang_ext = separator + 1;
+ 	}
+ 
+-	if (strcmp(lang_ext, "pp") != 0) {
++	if (strcmp(lang_ext, "pp") == 0) {
++		retval = parse_module_headers(sh, data, data_len, &module_name, &version);
++		free(version);
++		if (retval != 0)
++			goto cleanup;
++	}
++
++	if (module_name == NULL) {
+ 		module_name = strdup(filename);
+ 		if (module_name == NULL) {
+ 			ERR(sh, "No memory available for module_name.\n");
+ 			retval = -1;
+ 			goto cleanup;
+ 		}
+-	} else {
+-		if ((retval = parse_module_headers(sh, data, data_len, &module_name, &version)) != 0)
+-			goto cleanup;
+-
+-		if (strcmp(module_name, filename) != 0)
+-			fprintf(stderr, "Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n", install_filename, module_name, filename);
+-
+-		free(version);
++	} else if (strcmp(module_name, filename) != 0) {
++		fprintf(stderr, "Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n", install_filename, module_name, filename);
+ 	}
++
+ 	retval = semanage_direct_install(sh, data, data_len, module_name, lang_ext);
+ 
+ cleanup:
+-- 
+2.7.3
+

diff --git a/sys-libs/libsemanage/libsemanage-2.6_rc1.ebuild b/sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild
similarity index 98%
rename from sys-libs/libsemanage/libsemanage-2.6_rc1.ebuild
rename to sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild
index 76b2430..daaa79f 100644
--- a/sys-libs/libsemanage/libsemanage-2.6_rc1.ebuild
+++ b/sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild
@@ -72,6 +72,7 @@ src_prepare() {
 	echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
 	echo "bzip-small=true" >> "${S}/src/semanage.conf"
 
+	eapply "${FILESDIR}/${PN}-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch"
 	eapply "${FILESDIR}"/${PN}-2.6-build-paths.patch
 
 	eapply_user


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/, sys-libs/libsemanage/files/
@ 2016-10-07  4:24 Jason Zaman
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Zaman @ 2016-10-07  4:24 UTC (permalink / raw
  To: gentoo-commits

commit:     9941ac18e481e05cab12c1afce3579d9ba888ed7
Author:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  7 04:01:16 2016 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Fri Oct  7 04:18:20 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9941ac18

sys-libs/libsemanage: bump to 2.6_rc2

Package-Manager: portage-2.3.0

 sys-libs/libsemanage/Manifest                      |  2 +-
 ...-Fixes-bug-preventing-the-installation-of.patch | 98 ----------------------
 ....6_rc1-r1.ebuild => libsemanage-2.6_rc2.ebuild} |  3 +-
 sys-libs/libsemanage/libsemanage-9999.ebuild       |  2 +-
 4 files changed, 3 insertions(+), 102 deletions(-)

diff --git a/sys-libs/libsemanage/Manifest b/sys-libs/libsemanage/Manifest
index d8db2e0..90e4450 100644
--- a/sys-libs/libsemanage/Manifest
+++ b/sys-libs/libsemanage/Manifest
@@ -1,2 +1,2 @@
 DIST libsemanage-2.5.tar.gz 152884 SHA256 46e2f36254369b6e91d1eea0460c262b139361b055a3a67d3ceea2d8ef72e006 SHA512 cf644b77d8a24f76c630ece582df1b49a0c5f48f1c9f79b1caee0df10372008954406974472a072360dbe6de5ebc19b1b21bb247084d75b7186f61b32f33b8ec WHIRLPOOL 397b7fd2e9b2c00dbc2f58bdc023501dcd7ecf1212fef9ad7993b4763a041068416ef06552c0abf0beef8c69f4704933feca36951866c43d867181332971f6be
-DIST libsemanage-2.6-rc1.tar.gz 155844 SHA256 3c4706c0b72a0ff6f4968eb5d7ecffe9faa1ea831036d6fe13f37927183fa4b5 SHA512 e1930039ad94b166726256a9422f948b600c29f963f420bdaf4afa891743e5144984acefac7226f05f4f3e20708a9b5788e450124633bc25337a591f02ff7ba5 WHIRLPOOL ca0e3707ff089d10d35f84abcdb8c3df983dbd39259acabe72b804216dcd8d762efe8b03fd2d1cca79d29c079a7ae4f624f33f60cbe6a71dcbf5f1d413d85f98
+DIST libsemanage-2.6-rc2.tar.gz 155934 SHA256 672bd1c3c6faeca483d90515a03ac9b65b6596064f49cd4cfbbb53c186d08a47 SHA512 fb794738d7497709441248b1ba3abe35aac7bbfaf7dc875d0c50733f871e5e90b209aefe912584f1e08d3aba596dd569caad749c236440662ba16b1c64727511 WHIRLPOOL afd746fca0b4d2a616996ca7346242f50ab35591df050ede9805a9e8aa958a4c8b474a62fd10aea99971f0bf7507a1d0d9d6e4e7b79b8095eea32feeaba1a2d6

diff --git a/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch b/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch
deleted file mode 100644
index 8f99b76..00000000
--- a/sys-libs/libsemanage/files/libsemanage-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 9d25ca61603a2eed08d1b58b25c81f878c729474 Mon Sep 17 00:00:00 2001
-From: James Carter <jwcart2@tycho.nsa.gov>
-Date: Mon, 3 Oct 2016 14:15:40 -0400
-Subject: [PATCH] libsemanage: Fixes bug preventing the installation of base
- modules
-
-Commit 7a728e46 changed module installation so that a module pp would
-be installed using its module name instead of its filename and a warning
-would be printed if they were different. With this change, base modules
-could no longer be installed because of the way error handling was done.
-
-This change fixes the error handling, so that when a base module is
-installed it will be installed using its filename (since it does not
-have a module name).
-
-Based on bug report by Jason Zaman
-
-Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
----
- libsemanage/src/direct_api.c | 39 ++++++++++++++-------------------------
- 1 file changed, 14 insertions(+), 25 deletions(-)
-
-diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
-index 3719cb1..e5c72cd 100644
---- libsemanage/src/direct_api.c
-+++ libsemanage/src/direct_api.c
-@@ -368,7 +368,7 @@ static int semanage_direct_begintrans(semanage_handle_t * sh)
-  * 'version' to module's version.  The caller is responsible for
-  * free()ing 'module_name', and 'version'; they will be
-  * set to NULL upon entering this function.  Returns 0 on success, -1
-- * if out of memory, or -2 if data did not represent a module.
-+ * if out of memory.
-  */
- static int parse_module_headers(semanage_handle_t * sh, char *module_data,
-                                size_t data_len, char **module_name,
-@@ -384,23 +384,10 @@ static int parse_module_headers(semanage_handle_t * sh, char *module_data,
-        }
-        sepol_policy_file_set_mem(pf, module_data, data_len);
-        sepol_policy_file_set_handle(pf, sh->sepolh);
--       if (module_data == NULL ||
--           data_len == 0 ||
-+       if (module_data != NULL && data_len > 0)
-            sepol_module_package_info(pf, &file_type, module_name,
--                                     version) == -1) {
--               sepol_policy_file_free(pf);
--               ERR(sh, "Could not parse module data.");
--               return -2;
--       }
-+                                     version);
-        sepol_policy_file_free(pf);
--       if (file_type != SEPOL_POLICY_MOD) {
--               if (file_type == SEPOL_POLICY_BASE)
--                       ERR(sh,
--                           "Received a base module, expected a non-base module.");
--               else
--                       ERR(sh, "Data did not represent a module.");
--               return -2;
--       }
- 
-        return 0;
- }
-@@ -1608,22 +1595,24 @@ static int semanage_direct_install_file(semanage_handle_t * sh,
- 		lang_ext = separator + 1;
- 	}
- 
--	if (strcmp(lang_ext, "pp") != 0) {
-+	if (strcmp(lang_ext, "pp") == 0) {
-+		retval = parse_module_headers(sh, data, data_len, &module_name, &version);
-+		free(version);
-+		if (retval != 0)
-+			goto cleanup;
-+	}
-+
-+	if (module_name == NULL) {
- 		module_name = strdup(filename);
- 		if (module_name == NULL) {
- 			ERR(sh, "No memory available for module_name.\n");
- 			retval = -1;
- 			goto cleanup;
- 		}
--	} else {
--		if ((retval = parse_module_headers(sh, data, data_len, &module_name, &version)) != 0)
--			goto cleanup;
--
--		if (strcmp(module_name, filename) != 0)
--			fprintf(stderr, "Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n", install_filename, module_name, filename);
--
--		free(version);
-+	} else if (strcmp(module_name, filename) != 0) {
-+		fprintf(stderr, "Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n", install_filename, module_name, filename);
- 	}
-+
- 	retval = semanage_direct_install(sh, data, data_len, module_name, lang_ext);
- 
- cleanup:
--- 
-2.7.3
-

diff --git a/sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild b/sys-libs/libsemanage/libsemanage-2.6_rc2.ebuild
similarity index 97%
rename from sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild
rename to sys-libs/libsemanage/libsemanage-2.6_rc2.ebuild
index daaa79f..2b625f5 100644
--- a/sys-libs/libsemanage/libsemanage-2.6_rc1-r1.ebuild
+++ b/sys-libs/libsemanage/libsemanage-2.6_rc2.ebuild
@@ -8,7 +8,7 @@ PYTHON_COMPAT=( python{2_7,3_4,3_5} )
 inherit multilib python-r1 toolchain-funcs multilib-minimal
 
 MY_P="${P//_/-}"
-MY_RELEASEDATE="20160930"
+MY_RELEASEDATE="20161006"
 
 SEPOL_VER="${PV}"
 SELNX_VER="${PV}"
@@ -72,7 +72,6 @@ src_prepare() {
 	echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
 	echo "bzip-small=true" >> "${S}/src/semanage.conf"
 
-	eapply "${FILESDIR}/${PN}-2.6-0001-libsemanage-Fixes-bug-preventing-the-installation-of.patch"
 	eapply "${FILESDIR}"/${PN}-2.6-build-paths.patch
 
 	eapply_user

diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild
index 76b2430..2b625f5 100644
--- a/sys-libs/libsemanage/libsemanage-9999.ebuild
+++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
@@ -8,7 +8,7 @@ PYTHON_COMPAT=( python{2_7,3_4,3_5} )
 inherit multilib python-r1 toolchain-funcs multilib-minimal
 
 MY_P="${P//_/-}"
-MY_RELEASEDATE="20160930"
+MY_RELEASEDATE="20161006"
 
 SEPOL_VER="${PV}"
 SELNX_VER="${PV}"


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/, sys-libs/libsemanage/files/
@ 2017-04-26 18:14 Jason Zaman
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Zaman @ 2017-04-26 18:14 UTC (permalink / raw
  To: gentoo-commits

commit:     c25bd87dfe740a26b0d57cf0c1c2098745b1b39e
Author:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 26 04:38:08 2017 +0000
Commit:     Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Wed Apr 26 18:14:09 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c25bd87d

sys-libs/libsemanage: build paths patch is merged upstream

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../files/libsemanage-2.7-build-paths.patch        | 37 ----------------------
 sys-libs/libsemanage/libsemanage-9999.ebuild       |  2 --
 2 files changed, 39 deletions(-)

diff --git a/sys-libs/libsemanage/files/libsemanage-2.7-build-paths.patch b/sys-libs/libsemanage/files/libsemanage-2.7-build-paths.patch
deleted file mode 100644
index 4c2ad0d9462..00000000000
--- a/sys-libs/libsemanage/files/libsemanage-2.7-build-paths.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-there's no point in using -I/-L flags to the system paths and this breaks
-cross-compiling.  just drop them.
-
-diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile
-index ef25902..7aad334 100644
---- libsemanage/src/Makefile
-+++ libsemanage/src/Makefile
-@@ -61,7 +61,7 @@ CFLAGS ?= -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-
- SWIG_CFLAGS += -Wno-error -Wno-unused-but-set-variable -Wno-unused-variable -Wno-shadow \
- 		-Wno-unused-parameter
- 
--override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
-+override CFLAGS += -I../include -D_GNU_SOURCE
- RANLIB ?= ranlib
- 
- SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./
-@@ -81,17 +81,17 @@ $(SWIGRUBYLOBJ): $(SWIGRUBYCOUT)
- 	$(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
- 
- $(SWIGSO): $(SWIGLOBJ)
--	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage $(PYLIBS) -L$(LIBDIR)
-+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lsemanage $(PYLIBS)
- 
- $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
--	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage $(RUBYLIBS) -L$(LIBDIR)
-+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lsemanage $(RUBYLIBS)
- 
- $(LIBA): $(OBJS)
- 	$(AR) rcs $@ $^
- 	$(RANLIB) $@
- 
- $(LIBSO): $(LOBJS)
--	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -L$(LIBDIR) -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
-+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs
- 	ln -sf $@ $(TARGET)
- 
- $(LIBPC): $(LIBPC).in ../VERSION

diff --git a/sys-libs/libsemanage/libsemanage-9999.ebuild b/sys-libs/libsemanage/libsemanage-9999.ebuild
index 786c3994ea4..085031fc41e 100644
--- a/sys-libs/libsemanage/libsemanage-9999.ebuild
+++ b/sys-libs/libsemanage/libsemanage-9999.ebuild
@@ -71,8 +71,6 @@ src_prepare() {
 	echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf"
 	echo "bzip-small=true" >> "${S}/src/semanage.conf"
 
-	eapply "${FILESDIR}"/${PN}-2.7-build-paths.patch
-
 	eapply_user
 
 	multilib_copy_sources


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-26 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-07 17:07 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsemanage/, sys-libs/libsemanage/files/ Jason Zaman
  -- strict thread matches above, loose matches on Subject: below --
2017-04-26 18:14 Jason Zaman
2016-10-07  4:24 Jason Zaman
2016-10-04  5:14 Jason Zaman
2016-09-01 16:31 Jason Zaman
2016-02-17 20:11 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox