Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 97686 - DNS failing to punch through firewall due to indescriminate grep in ifup-post
DNS failing to punch through firewall due to indescriminate grep in ifup-post
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2003-06-19 07:02 EDT by Martin Ebourne
Modified: 2014-03-16 22:36 EDT (History)
1 user (show)

See Also:
Fixed In Version: 7.25-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-06-19 14:03:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Proposed patch as detailed in text (679 bytes, patch)
2003-06-19 07:03 EDT, Martin Ebourne
no flags Details | Diff

  None (edit)
Description Martin Ebourne 2003-06-19 07:02:06 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030510

Description of problem:
ifup-post contains code to open the firewall for DNS replies when PEERDNS=yes.

However, there is a grep to prevent the repeated addition of DNS rules, as in:

    if ! iptables -L RH-Lokkit-0-50-INPUT -n | grep -q $nameserver ; then

This of course matches any rule which the nameserver IP address is entered for.
Hence if your DNS server (or relay) has other services (smtp, etc) which the
firewall is explicitly open for, then the nameserver entries are not added and
DNS fails to work.

I have changed mine to:

    if ! iptables -L RH-Lokkit-0-50-INPUT -n | grep -q "$nameserver.* --sport 53
" ; then

This slightly more specific grep ensures that only DNS lines are considered.

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

How reproducible:
Comment 1 Martin Ebourne 2003-06-19 07:03:43 EDT
Created attachment 92481 [details]
Proposed patch as detailed in text
Comment 2 Bill Nottingham 2003-06-19 14:03:01 EDT
Thanks, added to CVS. Will be in 7.25-1.

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