summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--0001-bypass-wrong-output-when-enabled-selinux.patch55
-rw-r--r--0002-dont-skip-security.evm-when-copy-xattr.patch27
-rw-r--r--attr.spec182
-rw-r--r--sources1
5 files changed, 266 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..15ae814 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/attr-2.5.2.tar.xz
diff --git a/0001-bypass-wrong-output-when-enabled-selinux.patch b/0001-bypass-wrong-output-when-enabled-selinux.patch
new file mode 100644
index 0000000..a9ce9d3
--- /dev/null
+++ b/0001-bypass-wrong-output-when-enabled-selinux.patch
@@ -0,0 +1,55 @@
+From 20576addae44d7256617806e4504524e0d1c9b13 Mon Sep 17 00:00:00 2001
+From: Shijie Luo <luoshijie1@huawei.com>
+Date: Sun, 15 Mar 2020 14:15:42 -0400
+Subject: [PATCH 7/7] bypass wrong output when enabled selinux
+
+When enforced selinux, excuting command getfattr may output something
+about selinux. Bypass these messages to make testcases go success.
+
+Signed-off-by: Shijie Luo <luoshijie1@huawei.com>
+---
+ test/run | 20 +++++++++++++-------
+ 1 file changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/test/run b/test/run
+index 07e916c..7e46a70 100755
+--- a/test/run
++++ b/test/run
+@@ -160,21 +160,27 @@ sub process_test($$$$) {
+ map { s/\s/\\$&/g; $_ } @$p), " -- ";
+ my $result = exec_test($prog, $in);
+ my @good = ();
+- my $nmax = (@$out > @$result) ? @$out : @$result;
+- for (my $n=0; $n < $nmax; $n++) {
++ my $nmax = @$out;
++ my $mmax = @$result;
++ for (my $n=0, my $m=0; $n < $nmax; $n++, $m++) {
+ my $use_re;
++
+ if (defined $out->[$n] && $out->[$n] =~ /^~ /) {
+ $use_re = 1;
+ $out->[$n] =~ s/^~ //g;
+ }
+
+- if (!defined($out->[$n]) || !defined($result->[$n]) ||
+- (!$use_re && $result->[$n] ne $out->[$n]) ||
+- ( $use_re && $result->[$n] !~ /^$out->[$n]/)) {
+- push @good, ($use_re ? '!~' : '!=');
++ while ($m < $mmax &&
++ (!$use_re && $result->[$m] ne $out->[$n]) ||
++ ( $use_re && $result->[$m] !~ /^$out->[$n]/)) {
++ $m++;
++ }
++
++ if (!defined($result->[$m])) {
++ push @good, ($use_re ? '!~' : '!=');
+ }
+ else {
+- push @good, ($use_re ? '=~' : '==');
++ push @good, ($use_re ? '=~' : '==');
+ }
+ }
+ my $good = !(grep /!/, @good);
+--
+1.8.3.1
+
diff --git a/0002-dont-skip-security.evm-when-copy-xattr.patch b/0002-dont-skip-security.evm-when-copy-xattr.patch
new file mode 100644
index 0000000..c0ce82b
--- /dev/null
+++ b/0002-dont-skip-security.evm-when-copy-xattr.patch
@@ -0,0 +1,27 @@
+From 0aa9a1568fc318345c4123fc19f825933f8dcb66 Mon Sep 17 00:00:00 2001
+From: zhangtianxing3 <zhangtianxing3@huawei.com>
+Date: Mon, 24 Jan 2022 11:39:36 +0800
+Subject: [PATCH] dont skip security.evm when copy xattr
+
+IMA feature need to use security.evm, so we should not skip
+
+Signed-off-by: lixiaokeng <lixiaokeng@huawei.com>
+Signed-off-by: volcanodragon <linfeilong@huawei.com>
+---
+ xattr.conf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xattr.conf b/xattr.conf
+index 1affac5..07d3403 100644
+--- a/xattr.conf
++++ b/xattr.conf
+@@ -18,5 +18,5 @@ trusted.SGI_DMI_* skip # xfs specific
+ trusted.SGI_MAC_FILE skip # xfs specific
+ xfsroot.* skip # xfs specific; obsolete
+ user.Beagle.* skip # ignore Beagle index data
+-security.evm skip # may only be written by kernel
++#security.evm skip # may only be written by kernel
+ afs.* skip # AFS metadata and ACLs
+--
+1.8.3.1
+
diff --git a/attr.spec b/attr.spec
new file mode 100644
index 0000000..4f51faa
--- /dev/null
+++ b/attr.spec
@@ -0,0 +1,182 @@
+Name: attr
+Version: 2.5.2
+Release: 1
+Summary: Commands for Manipulating Filesystem Extended Attributes
+License: GPL-2.0-or-later
+URL: https://savannah.nongnu.org/projects/attr
+Source0: https://download-mirror.savannah.gnu.org/releases/attr/attr-%{version}.tar.xz
+
+# fix test-suite failure with perl-5.26.0 (#1473853)
+Patch1: 0001-bypass-wrong-output-when-enabled-selinux.patch
+Patch2: 0002-dont-skip-security.evm-when-copy-xattr.patch
+
+BuildRequires: gettext, libtool, chrpath, gcc
+Provides: libattr = %{version}-%{release}
+Obsoletes: libattr < %{version}-%{release}
+Conflicts: xfsdump < 3.1.8
+Conflicts: filesystem < 3
+
+%description
+A set of tools for manipulating extended attributes on filesystem
+objects, in particular getfattr(1) and setfattr(1).
+An attr(1) command is also provided which is largely compatible
+with the SGI IRIX tool of the same name.
+
+%package -n libattr-devel
+License: LGPL-2.1-or-later
+Summary: Header files for libattr
+Requires: glibc-headers
+
+%description -n libattr-devel
+This package contains header files and documentation needed to
+develop programs which make use of extended attributes.
+For Linux programs, the documented system call API is the
+recommended interface, but an SGI IRIX compatibility interface
+is also provided.
+
+%package_help
+
+%prep
+%autosetup -n %{name}-%{version} -p1
+
+%build
+%configure --disable-silent-rules --disable-static
+%make_build
+
+%install
+%make_install
+%delete_la
+
+# remove rpath
+chrpath -d $RPM_BUILD_ROOT%{_bindir}/attr
+chrpath -d $RPM_BUILD_ROOT%{_bindir}/getfattr
+chrpath -d $RPM_BUILD_ROOT%{_bindir}/setfattr
+
+# handle docs on our own
+rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}*
+
+# temporarily provide attr/xattr.h symlink until users are migrated (#1601482)
+ln -fs ../sys/xattr.h $RPM_BUILD_ROOT%{_includedir}/attr/xattr.h
+
+%find_lang %{name}
+
+%check
+if ./setfattr -n user.name -v value .; then
+ make check || exit $?
+else
+ echo '*** xattrs are probably not supported by the file system,' \
+ 'the test-suite will NOT run ***'
+fi
+
+%files -f %{name}.lang
+%doc doc/CHANGES
+%license doc/COPYING*
+%{_bindir}/*
+%{_libdir}/libattr.so.*
+%config(noreplace) %{_sysconfdir}/xattr.conf
+
+%files -n libattr-devel
+%{_libdir}/libattr.so
+%{_libdir}/pkgconfig/*.pc
+%{_includedir}/attr
+
+%files help
+%{_mandir}/man?/*
+
+%changelog
+* Sun Aug 11 2024 Funda Wang <fundawang@yeah.net> - 2.5.2-1
+- update to 2.5.2
+
+* Tue Jul 30 2024 wangmian <wangmian19@h-partners.com> - 2.5.1-5
+- fix stale attr(5) references
+
+* Mon Dec 26 2022 tangyuchen <tangyuchen5@huawei.com> - 2.5.1-4
+- fix redundant spec code
+
+* Sat Oct 29 2022 wangzhiqiang <wangzhiqiang95@huawei.com> - 2.5.1-3
+- fix compile warning
+
+* Mon Jan 24 2022 volcanodragon <linfeilong@huawei.com> - 2.5.1-2
+- dont skip security.evm copy for ima
+
+* Tue Nov 16 2021 Wenchao Hao <haowenchao@huawei.com> - 2.5.1-1
+- Update to attr-2.5.1
+
+* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 2.4.48-14
+- DESC: delete -Sgit from %autosetup, and delete BuildRequires git
+
+* Fri Jul 23 2021 zhouwenpei <zhouwenpei1@huawei.com> - 2.4.48-13
+- remove useless buildrequires
+
+* Wed Sep 2 2020 Anakin Zhang <benjamin93@163.com> - 2.4.48-12
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC: carry security.evm when copying files
+
+* Sun Jul 12 2020 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 2.4.48-11
+- backport upstream bugfix patches
+
+* Wed Jun 29 2020 Markeryang <yanglongkang@163.com> - 2.4.48-10
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC: make check add judgment condition
+
+* Mon Jun 29 2020 Zhiqiang Liu <lzhq28@mail.ustc.edu.cn> - 2.4.48-9
+- Type:enhancement
+- ID:NA
+- SUG:NA
+- DESC: renumber patches
+
+* Fri Mar 20 2020 hy-euler <eulerstoragemt@huawei.com> - 2.4.48-8
+- Type:bugfix
+- ID:NA
+- SUG:NA
+- DESC: the building requires the gdb
+
+* Mon Mar 16 2020 Shijie Luo<luoshijie1@huawei.com> - 2.4.48-7
+- Type:bugfix
+- ID:NA
+- SUG:restart
+- DESC:fix error condition of while loop
+ in 0001-bypass-wrong-output-when-enabled-selinux.patch.
+
+* Mon Mar 16 2020 Shijie Luo<luoshijie1@huawei.com> - 2.4.48-6
+- Type:bugfix
+- ID:NA
+- SUG:restart
+- DESC:add patch to bypass selinux messages.
+
+* Fri Aug 30 2019 zoujing<zoujing13@huawei.com> - 2.4.48-5
+- Type:enhancemnet
+- ID:NA
+- SUG:restart
+- DESCi:openEuler Debranding
+
+* Tue Aug 20 2019 zoujing<zoujing13@huawei.com> - 2.4.48-4
+- Type:enhancemnet
+- ID:NA
+- SUG:NA
+- DESCi:openEuler Debranding
+
+* Tue Aug 20 2019 luoshijie<luoshijie1@huawei.com> - 2.4.48-2.3
+- Type:bugfix
+- ID:NA
+- SUG:restart
+- DESC:rename patch name
+
+* Wed Jun 12 2019 gulining<gulining1@huawei.com> - 2.4.48-2.2
+- Type:bugfix
+- ID:NA
+- SUG:restart
+- DESC:remove rpath
+
+* Wed Apr 24 2019 tianhang<tianhang1@huawei.com>- 2.4.48-2.1
+- Type:bugfix
+- ID:NA
+- SUG:restart
+- DESC:Switch back to syscall
+
+* Mon Apr 15 2019 Buildteam <buildteam@openeuler.org> - 2.4.48-2
+- Package Initialization
diff --git a/sources b/sources
new file mode 100644
index 0000000..a2b9863
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+4da9c1d25394946434e5913f49d778b6 attr-2.5.2.tar.xz