Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
683cbfc4ac
!37 Remove duplicate listed file site-packages/capng.py
From: @xugmin 
Reviewed-by: @HuaxinLuGitee 
Signed-off-by: @HuaxinLuGitee
2025-01-16 06:19:15 +00:00
xuguangmin
0ba7d73db3 Remove duplicate listed file site-packages/capng.py 2024-11-04 14:11:37 +08:00
openeuler-ci-bot
f1a6b0b3a7
!23 [sync] PR-22: 【Mainline】Backport upstream patch to fix syntax error
From: @openeuler-sync-bot 
Reviewed-by: @HuaxinLuGitee 
Signed-off-by: @HuaxinLuGitee
2024-04-09 08:13:06 +00:00
yixiangzhike
cd5be61aa0 Backport upstream patch to fix syntax error
(cherry picked from commit f5acabf59a2a35d5fdaa40e98502f57df40cd4d4)
2024-04-09 15:41:54 +08:00
openeuler-ci-bot
e709ae6beb
!21 [sync] PR-20: 【openEuler-22.03-LTS-Next】update to 0.8.3
From: @openeuler-sync-bot 
Reviewed-by: @HuaxinLuGitee 
Signed-off-by: @HuaxinLuGitee
2022-10-31 01:51:58 +00:00
yixiangzhike
d9173074de update to 0.8.3
Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
(cherry picked from commit a3a9b6a1e9c6ebe178fa7c9678115a36f1da5c49)
2022-10-31 09:09:57 +08:00
openeuler-ci-bot
aae64d0324
!19 【Mainline】make Python test script compatible with Python2 and Python3
From: @yixiangzhike 
Reviewed-by: @HuaxinLuGitee 
Signed-off-by: @HuaxinLuGitee
2022-10-20 01:52:47 +00:00
yixiangzhike
83a38b8e22 make Python test script compatible with Python2 and Python3
Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
2022-10-19 18:03:00 +08:00
openeuler-ci-bot
0cdb3b0f93 !16 【Mainline】Update to 0.8.2
Merge pull request !16 from yixiangzhike/master
2021-12-30 02:50:32 +00:00
yixiangzhike
fb3bb2d316 Update to 0.8.2 2021-12-24 16:48:40 +08:00
5 changed files with 113 additions and 5 deletions

View File

@ -0,0 +1,35 @@
From 10ef4b05da8a46117b7ba65e01bf5367cc73777c Mon Sep 17 00:00:00 2001
From: yixiangzhike <yixiangzhike007@163.com>
Date: Wed, 20 Mar 2024 20:47:59 +0800
Subject: [PATCH] Fix the syntax error in cap-ng.c (#50)
Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
---
src/cap-ng.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cap-ng.c b/src/cap-ng.c
index d178e35..ed7d718 100644
--- a/src/cap-ng.c
+++ b/src/cap-ng.c
@@ -445,7 +445,7 @@ static int get_bounding_set(void)
#ifdef HAVE_SYSCALL_H
(int)syscall(__NR_gettid));
#else
- (int)getpid();
+ (int)getpid());
#endif
f = fopen(buf, "re");
if (f) {
@@ -490,7 +490,7 @@ static int get_ambient_set(void)
#ifdef HAVE_SYSCALL_H
(int)syscall(__NR_gettid));
#else
- (int)getpid();
+ (int)getpid());
#endif
f = fopen(buf, "re");
if (f) {
--
2.33.0

View File

@ -0,0 +1,37 @@
From 6a6f22d6e99c973bf2f9f400d52370107ae9396b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=A5vard?= <havard.f.aasen@pfft.no>
Date: Thu, 26 May 2022 21:26:55 +0000
Subject: [PATCH] Make Python test script compatible with Python 2 and Python
3. (#35)
The shebang line is still restricting it to Python 2.
Removed end-of-line whitespace as well.
---
bindings/python/test/capng-test.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bindings/python/test/capng-test.py b/bindings/python/test/capng-test.py
index 6688e77..e6350ec 100755
--- a/bindings/python/test/capng-test.py
+++ b/bindings/python/test/capng-test.py
@@ -14,7 +14,7 @@ try:
with open('/proc/sys/kernel/cap_last_cap', 'r') as f:
last = int(f.readline())
except IOError as e:
- print "Error opening /proc/sys/kernel/cap_last_cap: {0}".format(e.strerror)
+ print("Error opening /proc/sys/kernel/cap_last_cap: {0}".format(e.strerror))
print("Doing basic bit tests...")
capng.capng_clear(capng.CAPNG_SELECT_BOTH)
@@ -49,7 +49,7 @@ for i in range(last+1):
if capng.capng_have_capabilities(capng.CAPNG_SELECT_CAPS) != capng.CAPNG_PARTIAL:
print("Failed have capabilities test 1")
sys.exit(1)
-
+
capng.capng_fill(capng.CAPNG_SELECT_BOTH)
rc = capng.capng_update(capng.CAPNG_DROP, capng.CAPNG_EFFECTIVE, i)
if rc:
--
2.27.0

Binary file not shown.

BIN
libcap-ng-0.8.3.tar.gz Normal file

Binary file not shown.

View File

@ -2,11 +2,15 @@
Summary: Libcap-ng is a library used for posix capabilities programming
Name: libcap-ng
Version: 0.8.1
Release: 1
Version: 0.8.3
Release: 3
License: LGPLv2+ and GPLv2+
URL: http://people.redhat.com/sgrubb/libcap-ng
Source0: https://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz
Patch1: backport-Make-Python-test-script-compatible-with-Python2-and-Python3.patch
Patch2: backport-Fix-the-syntax-error-in-cap-ng-c-50.patch
BuildRequires: gcc, kernel-headers >= 2.6.11, libattr-devel
Provides: %{name}-utils = %{version}-%{release}
Obsoletes: %{name}-utils < %{version}-%{release}
@ -53,12 +57,15 @@ make CFLAGS="%{optflags}" %{?_smp_mflags}
# Move from %{_lib} to %{_libdir}
rm -f $RPM_BUILD_ROOT/%{_lib}/%{name}.so
rm -f $RPM_BUILD_ROOT/%{_lib}/libdrop_ambient.so
mkdir -p $RPM_BUILD_ROOT%{_libdir}
VLIBNAME=$(ls $RPM_BUILD_ROOT/%{_lib}/%{name}.so.*.*.*)
LIBNAME=$(basename $VLIBNAME)
ln -s ../../%{_lib}/$LIBNAME $RPM_BUILD_ROOT%{_libdir}/%{name}.so
ln -s ../../%{_lib}/libdrop_ambient.so.0.0.0 $RPM_BUILD_ROOT%{_libdir}/libdrop_ambient.so
mv $RPM_BUILD_ROOT/%{_lib}/pkgconfig $RPM_BUILD_ROOT%{_libdir}
mv $RPM_BUILD_ROOT/%{_lib}/libcap-ng.a $RPM_BUILD_ROOT%{_libdir}
mv $RPM_BUILD_ROOT/%{_lib}/libdrop_ambient.a $RPM_BUILD_ROOT%{_libdir}
%delete_la
@ -78,14 +85,13 @@ make check
%attr(0644,root,root) %{_includedir}/cap-ng.h
%{_libdir}/libcap-ng.so
%{_libdir}/libcap-ng.a
/%{_lib}/libdrop_ambient.so
/%{_lib}/libdrop_ambient.a
%{_libdir}/libdrop_ambient.so
%{_libdir}/libdrop_ambient.a
%attr(0644,root,root) %{_datadir}/aclocal/cap-ng.m4
%{_libdir}/pkgconfig/libcap-ng.pc
%files python3
%attr(755,root,root) %{python3_sitearch}/*
%{python3_sitearch}/capng.py*
%files help
%attr(0644,root,root) %{_mandir}/man3/*
@ -93,6 +99,36 @@ make check
%attr(0644,root,root) %{_mandir}/man8/*
%changelog
* Mon Nov 04 2024 xuguangmin <xuguangmin@kylinos.cn> - 0.8.3-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: Remove duplicate listed file site-packages/capng.py
* Mon Apr 8 2024 yixiangzhike <yixiangzhike007@163.com> - 0.8.3-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:backport upstream patch to fix syntax error
* Sat Oct 29 2022 yixiangzhike <yixiangzhike007@163.com> - 0.8.3-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update to 0.8.3
* Wed Oct 19 2022 yixiangzhike <yixiangzhike007@163.com> - 0.8.2-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:make Python test script compatible with Python2 and Python3
* Fri Dec 24 2021 yixiangzhike <yixiangzhike007@163.com> - 0.8.2-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update to 0.8.2
* Fri Sep 24 2021 fuanan <fuanan3@huawei.com> - 0.8.1-1
- update version to 0.8.1