Compare commits

..

No commits in common. 'c9' and 'i10cs' have entirely different histories.
c9 ... i10cs

2
.gitignore vendored

@ -1 +1 @@
SOURCES/libcap-ng-0.8.2.tar.gz
SOURCES/libcap-ng-0.8.4.tar.gz

@ -1 +1 @@
8273804b128e7753ed94e782d36fc9178f0d454b SOURCES/libcap-ng-0.8.2.tar.gz
4ddca1a0221919551548a1de0ff534cb1319fb75 SOURCES/libcap-ng-0.8.4.tar.gz

@ -1,66 +0,0 @@
diff -urp libcap-ng-0.8.3.orig/src/cap-ng.c libcap-ng-0.8.3/src/cap-ng.c
--- libcap-ng-0.8.3.orig/src/cap-ng.c 2021-01-30 09:26:33.000000000 -0500
+++ libcap-ng-0.8.3/src/cap-ng.c 2021-01-30 09:52:43.507967643 -0500
@@ -713,6 +713,36 @@ int capng_updatev(capng_act_t action, ca
return rc;
}
+#include <sys/param.h>
+static char *get_exename(char *exename, int size)
+{
+ char tmp[PATH_MAX+1];
+ int res;
+
+ /* get the name of the current executable */
+ if ((res = readlink("/proc/self/exe", tmp, PATH_MAX)) < 0)
+ strcpy(exename, "\"?\"");
+ else {
+ tmp[res] = '\0';
+ snprintf(exename, size, "\"%s\"", tmp);
+ }
+ return exename;
+}
+
+#include <syslog.h>
+static void log_problem(unsigned int msg)
+{
+ static const char *text[3] = {
+ "dropping bounding set",
+ "getting new bounding set",
+ "dropping bounding set due to not having CAP_SETPCAP"
+ };
+ unsigned idx = msg - 2;
+ char exe[2048];
+ syslog(LOG_ERR, "libcap-ng used by %s failed %s in capng_apply",
+ get_exename(exe, 2047), text[idx]);
+}
+
int capng_apply(capng_select_t set)
{
int rc = 0;
@@ -733,19 +763,22 @@ int capng_apply(capng_select_t set)
if (capng_have_capability(CAPNG_BOUNDING_SET,
i) == 0) {
if (prctl(PR_CAPBSET_DROP, i, 0, 0, 0) <0) {
- rc = -2;
+// rc = -2;
+ log_problem(2);
goto try_caps;
}
}
}
m.state = CAPNG_APPLIED;
if (get_bounding_set() < 0) {
- rc = -3;
+// rc = -3;
+ log_problem(3);
goto try_caps;
}
} else {
memcpy(&m, &state, sizeof(m)); /* restore state */
- rc = -4;
+// rc = -4;
+ log_problem(4);
goto try_caps;
}
#endif

@ -0,0 +1,24 @@
commit 30453b6553948cd05c438f9f509013e3bb84f25b
Author: Steve Grubb <ausearch.1@gmail.com>
Date: Thu Jan 4 15:06:29 2024 -0500
Remove python global exception handler since its deprecated
diff --git a/bindings/src/capng_swig.i b/bindings/src/capng_swig.i
index fcdaf18..fa85e13 100644
--- a/bindings/src/capng_swig.i
+++ b/bindings/src/capng_swig.i
@@ -30,13 +30,6 @@
%varargs(16, signed capability = 0) capng_updatev;
-%except(python) {
- $action
- if (result < 0) {
- PyErr_SetFromErrno(PyExc_OSError);
- return NULL;
- }
-}
#endif
%define __signed__

@ -1,12 +1,11 @@
Summary: Alternate posix capabilities library
Name: libcap-ng
Version: 0.8.2
Release: 7%{?dist}
License: LGPLv2+
Version: 0.8.4
Release: 6%{?dist}
License: LGPL-2.0-or-later
URL: https://people.redhat.com/sgrubb/libcap-ng/
Source0: https://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz
# This patch can be removed when 1899540 is resolved
Patch1: libcap-ng-0.8.2-apply-disable.patch
Patch1: libcap-ng-0.8.5-python-exception.patch
BuildRequires: gcc
BuildRequires: make
BuildRequires: kernel-headers >= 2.6.11
@ -17,7 +16,7 @@ Libcap-ng is a library that makes using posix capabilities easier
%package devel
Summary: Header files for libcap-ng library
License: LGPLv2+
License: LGPL-2.0-or-later
Requires: kernel-headers >= 2.6.11
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
@ -28,8 +27,8 @@ applications that need to use the libcap-ng library.
%package python3
Summary: Python3 bindings for libcap-ng library
License: LGPLv2+
BuildRequires: python3-devel swig
License: LGPL-2.0-or-later
BuildRequires: python3-devel python-setuptools swig
BuildRequires: make
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -39,7 +38,7 @@ and can be used by python3 applications.
%package utils
Summary: Utilities for analyzing and setting file capabilities
License: GPLv2+
License: LGPL-2.0-or-later
Requires: %{name}%{?_isa} = %{version}-%{release}
%description utils
@ -49,7 +48,7 @@ lets you set the file system based capabilities.
%prep
%setup -q
%patch1 -p1
%patch -P1 -p1
%build
%configure --libdir=%{_libdir} --with-python=no --with-python3
@ -63,8 +62,8 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libcap-ng.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libcap-ng.a
rm -f $RPM_BUILD_ROOT%{_libdir}/libdrop_ambient.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libdrop_ambient.a
rm -f $RPM_BUILD_ROOT%{_libdir}/python?.?/site-packages/_capng.a
rm -f $RPM_BUILD_ROOT%{_libdir}/python?.?/site-packages/_capng.la
rm -f $RPM_BUILD_ROOT%{_libdir}/python%{python3_version}/site-packages/_capng.a
rm -f $RPM_BUILD_ROOT%{_libdir}/python%{python3_version}/site-packages/_capng.la
%check
make check
@ -95,16 +94,69 @@ make check
%attr(0644,root,root) %{_mandir}/man8/*
%changelog
* Tue Feb 15 2022 <ansasaki@redhat.com> - 0.8.2-7
- Update apply-disable patch (#2045857)
Resolves: rhbz#2045857
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 0.8.4-6
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.8.2-6
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 0.8.4-5
- Rebuilt for MSVSphere 10
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.8.2-5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.8.4-5
- Bump release for June 2024 mass rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jan 04 2024 Steve Grubb <sgrubb@redhat.com> 0.8.4-2
- Remove python bindings global exception handler
* Wed Dec 20 2023 Steve Grubb <sgrubb@redhat.com> 0.8.4-1
- New upstream bugfix release
- Drop libcap-ng-0.8.3-apply-disable.patch since things should be fixed
* Mon Sep 04 2023 Steve Grubb <sgrubb@redhat.com> 0.8.3-8
- Add function annotations to warn on unused results
- SPDX Migration
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> 0.8.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.8.3-6
- Rebuilt for Python 3.12
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Dec 20 2022 Steve Grubb <sgrubb@redhat.com> 0.8.3-4
- BuildRequires python-setuptools
- SPDX Migration
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.8.3-2
- Rebuilt for Python 3.11
* Tue Mar 29 2022 Steve Grubb <sgrubb@redhat.com> 0.8.3-1
- New upstream bugfix release
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Dec 22 2021 Steve Grubb <sgrubb@redhat.com> 0.8.2-8
- Update apply-disable patch
* Wed Sep 22 2021 Steve Grubb <sgrubb@redhat.com> 0.8.2-7
- Drop .la and .a libraries
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.8.2-5
- Rebuilt for Python 3.10
* Tue Feb 02 2021 Steve Grubb <sgrubb@redhat.com> 0.8.2-4
- Adjust syslog warning for bad use of capng_apply

Loading…
Cancel
Save