!2 bypass wrong output when enabled selinux
Merge pull request !2 from shijieluo/master
This commit is contained in:
commit
eec77afe11
55
0001-bypass-wrong-output-when-enabled-selinux.patch
Normal file
55
0001-bypass-wrong-output-when-enabled-selinux.patch
Normal file
@ -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-1 &&
|
||||||
|
+ (!$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
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
%{!?_licensedir:%global license %%doc}
|
%{!?_licensedir:%global license %%doc}
|
||||||
Name: attr
|
Name: attr
|
||||||
Version: 2.4.48
|
Version: 2.4.48
|
||||||
Release: 5
|
Release: 6
|
||||||
Summary: Commands for Manipulating Filesystem Extended Attributes
|
Summary: Commands for Manipulating Filesystem Extended Attributes
|
||||||
License: GPLv2+ AND LGPLv2+
|
License: GPLv2+ AND LGPLv2+
|
||||||
URL: https://savannah.nongnu.org/projects/attr
|
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)
|
# fix test-suite failure with perl-5.26.0 (#1473853)
|
||||||
Patch0000: 0000-attr-2.4.48-test-suite-perl.patch
|
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
|
Patch6000: 6000-Switch-back-to-syscall.patch
|
||||||
|
|
||||||
|
|
||||||
@ -92,6 +93,12 @@ make %{?_smp_mflags} check
|
|||||||
%{_mandir}/man3/*
|
%{_mandir}/man3/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* 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
|
* Fri Aug 30 2019 zoujing<zoujing13@huawei.com> - 2.4.48-5
|
||||||
- Type:enhancemnet
|
- Type:enhancemnet
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user