parent
41d1610cff
commit
94f2ec094b
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
/libcgroup-0.41.tar.bz2
|
||||
/libcgroup-v0.42.1.tar.gz
|
||||
/libcgroup-v0.42.2.tar.gz
|
||||
/libcgroup-v2.0.tar.gz
|
||||
/3c0c7b164b4221d78459fccdd49643a5dcb3f73d.tar.gz
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git a/src/api.c b/src/api.c
|
||||
index 24ae48d..54a6736 100644
|
||||
index 4a980a1..df9afe8 100644
|
||||
--- a/src/api.c
|
||||
+++ b/src/api.c
|
||||
@@ -159,6 +159,10 @@ static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group)
|
||||
@@ -170,6 +170,10 @@ static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t owner, gid_t group)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ index 24ae48d..54a6736 100644
|
||||
/*
|
||||
* TODO: Need to decide a better place to put this function.
|
||||
*/
|
||||
@@ -166,6 +170,8 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
|
||||
@@ -177,6 +181,8 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
|
||||
{
|
||||
int ret = 0;
|
||||
FTS *fts;
|
||||
@ -22,7 +22,7 @@ index 24ae48d..54a6736 100644
|
||||
|
||||
cgroup_dbg("chown: path is %s\n", *path);
|
||||
fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR |
|
||||
@@ -183,6 +189,7 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
|
||||
@@ -194,6 +200,7 @@ static int cg_chown_recursive(char **path, uid_t owner, gid_t group)
|
||||
cgroup_warn("Warning: fts_read failed\n");
|
||||
break;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git a/src/config.c b/src/config.c
|
||||
index 3ffa263..b5d51b3 100644
|
||||
index 1306033..88cc5dd 100644
|
||||
--- a/src/config.c
|
||||
+++ b/src/config.c
|
||||
@@ -326,7 +326,7 @@ int config_group_task_perm(char *perm_type, char *value, int flag)
|
||||
@ -59,21 +59,3 @@ index 4cef53e..90920d1 100644
|
||||
struct sockaddr_nl my_nla;
|
||||
char buff[BUFF_SIZE];
|
||||
int rc = -1;
|
||||
diff --git a/src/tools/lscgroup.c b/src/tools/lscgroup.c
|
||||
index bfb1724..d15a0c2 100644
|
||||
--- a/src/tools/lscgroup.c
|
||||
+++ b/src/tools/lscgroup.c
|
||||
@@ -96,11 +96,11 @@ static int display_controller_data(char *input_path, char *controller, char *nam
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
- strncpy(cgroup_dir_path, info.full_path, FILENAME_MAX);
|
||||
+ strncpy(cgroup_dir_path, info.full_path, FILENAME_MAX - 1);
|
||||
/* remove problematic '/' characters from cgroup directory path*/
|
||||
trim_filepath(cgroup_dir_path);
|
||||
|
||||
- strncpy(input_dir_path, input_path, FILENAME_MAX);
|
||||
+ strncpy(input_dir_path, input_path, FILENAME_MAX - 1);
|
||||
|
||||
/* remove problematic '/' characters from input directory path*/
|
||||
trim_filepath(input_dir_path);
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git a/src/api.c b/src/api.c
|
||||
index 54a6736..1557393 100644
|
||||
index df9afe8..537cf10 100644
|
||||
--- a/src/api.c
|
||||
+++ b/src/api.c
|
||||
@@ -2482,29 +2482,29 @@ static int cg_rd_ctrl_file(const char *subsys, const char *cgroup,
|
||||
@@ -2981,29 +2981,29 @@ static int cg_rd_ctrl_file(const char *subsys, const char *cgroup,
|
||||
const char *file, char **value)
|
||||
{
|
||||
char path[FILENAME_MAX];
|
||||
@ -39,7 +39,7 @@ index 54a6736..1557393 100644
|
||||
if (ret < 0) {
|
||||
free(*value);
|
||||
*value = NULL;
|
||||
@@ -2514,7 +2514,7 @@ static int cg_rd_ctrl_file(const char *subsys, const char *cgroup,
|
||||
@@ -3013,7 +3013,7 @@ static int cg_rd_ctrl_file(const char *subsys, const char *cgroup,
|
||||
(*value)[ret-1] = '\0';
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
diff --git a/src/api.c b/src/api.c
|
||||
index 1557393..318a438 100644
|
||||
index 537cf10..483eabc 100644
|
||||
--- a/src/api.c
|
||||
+++ b/src/api.c
|
||||
@@ -3457,10 +3457,10 @@ int cgroup_change_cgroup_flags(uid_t uid, gid_t gid,
|
||||
@@ -3959,10 +3959,10 @@ int cgroup_change_cgroup_flags(uid_t uid, gid_t gid,
|
||||
available, "%d", pid);
|
||||
break;
|
||||
case 'p':
|
||||
|
32
libcgroup-tests-unbundle-gtest.patch
Normal file
32
libcgroup-tests-unbundle-gtest.patch
Normal file
@ -0,0 +1,32 @@
|
||||
diff --git a/tests/gunit/Makefile.am b/tests/gunit/Makefile.am
|
||||
index 654002c..96399e9 100644
|
||||
--- a/tests/gunit/Makefile.am
|
||||
+++ b/tests/gunit/Makefile.am
|
||||
@@ -22,8 +22,6 @@
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/tools \
|
||||
- -I$(top_builddir)/googletest/googletest/include \
|
||||
- -I$(top_builddir)/googletest/googletest \
|
||||
-std=c++11 \
|
||||
-Wno-write-strings \
|
||||
-DSTATIC= \
|
||||
@@ -31,10 +29,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
||||
LDADD = $(top_builddir)/src/.libs/libcgroupfortesting.la \
|
||||
$(top_builddir)/src/tools/.libs/libcgset.la
|
||||
|
||||
-EXTRA_DIST = $(top_srcdir)/googletest/googletest/libgtest.so \
|
||||
- $(top_srcdir)/googletest/googletest/libgtest_main.so \
|
||||
- $(top_srcdir)/googletest/googletest/include \
|
||||
- libcgroup_unittest.map
|
||||
+EXTRA_DIST = libcgroup_unittest.map
|
||||
|
||||
check_PROGRAMS = gtest
|
||||
TESTS = gtest
|
||||
@@ -56,5 +51,4 @@ gtest_SOURCES = gtest.cpp \
|
||||
014-cgroupv2_get_subtree_control.cpp \
|
||||
015-cgroupv2_controller_enabled.cpp \
|
||||
016-cgset_parse_r_flag.cpp
|
||||
-gtest_LDFLAGS = -L$(top_builddir)/googletest/googletest -l:libgtest.so \
|
||||
- -rpath $(abs_top_builddir)/googletest/googletest
|
||||
+gtest_LDFLAGS = -l:libgtest.so
|
@ -1,22 +1,31 @@
|
||||
%bcond_with tests
|
||||
|
||||
%global tests_commit 3c0c7b164b4221d78459fccdd49643a5dcb3f73d
|
||||
|
||||
Summary: Library to control and monitor control groups
|
||||
Name: libcgroup
|
||||
Version: 0.42.2
|
||||
Release: 5%{?dist}
|
||||
Version: 2.0
|
||||
Release: 1%{?dist}
|
||||
License: LGPLv2+
|
||||
URL: http://libcg.sourceforge.net/
|
||||
Source0: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-v%{version}.tar.gz
|
||||
Source1: cgconfig.service
|
||||
Source1: https://github.com/%{name}/%{name}-tests/archive/%{tests_commit}.tar.gz
|
||||
Source2: cgconfig.service
|
||||
|
||||
Patch0: fedora-config.patch
|
||||
Patch1: libcgroup-0.37-chmod.patch
|
||||
Patch2: libcgroup-0.40.rc1-coverity.patch
|
||||
Patch3: libcgroup-0.40.rc1-fread.patch
|
||||
Patch4: libcgroup-0.40.rc1-templates-fix.patch
|
||||
Patch5: libcgroup-tests-unbundle-gtest.patch
|
||||
|
||||
BuildRequires: autoconf, automake, libtool
|
||||
BuildRequires: gcc, gcc-c++
|
||||
BuildRequires: byacc, coreutils, flex, pam-devel, systemd-units
|
||||
BuildRequires: make
|
||||
%if %{with tests}
|
||||
BuildRequires: gtest-devel
|
||||
%endif
|
||||
Requires(pre): shadow-utils
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
@ -61,6 +70,10 @@ provide scripts to manage that configuration.
|
||||
%patch3 -p1 -b .fread
|
||||
%patch4 -p1 -b .templates-fix
|
||||
|
||||
%setup -D -T -a 1
|
||||
mv -T %{name}-tests-%{tests_commit} tests
|
||||
%patch5 -p1 -b .tests-unbundle-gtest
|
||||
|
||||
%build
|
||||
autoreconf -vif
|
||||
%configure --enable-pam-module-dir=%{_libdir}/security \
|
||||
@ -90,11 +103,13 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/cgrulesengd.8*
|
||||
|
||||
# install unit and sysconfig files
|
||||
install -d ${RPM_BUILD_ROOT}%{_unitdir}
|
||||
install -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}/
|
||||
install -m 644 %SOURCE2 ${RPM_BUILD_ROOT}%{_unitdir}/
|
||||
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
||||
|
||||
%pre
|
||||
getent group cgred >/dev/null || groupadd -r cgred
|
||||
%check
|
||||
%if %{with tests}
|
||||
make -C tests/gunit check
|
||||
%endif
|
||||
|
||||
%post tools
|
||||
%systemd_post cgconfig.service
|
||||
@ -120,6 +135,7 @@ getent group cgred >/dev/null || groupadd -r cgred
|
||||
%license COPYING
|
||||
%doc README
|
||||
%{_libdir}/libcgroup.so.1*
|
||||
%{_libdir}/libcgset.so.0*
|
||||
|
||||
%files tools
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
@ -136,8 +152,8 @@ getent group cgred >/dev/null || groupadd -r cgred
|
||||
%{_sbindir}/cgconfigparser
|
||||
%{_sbindir}/cgclear
|
||||
%{_bindir}/cgsnapshot
|
||||
%attr(2755, root, cgred) %{_bindir}/cgexec
|
||||
%attr(2755, root, cgred) %{_bindir}/cgclassify
|
||||
%{_bindir}/cgclassify
|
||||
%attr(0755, root, root) %{_bindir}/cgexec
|
||||
%attr(0644, root, root) %{_mandir}/man1/*
|
||||
%attr(0644, root, root) %{_mandir}/man5/*
|
||||
%attr(0644, root, root) %{_mandir}/man8/*
|
||||
@ -156,9 +172,14 @@ getent group cgred >/dev/null || groupadd -r cgred
|
||||
%{_includedir}/libcgroup.h
|
||||
%{_includedir}/libcgroup/*.h
|
||||
%{_libdir}/libcgroup.so
|
||||
%{_libdir}/libcgset.so
|
||||
%{_libdir}/pkgconfig/libcgroup.pc
|
||||
|
||||
%changelog
|
||||
* Sun May 16 2021 Nikola Forró <nforro@redhat.com> - 2.0-1
|
||||
- Rebase to 2.0
|
||||
resolves: #1961665
|
||||
|
||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.42.2-5
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
|
3
sources
3
sources
@ -1 +1,2 @@
|
||||
SHA512 (libcgroup-v0.42.2.tar.gz) = 4dadb4060ff8b05beaa8133a51325b88c48e4552cb7721787dd2be0ee728ea628012f07126ebc1383df7a06205c4ccc4840501a87e8d6793e9dc82ea3969d475
|
||||
SHA512 (libcgroup-v2.0.tar.gz) = 22d867c6ff939d919c14d0e4af68b747bc21e9760344f12e9ed52574173d46822e85bace3976addd8a2826b4a985507eb78eb54c10df07442232bde30ba2181e
|
||||
SHA512 (3c0c7b164b4221d78459fccdd49643a5dcb3f73d.tar.gz) = db69e13f1814134bdc73af64e07adf7097da284a82d4733209b955f59bacd7970e223408703dff59f358b11b4fd7bdb6b6adab759065a40cc098802f90c0afce
|
||||
|
Loading…
Reference in New Issue
Block a user