Bug 54160 - iptables-save and iptables-restore parse and produce quotes differently from each other
iptables-save and iptables-restore parse and produce quotes differently from ...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: iptables (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-28 18:35 EDT by John Broadhead
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-10-26 02:09:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Broadhead 2001-09-28 18:35:37 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.78 [en] (Windows NT 5.0; U)

Description of problem:
If one has a rule with the --log-prefix parameter, everytime one saves the rule with iptables-save and then restores it with iptables-restore, 
the log prefix is wrapped in an extra layer of quotes.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.iptables -A firewall -j LOG --log-prefix Firewall: --log-level 6
2.iptables-save | iptables-restore ; iptables-save | iptables-restore ; iptables-save | iptables-restore
3.iptables-save


Actual Results:  Line for rule listed as:
-A firewall -j LOG --log-prefix """"Firewall:"""" --log-level 6


Expected Results:  Line should be listed as
-A firewall -j LOG --log-prefix Firewall: --log-level 6
or:
-A firewall -j LOG --log-prefix "Firewall:" --log-level 6
Depending on how quotes should be parsed


Additional info:
iptables-save and iptables-restore should understand the same language.
Comment 1 Michael Schwendt 2001-10-19 02:50:57 EDT
# iptables -F firewall
# iptables -X firewall
# iptables -N firewall
# iptables -A firewall -j LOG --log-prefix Firewall: --log-level 6
# iptables-save | iptables-restore ; iptables-save | iptables-restore ;
iptables-save | iptables-restore
# iptables-save

FWIW, I'm unable to reproduce this, although I can confirm that the code adds
quotes at the start and end of the prefix string if there are none. 

Which shell do you use? Do you have any special shell settings that
backslash-escape double-quotes maybe?
Comment 2 Michael Schwendt 2001-10-26 02:09:49 EDT
Is this a duplicate of bug #52550?
Comment 3 Bernhard Rosenkraenzer 2001-10-30 06:50:06 EST
Not exactly, but it's fixed in 1.2.3-1 as well.

Note You need to log in before you can comment on or make changes to this bug.