Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-17047

Firewall check returns WARNING even if iptables and firewalld are stopped on CentOS7

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • trunk
    • 2.4.0
    • ambari-agent, ambari-server
    • CentOS7.2

    • Patch

    Description

      In firewall.py, "systemctl is-active iptables || systemctl is-active firewalld" is passed to run_in_shell function, which splits cmd string by using shlex.split.

      run_in_shell function finally calls subprocess.Popen with shell=True, so the cmd string is evaluated like Popen(['/bin/sh', '-c', 'systemctl', 'is-active', 'iptables', '||', 'systemctl', 'is-active', 'firewalld']). This doesn't returns values as expected, because after args[1] (in this case, after the first is-active) are evaluated as sh arguements.

      systemctl is-active can take multiple arugments, so we can use it.

      Attachments

        1. AMBARI-17047.patch
          2 kB
          Masahiro Tanaka
        2. AMBARI-17047.1.patch
          3 kB
          Masahiro Tanaka

        Issue Links

          Activity

            People

              masatana Masahiro Tanaka
              masatana Masahiro Tanaka
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: