From 9108995ff4c7b8a0958bcc193889220f4b7ad758 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Jan 08 2016 21:50:31 +0000 Subject: libsemanage-2.5-0.99.rc1.1.fc24 Update to upstream rc1 release 2016-01-07 --- diff --git a/.gitignore b/.gitignore index b61d447..85f6349 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,4 @@ libsemanage-2.0.45.tgz /libsemanage-2.2.tgz /libsemanage-2.3.tgz /libsemanage-2.4.tar.gz +/libsemanage-2.5-rc1.tar.gz diff --git a/libsemanage-rhat.patch b/libsemanage-rhat.patch index bb15816..e69de29 100644 --- a/libsemanage-rhat.patch +++ b/libsemanage-rhat.patch @@ -1,147 +0,0 @@ -diff --git libsemanage-2.4/src/direct_api.c libsemanage-2.4/src/direct_api.c -index b0ed338..875c513 100644 ---- libsemanage-2.4/src/direct_api.c -+++ libsemanage-2.4/src/direct_api.c -@@ -1137,6 +1137,9 @@ static int semanage_direct_commit(semanage_handle_t * sh) - if (retval < 0) - goto cleanup; - -+ /* remove FC_TMPL now that it is now longer needed */ -+ unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_FC_TMPL)); -+ - pfcontexts->dtable->drop_cache(pfcontexts->dbase); - - /* SEUsers */ -@@ -1241,11 +1244,6 @@ static int semanage_direct_commit(semanage_handle_t * sh) - sepol_policydb_free(out); - out = NULL; - -- /* remove files that are automatically generated and no longer needed */ -- unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_FC_TMPL)); -- unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_HOMEDIR_TMPL)); -- unlink(semanage_path(SEMANAGE_TMP, SEMANAGE_USERS_EXTRA)); -- - if (sh->do_rebuild || modified || bools_modified || fcontexts_modified) { - retval = semanage_install_sandbox(sh); - } -@@ -1355,7 +1353,7 @@ static int semanage_direct_install_file(semanage_handle_t * sh, - int in_fd = -1; - char *path = NULL; - char *filename; -- char *lang_ext; -+ char *lang_ext = NULL; - char *separator; - - if ((in_fd = open(install_filename, O_RDONLY)) == -1) { -@@ -1387,17 +1385,20 @@ static int semanage_direct_install_file(semanage_handle_t * sh, - goto cleanup; - } - *separator = '\0'; -+ lang_ext = separator + 1; - } - - separator = strrchr(filename, '.'); - if (separator == NULL) { -- ERR(sh, "Module does not have a valid extension."); -- retval = -1; -- goto cleanup; -+ if (lang_ext == NULL) { -+ ERR(sh, "Module does not have a valid extension."); -+ retval = -1; -+ goto cleanup; -+ } -+ } else { -+ *separator = '\0'; -+ lang_ext = separator + 1; - } -- *separator = '\0'; -- -- lang_ext = separator + 1; - - retval = semanage_direct_install(sh, data, data_len, filename, lang_ext); - -diff --git libsemanage-2.4/tests/test_utilities.c libsemanage-2.4/tests/test_utilities.c -index 4d25b07..32cc33c 100644 ---- libsemanage-2.4/tests/test_utilities.c -+++ libsemanage-2.4/tests/test_utilities.c -@@ -45,7 +45,7 @@ void test_slurp_file_filter(void); - - char fname[] = { - 'T', 'E', 'S', 'T', '_', 'T', 'E', 'M', 'P', '_', 'X', 'X', 'X', 'X', -- 'X', 'X' -+ 'X', 'X', '\0' - }; - int fd; - FILE *fptr; -diff --git libsemanage-2.4/utils/semanage_migrate_store libsemanage-2.4/utils/semanage_migrate_store -index 03b492e..22842fc 100755 ---- libsemanage-2.4/utils/semanage_migrate_store -+++ libsemanage-2.4/utils/semanage_migrate_store -@@ -1,4 +1,4 @@ --#!/usr/bin/python -E -+#!/usr/bin/python3 -E - - - from __future__ import print_function -@@ -17,7 +17,7 @@ try: - import selinux - import semanage - except: -- print("You must install libselinux-python and libsemanage-python before running this tool", file=sys.stderr) -+ print("You must install libselinux-python3 and libsemanage-python3 before running this tool", file=sys.stderr) - exit(1) - - -@@ -221,7 +221,7 @@ def rebuild_policy(): - - - def oldroot_path(): -- return "/etc/selinux" -+ return "%s/etc/selinux" % ROOT - - def oldstore_path(store): - return "%s/%s/modules/active" % (oldroot_path(), store) -@@ -233,7 +233,7 @@ def disabledmodules_path(store): - return "%s/disabled" % newmodules_path(store) - - def newroot_path(): -- return PATH -+ return "%s%s" % (ROOT, PATH) - - def newstore_path(store): - return "%s/%s/active" % (newroot_path(), store) -@@ -260,6 +260,8 @@ if __name__ == "__main__": - help="Disable rebuilding policy after migration (default: no)") - parser.add_option("-P", "--path", dest="path", - help="Set path for the policy store (default: /var/lib/selinux)") -+ parser.add_option("-r", "--root", dest="root", -+ help="Set an alternative root for the migration (default: /)") - - (options, args) = parser.parse_args() - -@@ -272,6 +274,10 @@ if __name__ == "__main__": - if PATH is None: - PATH = "/var/lib/selinux" - -+ ROOT = options.root -+ if ROOT is None: -+ ROOT = "" -+ - # List of paths that go in the active 'root' - TOPPATHS = [ - "commit_num", -@@ -282,9 +288,13 @@ if __name__ == "__main__": - "file_contexts.local", - "seusers", - "users.local", -+ "users_extra", - "users_extra.local", - "disable_dontaudit", -- "preserve_tunables" ] -+ "preserve_tunables", -+ "policy.kern", -+ "file_contexts", -+ "homedir_template"] - - - create_dir_from(oldroot_path(), newroot_path(), 0o755) diff --git a/libsemanage.spec b/libsemanage.spec index 6c8ee05..43db50a 100644 --- a/libsemanage.spec +++ b/libsemanage.spec @@ -1,19 +1,16 @@ %global with_python3 1 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")} -%define libsepolver 2.4-1 -%define libselinuxver 2.4-1 +%define libsepolver 2.5-0 +%define libselinuxver 2.5-0 Summary: SELinux binary policy manipulation library Name: libsemanage -Version: 2.4 -Release: 4%{?dist} +Version: 2.5 +Release: 0.99.rc1.1%{?dist} License: LGPLv2+ Group: System Environment/Libraries -Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20150202/libsemanage-%{version}.tar.gz -# use make-rhat-patches.sh to create following patch from https://github.com/bachradsusi/selinux.git -# HEAD https://github.com/fedora-selinux/selinux/commit/ab9d1d2458908164ae5dc74aaa084af19ded8a51 -Patch: libsemanage-rhat.patch +Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160107/libsemanage-2.5-rc1.tar.gz URL: https://github.com/SELinuxProject/selinux/wiki Source1: semanage.conf @@ -84,8 +81,10 @@ SELinux management applications. %endif # if with_python3 %prep -%setup -q -%patch -p1 -b .rhat +%setup -q -n libsemanage-2.5-rc1 + +grep -l -r -E '^#! */usr/bin/python' | xargs -n 1 sed -i 's/\(^#! *\/usr\/bin\/python\)/\13/g' + %build export LDFLAGS="%{?__global_ldflags}" @@ -191,6 +190,9 @@ rm -rf ${RPM_BUILD_ROOT} %endif # if with_python3 %changelog +* Fri Jan 08 2016 Petr Lautrbach 2.5-0.99.rc1.1 +- Update to upstream rc1 release 2016-01-07 + * Fri Sep 04 2015 Petr Lautrbach 2.4-4 - Save homedir_template in the policy store for genhomedircon https://bugs.gentoo.org/558686 diff --git a/make-rhat-patches.sh b/make-rhat-patches.sh index ff689db..2fa12ee 100755 --- a/make-rhat-patches.sh +++ b/make-rhat-patches.sh @@ -1,12 +1,13 @@ #!/bin/bash -LIBSEMANAGE_VERSION=2.4 -BRANCH=master +LIBSEMANAGE_VERSION=2.5-rc1 +REPO=https://github.com/fedora-selinux/selinux/commit +BRANCH=master-rc REBASEDIR=`mktemp -d rebase.XXXXXX` pushd $REBASEDIR -git clone git@github.com:fedora-selinux/selinux.git +git clone $REPO pushd selinux; git checkout $BRANCH; COMMIT=`git rev-parse --verify HEAD`; popd # prepare libsemanage-rhat.patch @@ -24,4 +25,4 @@ popd popd # echo rm -rf $REBASEDIR -echo libsemanage-rhat.patch created from https://github.com/fedora-selinux/selinux/commit/$COMMIT +echo libsemanage-rhat.patch created from $REPO/$COMMIT diff --git a/sources b/sources index a3c7dc9..4df840a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -cd551eb1cc5d20652660bda037972f0d libsemanage-2.4.tar.gz +f8caf1b05981888147ab4c9fbaef7af4 libsemanage-2.5-rc1.tar.gz