diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | 0000-attr-2.4.48-test-suite-perl.patch | 29 | ||||
-rw-r--r-- | 0001-bypass-wrong-output-when-enabled-selinux.patch | 55 | ||||
-rw-r--r-- | 0002-Switch-back-to-syscall.patch | 126 | ||||
-rw-r--r-- | 0003-dont-skip-security.evm-when-copy-xattr.patch | 26 | ||||
-rw-r--r-- | attr.spec | 163 | ||||
-rw-r--r-- | sources | 1 |
7 files changed, 401 insertions, 0 deletions
@@ -0,0 +1 @@ +/attr-2.4.48.tar.gz diff --git a/0000-attr-2.4.48-test-suite-perl.patch b/0000-attr-2.4.48-test-suite-perl.patch new file mode 100644 index 0000000..f91562f --- /dev/null +++ b/0000-attr-2.4.48-test-suite-perl.patch @@ -0,0 +1,29 @@ +From 46baedf88fe22abafa3f2341b2c1bcb4764ce389 Mon Sep 17 00:00:00 2001 +From: Troy Dawson <tdawson@redhat.com> +Date: Fri, 21 Jul 2017 14:05:47 -0700 +Subject: [PATCH] attr: escape left brace in a regex in test/run + +... to fix test-suite failure with perl-5.26.0 + +Bug: https://bugzilla.redhat.com/1473853 +Signed-off-by: Kamil Dudka <kdudka@redhat.com> +--- + test/run | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/run b/test/run +index 4b1f8d0..07e916c 100755 +--- a/test/run ++++ b/test/run +@@ -106,7 +106,7 @@ for (;;) { + if (defined $line) { + # Substitute %VAR and %{VAR} with environment variables. + $line =~ s[%(\w+)][$ENV{$1}]eg; +- $line =~ s[%{(\w+)}][$ENV{$1}]eg; ++ $line =~ s[%\{(\w+)}][$ENV{$1}]eg; + } + if (defined $line) { + if ($line =~ s/^\s*< ?//) { +-- +2.13.0 + 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..b897931 --- /dev/null +++ b/0001-bypass-wrong-output-when-enabled-selinux.patch @@ -0,0 +1,55 @@ +From 5dfe64a676969aeebae857f5ab8f1301c4f339f8 Mon Sep 17 00:00:00 2001 +From: Shijie Luo <luoshijie1@huawei.com> +Date: Sun, 15 Mar 2020 14:15:42 -0400 +Subject: [PATCH] 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 4b1f8d0..5c017cc 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); +-- +2.23.0 + diff --git a/0002-Switch-back-to-syscall.patch b/0002-Switch-back-to-syscall.patch new file mode 100644 index 0000000..de879e2 --- /dev/null +++ b/0002-Switch-back-to-syscall.patch @@ -0,0 +1,126 @@ +From 14adc898a36948267bfe5c63b399996879e94c98 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher <agruenba@redhat.com> +Date: Fri, 17 Aug 2018 14:07:31 +0200 +Subject: Switch back to syscall() + +Switch back to syscall() for the *xattr system calls. The current +mechanism of forwarding those calls to glibc breaks libraries like +libfakeroot (fakeroot) and libasan (the gcc address sanitizer; gcc +-fsanitize=address). + +Those libraries provide wrappers for functions defined in other shared +libraries, usually glibc, do their own processing, and forward calls to +the original symbols looke dup via dlsym(RTLD_NEXT, "symbol_name"). In +our case, dlsym returns the libattr_*xattr wrappers. However, when our +wrappers try calling glibc, they end up calling the libfakeroot / +libasan wrappers instead because those override the original symbols => +recursion. + +The libattr_*xattr wrappers will only be used when symbols are looked up +at runtime (dlopen / dlsym). Programs linking against libattr will +directly use the glibc provided symbols. Therefore, the slightly worse +performance of syscall() won't affect any of the "normal" users of +libattr. + +[nicolas.cavallari: with uclibc-ng, the recursion always happen] +Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr> +--- + libattr/syscalls.c | 26 ++++++++++++++------------ + 1 file changed, 14 insertions(+), 12 deletions(-) + +diff --git a/libattr/syscalls.c b/libattr/syscalls.c +index 3013aa0..721ad7f 100644 +--- a/libattr/syscalls.c ++++ b/libattr/syscalls.c +@@ -22,6 +22,8 @@ + + #include "config.h" + ++#include <unistd.h> ++#include <sys/syscall.h> + #include <sys/xattr.h> + + #ifdef HAVE_VISIBILITY_ATTRIBUTE +@@ -31,67 +33,67 @@ + int libattr_setxattr(const char *path, const char *name, + void *value, size_t size, int flags) + { +- return setxattr(path, name, value, size, flags); ++ return syscall(__NR_setxattr, path, name, value, size, flags); + } + + int libattr_lsetxattr(const char *path, const char *name, + void *value, size_t size, int flags) + { +- return lsetxattr(path, name, value, size, flags); ++ return syscall(__NR_lsetxattr, path, name, value, size, flags); + } + + int libattr_fsetxattr(int filedes, const char *name, + void *value, size_t size, int flags) + { +- return fsetxattr(filedes, name, value, size, flags); ++ return syscall(__NR_fsetxattr, filedes, name, value, size, flags); + } + + ssize_t libattr_getxattr(const char *path, const char *name, + void *value, size_t size) + { +- return getxattr(path, name, value, size); ++ return syscall(__NR_getxattr, path, name, value, size); + } + + ssize_t libattr_lgetxattr(const char *path, const char *name, + void *value, size_t size) + { +- return lgetxattr(path, name, value, size); ++ return syscall(__NR_lgetxattr, path, name, value, size); + } + + ssize_t libattr_fgetxattr(int filedes, const char *name, + void *value, size_t size) + { +- return fgetxattr(filedes, name, value, size); ++ return syscall(__NR_fgetxattr, filedes, name, value, size); + } + + ssize_t libattr_listxattr(const char *path, char *list, size_t size) + { +- return listxattr(path, list, size); ++ return syscall(__NR_listxattr, path, list, size); + } + + ssize_t libattr_llistxattr(const char *path, char *list, size_t size) + { +- return llistxattr(path, list, size); ++ return syscall(__NR_llistxattr, path, list, size); + } + + ssize_t libattr_flistxattr(int filedes, char *list, size_t size) + { +- return flistxattr(filedes, list, size); ++ return syscall(__NR_flistxattr, filedes, list, size); + } + + int libattr_removexattr(const char *path, const char *name) + { +- return removexattr(path, name); ++ return syscall(__NR_removexattr, path, name); + } + + int libattr_lremovexattr(const char *path, const char *name) + { +- return lremovexattr(path, name); ++ return syscall(__NR_lremovexattr, path, name); + } + + int libattr_fremovexattr(int filedes, const char *name) + { +- return fremovexattr(filedes, name); ++ return syscall(__NR_fremovexattr, filedes, name); + } + + #ifdef HAVE_VISIBILITY_ATTRIBUTE +-- +cgit v1.0-41-gc330 + diff --git a/0003-dont-skip-security.evm-when-copy-xattr.patch b/0003-dont-skip-security.evm-when-copy-xattr.patch new file mode 100644 index 0000000..9930d8b --- /dev/null +++ b/0003-dont-skip-security.evm-when-copy-xattr.patch @@ -0,0 +1,26 @@ +From 1da7c41a8df5649ba8996b0d446e0e9bd5b0a2d3 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 dcbc12c..125fd18 100644 +--- a/xattr.conf ++++ b/xattr.conf +@@ -18,4 +18,4 @@ 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 +-- +1.8.3.1 + diff --git a/attr.spec b/attr.spec new file mode 100644 index 0000000..1905f9d --- /dev/null +++ b/attr.spec @@ -0,0 +1,163 @@ +%{!?_licensedir:%global license %%doc} +Name: attr +Version: 2.4.48 +Release: 15 +Summary: Commands for Manipulating Filesystem Extended Attributes +License: GPLv2+ AND LGPLv2+ +URL: https://savannah.nongnu.org/projects/attr +Source0: https://download-mirror.savannah.gnu.org/releases/attr/attr-%{version}.tar.gz + +# fix test-suite failure with perl-5.26.0 (#1473853) +Patch0000: 0000-attr-2.4.48-test-suite-perl.patch +Patch0001: 0001-bypass-wrong-output-when-enabled-selinux.patch +Patch0002: 0002-Switch-back-to-syscall.patch +Patch0003: 0003-dont-skip-security.evm-when-copy-xattr.patch + + +BuildRequires: gettext, libtool, chrpath, gcc, git, gdb +Provides: libattr +Obsoletes: libattr +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: LGPLv2+ +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 +Summary: Including man files for attr +Requires: man + +%description help +This contains man files for the using of attr + +%prep +%autosetup -Sgit -n %{name}-%{version} + +%build +%configure --disable-silent-rules +make %{?_smp_mflags} + +%install +%make_install +# 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 + +%post -n %{name} -p /sbin/ldconfig +%postun -n %{name} -p /sbin/ldconfig + +%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 +%{_libdir}/libattr.a +%{_libdir}/libattr.la +%{_includedir}/attr + +%files help +%{_mandir}/man1/* +%{_mandir}/man3/* + +%changelog +* Sun Jan 30 2022 Zhiqiang Liu <liuzhiqiang26@huawei.com> -2.4.48-15 +- rename one patch for uniform format and donot skip security.evm copy for ima + +* Sat Nov 20 2021 yanglongkang <yanglongkang@huawei.com> -2.4.48-14 +- make check add judgment condition + +* Tue Feb 9 2021 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 2.4.48-13 +- fix dependency problem and set release num to 13 for CI + +* Tue Aug 18 2020 chenyaqiang <chenyaqiang@huawei.com> - 2.4.48-9 +- rebuild for package build + +* 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 @@ -0,0 +1 @@ +bc1e5cb5c96d99b24886f1f527d3bb3d attr-2.4.48.tar.gz |