Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Paul Wouters
e4ae056e22 - Pull in upstream fix for too strict command option parsing
upstream patch 192c3a6bc18f206895ec5e38812d648ccfe7e281

	xshared: Accept an option if any given command allows it

	Fixed commit made option checking overly strict: Some commands may be
	commbined (foremost --list and --zero), reject a given option only if it
	is not allowed by any of the given commands.
2025-10-29 14:56:03 +01:00
2 changed files with 35 additions and 2 deletions

View file

@ -0,0 +1,27 @@
commit 192c3a6bc18f206895ec5e38812d648ccfe7e281
Author: Phil Sutter <phil@nwl.cc>
Date: Wed Apr 23 12:36:13 2025 +0200
xshared: Accept an option if any given command allows it
Fixed commit made option checking overly strict: Some commands may be
commbined (foremost --list and --zero), reject a given option only if it
is not allowed by any of the given commands.
Reported-by: Adam Nielsen <a.nielsen@shikadi.net>
Fixes: 9c09d28102bb4 ("xshared: Simplify generic_opt_check()")
Signed-off-by: Phil Sutter <phil@nwl.cc>
diff --git a/iptables/xshared.c b/iptables/xshared.c
index cdfd11ab..fc61e0fd 100644
--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -980,7 +980,7 @@ static void generic_opt_check(struct xt_cmd_parse_ops *ops,
*/
for (i = 0, optval = 1; i < NUMBER_OF_OPT; optval = (1 << ++i)) {
if ((options & optval) &&
- (options_v_commands[i] & command) != command)
+ !(options_v_commands[i] & command))
xtables_error(PARAMETER_PROBLEM,
"Illegal option `%s' with this command",
ops->option_name(optval));

View file

@ -11,7 +11,7 @@ Name: iptables
Summary: Tools for managing Linux kernel packet filtering capabilities
URL: https://www.netfilter.org/projects/iptables
Version: 1.8.11
Release: 11%{?dist}
Release: 12%{?dist}
Source0: %{url}/files/%{name}-%{version}.tar.xz
source1: %{url}/files/%{name}-%{version}.tar.xz.sig
Source2: coreteam-gpg-key-0xD70D1A666ACF2B21.txt
@ -27,7 +27,10 @@ Source11: ebtables-helper
Source12: ebtables-config
# Patch to fix -C handling, already upstream
# https://git.netfilter.org/iptables/patch/?id=40406dbfaefbc204134452b2747bae4f6a122848
Patch: iptables-1.8.11-fix-interface-comparisons.patch
Patch1: iptables-1.8.11-fix-interface-comparisons.patch
# Patch to fix overly strict command option checking
# https://git.netfilter.org/iptables/patch/?id=192c3a6bc18f206895ec5e38812d648ccfe7e281
Patch2: iptables-1.8.11-command-options-fix.patch
# pf.os: ISC license
# iptables-apply: Artistic Licence 2.0
@ -473,6 +476,9 @@ fi
%changelog
* Tue Oct 28 2025 Paul Wouters <paul.wouters@aiven.io> - 1.8.11-12
- Pull in upstream fix for too strict command option parsing
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.11-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild