!25 fix ebtables-config file access permisson and fix ebt_print_error for prints null

#I5FAFW 
#I5FABN 
From: @eaglegai 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
This commit is contained in:
openeuler-ci-bot 2022-07-04 09:35:22 +00:00 committed by Gitee
commit f0c3680c87
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 71 additions and 4 deletions

View File

@ -0,0 +1,60 @@
From c8fdd609e905bb2c472758ef6e324cbb43958b9d Mon Sep 17 00:00:00 2001
From: sunsuwan <sunsuwan3@huawei.com>
Date: Tue, 14 Jun 2022 09:45:56 +0800
Subject: [PATCH] fix ebt_print_error for prints null
---
ebtablesd.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ebtablesd.c b/ebtablesd.c
index 02d51fa..930fc66 100644
--- a/ebtablesd.c
+++ b/ebtablesd.c
@@ -194,7 +194,7 @@ continue_read:
}
if (!(replace[i].flags & OPT_KERNELDATA)) {
ebt_print_error("ebtablesd: table %s has not "
- "been opened");
+ "been opened", argv[2]);
goto write_msg;
}
ebt_cleanup_replace(&replace[i]);
@@ -219,7 +219,7 @@ continue_read:
if (replace[i].flags & OPT_KERNELDATA) {
ebt_print_error("ebtablesd: table %s needs to "
"be freed before it can be "
- "opened");
+ "opened", argv[2]);
goto write_msg;
}
if (!ebt_get_kernel_table(&replace[i], 0)) {
@@ -248,7 +248,7 @@ continue_read:
if (replace[i].flags & OPT_KERNELDATA) {
ebt_print_error("ebtablesd: table %s needs to "
"be freed before it can be "
- "opened");
+ "opened", argv[2]);
goto write_msg;
}
tmp.filename = (char *)malloc(strlen(argv[3]) + 1);
@@ -296,7 +296,7 @@ continue_read:
}
if (!(replace[i].flags & OPT_KERNELDATA)) {
ebt_print_error("ebtablesd: table %s has not "
- "been opened");
+ "been opened", argv[2]);
goto write_msg;
}
/* The counters from the kernel are useless if we
@@ -324,7 +324,7 @@ continue_read:
}
if (!(replace[i].flags & OPT_KERNELDATA)) {
ebt_print_error("ebtablesd: table %s has not "
- "been opened");
+ "been opened", argv[2]);
goto write_msg;
}
replace[i].filename = (char *)malloc(strlen(argv[3]) + 1);
--
2.33.0

View File

@ -1,7 +1,7 @@
Name: ebtables
Version: 2.0.11
Release: 4
Release: 5
Summary: A filtering tool for a Linux-based bridging firewall
License: GPLv2+
URL: http://ebtables.sourceforge.net/
@ -10,8 +10,8 @@ Source2: ebtables.systemd
Source3: ebtables.service
Source4: ebtables-config
Patch0001: bugifx-Fix-string-case-option-can-not-work.patch
Patch0001: bugifx-Fix-string-case-option-can-not-work.patch
Patch0002: bugfix-Fix-ebt_print_error-for-prints-null.patch
BuildRequires: systemd libtool
BuildRequires: chrpath
@ -40,7 +40,7 @@ f=THANKS; iconv -f iso-8859-1 -t utf-8 $f -o $f.utf8 ; mv $f.utf8 $f
%install
install -d %{buildroot}{%{_initrddir},%{_unitdir},%{_libexecdir},%{_sysconfdir}/sysconfig}
install -p %{SOURCE3} %{buildroot}%{_unitdir}/
install -p %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/ebtables-config
install -p -D -m 600 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/ebtables-config
chmod -x %{buildroot}%{_unitdir}/*.service
install -m0755 %{SOURCE2} %{buildroot}%{_libexecdir}/ebtables
%make_install LIBDIR="/%{_lib}/ebtables" BINDIR="%{_sbindir}" MANDIR="%{_mandir}"
@ -101,6 +101,13 @@ fi
%doc %{_mandir}/man8/ebtables-legacy.8*
%changelog
* Mon Jul 04 2022 gaihuiying <eaglegai@163.com> - 2.0.11-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix ebtables-config file access permisson
fix ebt_print_error for prints null
* Thu Mar 24 2022 wangxiaopeng <wangxiaopeng7@huawei.com> - 2.0.11-4
- Type:bugfix
- ID:NA