From f01cb9a3eaa406f22e8441966bba8e32bbea4452 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 23 Jun 2014 13:37:33 -0400 Subject: [PATCH] fix python testsuite failing on rawhide due to CAP_LAST_CAP Clamp CAP_LAST_CAP at /proc/sys/kernel/cap_last_cap's value in the Python bindings test if possible, otherwise use the value from since the kernel now has 37 capabilities upstream, but our builders are not that up to date. --- libcap-ng-check-proc-python.patch | 14 ++++++++++++++ libcap-ng.spec | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100644 libcap-ng-check-proc-python.patch diff --git a/libcap-ng-check-proc-python.patch b/libcap-ng-check-proc-python.patch new file mode 100644 index 0000000..b5adb7c --- /dev/null +++ b/libcap-ng-check-proc-python.patch @@ -0,0 +1,14 @@ +diff -Nur libcap-ng-0.7.4/bindings/python/test/capng-test.py libcap-ng-0.7.4-2/bindings/python/test/capng-test.py +--- libcap-ng-0.7.4/bindings/python/test/capng-test.py 2014-04-24 08:41:44.000000000 -0400 ++++ libcap-ng-0.7.4-2/bindings/python/test/capng-test.py 2014-06-23 13:25:20.113624203 -0400 +@@ -8,7 +8,10 @@ + sys.path.insert(0, load_path) + + import capng ++ + last = capng.CAP_LAST_CAP ++with open('/proc/sys/kernel/cap_last_cap', 'r') as f: ++ last = int(f.readline()) + + print("Doing basic bit tests...") + capng.capng_clear(capng.CAPNG_SELECT_BOTH) diff --git a/libcap-ng.spec b/libcap-ng.spec index 7849a69..9b9a4c6 100644 --- a/libcap-ng.spec +++ b/libcap-ng.spec @@ -8,6 +8,7 @@ License: LGPLv2+ Group: System Environment/Libraries URL: http://people.redhat.com/sgrubb/libcap-ng Source0: http://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz +Patch0: libcap-ng-check-proc-python.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: kernel-headers >= 2.6.11 @@ -50,6 +51,7 @@ lets you set the file system based capabilities. %prep %setup -q +%patch0 -p1 -b .proc~ %build %configure --libdir=/%{_lib} @@ -111,6 +113,12 @@ rm -rf $RPM_BUILD_ROOT %attr(0644,root,root) %{_mandir}/man8/* %changelog +* Mon Jun 23 2014 Kyle McMartin +- Clamp CAP_LAST_CAP at /proc/sys/kernel/cap_last_cap's value in the + Python bindings test if possible, otherwise use the value from + since the kernel now has 37 capabilities upstream, + but our builders are not that up to date. + * Sat Jun 07 2014 Fedora Release Engineering - 0.7.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild