From 61506d61990d5c07cab40d0fd6cbfc62da93f418 Mon Sep 17 00:00:00 2001 From: shijieluo Date: Sun, 15 Mar 2020 22:42:49 +0800 Subject: [PATCH 1/2] add patch to bypass selinux messages --- ...ss-wrong-output-when-enabled-selinux.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 0001-bypass-wrong-output-when-enabled-selinux.patch 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..5e05a28 --- /dev/null +++ b/0001-bypass-wrong-output-when-enabled-selinux.patch @@ -0,0 +1,47 @@ +From 47a7a1baa2347a13dbb4e2284ec76be1baa4adb2 Mon Sep 17 00:00:00 2001 +From: Shijie Luo +Date: Sun, 15 Mar 2020 14:15:42 -0400 +Subject: [PATCH] bypass wrong output when enabled selinux +When enforcing selinux, excuting command getfattr may output +something about selinux. Bypass these messages to make +testcases go success. + +Signed-off-by: Shijie Luo +--- + test/run | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/test/run b/test/run +index 4b1f8d0..780a49c 100755 +--- a/test/run ++++ b/test/run +@@ -160,17 +160,21 @@ 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; ++ while($m < $mmax-1 && $result->[$m] !~ $out->[$n]) { ++ $m++; ++ } + 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]/)) { ++ if (!defined($out->[$n]) || !defined($result->[$m]) || ++ (!$use_re && $result->[$m] ne $out->[$n]) || ++ ( $use_re && $result->[$m] !~ /^$out->[$n]/)) { + push @good, ($use_re ? '!~' : '!='); + } + else { +-- +2.23.0 + -- Gitee From a675e8ba84e35e2b638e8bfe4b64f670cd146464 Mon Sep 17 00:00:00 2001 From: shijieluo Date: Sun, 15 Mar 2020 22:47:50 +0800 Subject: [PATCH 2/2] update attr.spec. bypass wrong output when enabled selinux --- attr.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/attr.spec b/attr.spec index dffc3a4..74c42fd 100644 --- a/attr.spec +++ b/attr.spec @@ -1,7 +1,7 @@ %{!?_licensedir:%global license %%doc} Name: attr Version: 2.4.48 -Release: 5 +Release: 6 Summary: Commands for Manipulating Filesystem Extended Attributes License: GPLv2+ AND LGPLv2+ URL: https://savannah.nongnu.org/projects/attr @@ -9,6 +9,7 @@ Source0: https://download-mirror.savannah.gnu.org/releases/attr/attr-%{version}. # 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 Patch6000: 6000-Switch-back-to-syscall.patch @@ -92,6 +93,12 @@ make %{?_smp_mflags} check %{_mandir}/man3/* %changelog +* Sun Mar 15 2020 zoujing - 2.4.48-6 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC:bypass wrong output when enabled selinux. + * Fri Aug 30 2019 zoujing - 2.4.48-5 - Type:enhancemnet - ID:NA -- Gitee